Adds project Abbreviation on Dataset listing model.

This commit is contained in:
gkolokythas 2019-05-15 18:24:31 +03:00
parent bb3fb91ba8
commit 25ce03b962
1 changed files with 9 additions and 0 deletions

View File

@ -24,6 +24,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
private Date created; private Date created;
private Date modified; private Date modified;
private String description; private String description;
private String projectAbbreviation;
public String getId() { public String getId() {
return id; return id;
@ -116,6 +117,13 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
this.description = description; this.description = description;
} }
public String getProjectAbbreviation() {
return projectAbbreviation;
}
public void setProjectAbbreviation(String projectAbbreviation) {
this.projectAbbreviation = projectAbbreviation;
}
@Override @Override
public DatasetListingModel fromDataModel(Dataset entity) { public DatasetListingModel fromDataModel(Dataset entity) {
this.id = entity.getId().toString(); this.id = entity.getId().toString();
@ -128,6 +136,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
this.profile = entity.getProfile() != null ? entity.getProfile().getLabel() : ""; this.profile = entity.getProfile() != null ? entity.getProfile().getLabel() : "";
this.description = entity.getDescription(); this.description = entity.getDescription();
this.status = entity.getStatus(); this.status = entity.getStatus();
this.projectAbbreviation = entity.getDmp().getProject().getAbbreviation();
this.registries = LabelBuilder.getLabel(entity.getRegistries().stream().map(item -> new eu.eudat.models.data.dataset.Registry().fromDataModel(item)).collect(Collectors.toList())); this.registries = LabelBuilder.getLabel(entity.getRegistries().stream().map(item -> new eu.eudat.models.data.dataset.Registry().fromDataModel(item)).collect(Collectors.toList()));
this.dataRepositories = LabelBuilder.getLabel(entity.getDatasetDataRepositories().stream().map(item -> new DataRepository().fromDataModel(item.getDataRepository())).collect(Collectors.toList())); this.dataRepositories = LabelBuilder.getLabel(entity.getDatasetDataRepositories().stream().map(item -> new DataRepository().fromDataModel(item.getDataRepository())).collect(Collectors.toList()));
this.services = LabelBuilder.getLabel(entity.getServices().stream().map(item -> new Service().fromDataModel(item.getService())).collect(Collectors.toList())); this.services = LabelBuilder.getLabel(entity.getServices().stream().map(item -> new Service().fromDataModel(item.getService())).collect(Collectors.toList()));