Change the profile from DatasetListingModel from String to DatasetProfileOverviewModel

This commit is contained in:
George Kalampokis 2020-07-24 11:46:11 +03:00
parent b0067f20b5
commit b7b8e0b0e8
1 changed files with 6 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import eu.eudat.models.DataModel;
import eu.eudat.models.data.dataset.DataRepository; import eu.eudat.models.data.dataset.DataRepository;
import eu.eudat.models.data.dataset.Service; import eu.eudat.models.data.dataset.Service;
import eu.eudat.logic.utilities.helpers.LabelBuilder; import eu.eudat.logic.utilities.helpers.LabelBuilder;
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -18,7 +19,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
private String grant; private String grant;
private String dmp; private String dmp;
private String dmpId; private String dmpId;
private String profile; private DatasetProfileOverviewModel profile;
private String dataRepositories; private String dataRepositories;
private String registries; private String registries;
private String services; private String services;
@ -70,10 +71,11 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
this.dmpId = dmpId; this.dmpId = dmpId;
} }
public String getProfile() { public DatasetProfileOverviewModel getProfile() {
return profile; return profile;
} }
public void setProfile(String profile) {
public void setProfile(DatasetProfileOverviewModel profile) {
this.profile = profile; this.profile = profile;
} }
@ -194,7 +196,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
this.grant = entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : ""; this.grant = entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : "";
this.dmp = entity.getDmp() != null ? entity.getDmp().getLabel() : ""; this.dmp = entity.getDmp() != null ? entity.getDmp().getLabel() : "";
this.dmpId = entity.getDmp() != null ? entity.getDmp().getId().toString() : ""; this.dmpId = entity.getDmp() != null ? entity.getDmp().getId().toString() : "";
this.profile = entity.getProfile() != null ? entity.getProfile().getLabel() : ""; this.profile = entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()) : null;
this.description = entity.getDescription(); this.description = entity.getDescription();
this.status = entity.getStatus(); this.status = entity.getStatus();
this.grantAbbreviation = entity.getDmp() != null ? entity.getDmp().getGrant().getAbbreviation() : ""; this.grantAbbreviation = entity.getDmp() != null ? entity.getDmp().getGrant().getAbbreviation() : "";