|
|
|
@ -4,6 +4,7 @@ import eu.eudat.data.entities.DMP;
|
|
|
|
|
import eu.eudat.data.entities.Dataset;
|
|
|
|
|
import eu.eudat.data.entities.Grant;
|
|
|
|
|
import eu.eudat.models.DataModel;
|
|
|
|
|
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
@ -18,6 +19,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
|
|
|
|
private String grant;
|
|
|
|
|
private String dmp;
|
|
|
|
|
private String dmpId;
|
|
|
|
|
private DatasetProfileOverviewModel profile;
|
|
|
|
|
private int status;
|
|
|
|
|
private Date created;
|
|
|
|
|
private Date modified;
|
|
|
|
@ -63,6 +65,14 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
|
|
|
|
this.dmpId = dmpId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DatasetProfileOverviewModel getProfile() {
|
|
|
|
|
return profile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setProfile(DatasetProfileOverviewModel profile) {
|
|
|
|
|
this.profile = profile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getStatus() {
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
@ -137,6 +147,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
|
|
|
|
this.grant = entity.getDmp() != null ? entity.getDmp().getGrant().getLabel() : "";
|
|
|
|
|
this.dmp = entity.getDmp() != null ? entity.getDmp().getLabel() : "";
|
|
|
|
|
this.dmpId = entity.getDmp() != null ? entity.getDmp().getId().toString() : "";
|
|
|
|
|
this.profile = entity.getProfile() != null ? new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()) : null;
|
|
|
|
|
this.description = entity.getDescription();
|
|
|
|
|
this.status = entity.getStatus();
|
|
|
|
|
if (entity.getFinalizedAt() == null && entity.getStatus() == Dataset.Status.FINALISED.getValue()) {
|
|
|
|
@ -173,6 +184,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
|
|
|
|
dmp.setPublic(this.getPublic());
|
|
|
|
|
dmp.setFinalizedAt(this.getFinalizedAt());
|
|
|
|
|
entity.setDmp(dmp);
|
|
|
|
|
entity.setProfile(this.getProfile() != null ? this.getProfile().toDataModel() : null);
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|