dataset listing fields model

This commit is contained in:
annampak 2017-12-19 18:26:29 +02:00
parent 3a0100da05
commit 44a53be5b1
4 changed files with 61 additions and 3 deletions

View File

@ -0,0 +1,17 @@
import { Serializable } from "../Serializable";
export class DataRepositoryModel implements Serializable<DataRepositoryModel> {
public id: String;
public name: String;
public pid: String;
public uri: String;
fromJSONObject(item: any): DataRepositoryModel {
this.id = item.id;
this.name = item.name;
this.pid = item.pid;
this.uri = item.uri;
return this;
}
}

View File

@ -5,6 +5,10 @@ import { BackendErrorValidator } from "../../utilities/validators/BackendErrorVa
import { BaseErrorModel } from "../error/BaseErrorModel";
import { AutoCompleteItem } from "../../shared/components/autocomplete/AutoCompleteItem";
import { ExternalSourcesItemModel } from "../external-sources/ExternalSourcesItemModel";
import { ServiceModel } from "../services/ServiceModel";
import { JsonSerializer } from "../../utilities/JsonSerializer";
import { RegisterModel } from "../registers/RegisterModel";
import { DataRepositoryModel } from "../dataRepositories/DataRepositoryModel";
export class DatasetModel implements Serializable<DatasetModel> {
public id: String;
@ -13,9 +17,9 @@ export class DatasetModel implements Serializable<DatasetModel> {
public uri: String;
public status: String;
public description: String;
public services: ExternalSourcesItemModel[] = [];
public registries: ExternalSourcesItemModel[] = [];
public dataRepositories: ExternalSourcesItemModel[] = [];
public services: ServiceModel[] = [];
public registries: RegisterModel[] = [];
public dataRepositories: DataRepositoryModel[] = [];
public errorModel: BaseErrorModel = new BaseErrorModel();
@ -26,6 +30,9 @@ export class DatasetModel implements Serializable<DatasetModel> {
this.uri = item.uri;
this.status = item.status;
this.description = item.description;
this.services = new JsonSerializer<ServiceModel>().fromJSONArray(item.services, ServiceModel);
//this.registries = new JsonSerializer<RegisterModel>().fromJSONArray(item.registries, RegisterModel);
//this.dataRepositories = new JsonSerializer<DataRepositoryModel>().fromJSONArray(item.dataRepositories, DataRepositoryModel);
return this;
}

View File

@ -0,0 +1,17 @@
import { Serializable } from "../Serializable";
export class RegisterModel implements Serializable<RegisterModel> {
public id: String;
public name: String;
public pid: String;
public uri: String;
fromJSONObject(item: any): RegisterModel {
this.id = item.id;
this.name = item.name;
this.pid = item.pid;
this.uri = item.uri;
return this;
}
}

View File

@ -0,0 +1,17 @@
import { Serializable } from "../Serializable";
export class ServiceModel implements Serializable<ServiceModel> {
public id: String;
public name: String;
public pid: String;
public uri: String;
fromJSONObject(item: any): ServiceModel {
this.id = item.id;
this.name = item.name;
this.pid = item.pid;
this.uri = item.uri;
return this;
}
}