RecentActivityModel will store profile as DatasetProfileOverviewModel instead of just string
This commit is contained in:
parent
d1992b37c4
commit
db8debef86
|
@ -1,6 +1,7 @@
|
|||
package eu.eudat.models.data.dashboard.recent.model;
|
||||
|
||||
import eu.eudat.models.DataModel;
|
||||
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
||||
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||
|
||||
|
@ -20,7 +21,7 @@ public abstract class RecentActivityModel<T extends DataEntity, S extends DataMo
|
|||
private String grantId;
|
||||
private Date finalizedAt;
|
||||
private Date publishedAt;
|
||||
private String profile;
|
||||
private DatasetProfileOverviewModel profile;
|
||||
private int type;
|
||||
private List<UserInfoListingModel> users;
|
||||
private Boolean isPublic;
|
||||
|
@ -121,11 +122,11 @@ public abstract class RecentActivityModel<T extends DataEntity, S extends DataMo
|
|||
this.publishedAt = publishedAt;
|
||||
}
|
||||
|
||||
public String getProfile() {
|
||||
public DatasetProfileOverviewModel getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
public void setProfile(String profile) {
|
||||
public void setProfile(DatasetProfileOverviewModel profile) {
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import eu.eudat.data.entities.Dataset;
|
|||
import eu.eudat.logic.utilities.helpers.LabelBuilder;
|
||||
import eu.eudat.models.data.dataset.DataRepository;
|
||||
import eu.eudat.models.data.dataset.Service;
|
||||
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
||||
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -70,7 +71,7 @@ public class RecentDatasetModel extends RecentActivityModel<Dataset, RecentDatas
|
|||
this.setGrantAbbreviation(entity.getDmp() != null ? entity.getDmp().getGrant().getAbbreviation() : "");
|
||||
this.setPublishedAt(entity.getDmp() != null ? entity.getDmp().getPublishedAt() : new Date());
|
||||
this.setGrantId(entity.getDmp() != null ? entity.getDmp().getGrant().getId().toString() : "");
|
||||
this.setProfile(entity.getProfile() != null ? entity.getProfile().getLabel() : "");
|
||||
this.setProfile(entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()): null);
|
||||
this.setGrant(entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : "");
|
||||
this.setDataRepositories(entity.getDatasetDataRepositories() != null && !entity.getDatasetDataRepositories().isEmpty()? LabelBuilder.getLabel(entity.getDatasetDataRepositories().stream().map(item -> new DataRepository().fromDataModel(item.getDataRepository())).collect(Collectors.toList())) : "");
|
||||
this.setDmp( entity.getDmp() != null ? entity.getDmp().getLabel() : "");
|
||||
|
@ -95,7 +96,7 @@ public class RecentDatasetModel extends RecentActivityModel<Dataset, RecentDatas
|
|||
this.setGrantAbbreviation(entity.getDmp() != null ? entity.getDmp().getGrant().getAbbreviation() : "");
|
||||
this.setPublishedAt(entity.getDmp() != null ? entity.getDmp().getPublishedAt() : new Date());
|
||||
this.setGrantId(entity.getDmp() != null ? entity.getDmp().getGrant().getId().toString() : "");
|
||||
this.setProfile(entity.getProfile() != null ? entity.getProfile().getLabel() : "");
|
||||
this.setProfile(entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()) : null);
|
||||
this.setGrant(entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : "");
|
||||
this.setDmp( entity.getDmp() != null ? entity.getDmp().getLabel() : "");
|
||||
this.setDmpId(entity.getDmp() != null ? entity.getDmp().getId().toString() : "");
|
||||
|
|
|
@ -4,7 +4,6 @@ import eu.eudat.data.entities.DMP;
|
|||
import eu.eudat.logic.utilities.helpers.LabelBuilder;
|
||||
import eu.eudat.models.data.dmp.AssociatedProfile;
|
||||
import eu.eudat.models.data.dmp.Organisation;
|
||||
import eu.eudat.models.data.listingmodels.DatasetListingModel;
|
||||
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
||||
import eu.eudat.models.data.urls.DatasetUrlListing;
|
||||
|
||||
|
@ -92,7 +91,7 @@ public class RecentDmpModel extends RecentActivityModel<DMP, RecentDmpModel> {
|
|||
this.groupId = entity.getGroupId();
|
||||
this.setPublic(entity.isPublic());
|
||||
this.organisations = LabelBuilder.getLabel(entity.getOrganisations().stream().map(item -> new Organisation().fromDataModel(item)).collect(Collectors.toList()));
|
||||
if (entity.getProfile() != null) this.setProfile(entity.getProfile().getLabel());
|
||||
//if (entity.getProfile() != null) this.setProfile(new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()));
|
||||
this.setPublishedAt(entity.getPublishedAt());
|
||||
this.setUsers(entity.getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList()));
|
||||
return this;
|
||||
|
|
Loading…
Reference in New Issue