Adds finalized date on Datasets and DMPs on backend.
This commit is contained in:
parent
f14a1e63fd
commit
147eb2ce44
|
@ -155,10 +155,13 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
@Convert(converter = DateToUTCConverter.class)
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
private Date modified = new Date();
|
private Date modified = new Date();
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Description\"")
|
@Column(name = "\"Description\"")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@Column(name= "\"FinalizedDat\"")
|
||||||
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
|
private Date finalizedDat;
|
||||||
|
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return description;
|
return description;
|
||||||
|
@ -286,6 +289,13 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
this.dmpProperties = dmpProperties;
|
this.dmpProperties = dmpProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getFinalizedDat() {
|
||||||
|
return finalizedDat;
|
||||||
|
}
|
||||||
|
public void setFinalizedDat(Date finalizedDat) {
|
||||||
|
this.finalizedDat = finalizedDat;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(DMP entity) {
|
public void update(DMP entity) {
|
||||||
this.associatedDmps = entity.associatedDmps;
|
this.associatedDmps = entity.associatedDmps;
|
||||||
|
@ -300,6 +310,7 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
this.organisations = entity.getOrganisations();
|
this.organisations = entity.getOrganisations();
|
||||||
this.dmpProperties = entity.getDmpProperties();
|
this.dmpProperties = entity.getDmpProperties();
|
||||||
this.setModified(new Date());
|
this.setModified(new Date());
|
||||||
|
if (entity.getStatus().equals(DMPStatus.FINALISED.getValue())) this.setFinalizedDat(new Date());
|
||||||
if (entity.getUsers() != null) this.users = entity.getUsers();
|
if (entity.getUsers() != null) this.users = entity.getUsers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,11 +140,14 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
@Column(name = "\"Description\"")
|
@Column(name = "\"Description\"")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@Column(name= "\"FinalizedDat\"")
|
||||||
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
|
private Date finalizedDat;
|
||||||
|
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +156,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public UserInfo getCreator() {
|
public UserInfo getCreator() {
|
||||||
return creator;
|
return creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreator(UserInfo creator) {
|
public void setCreator(UserInfo creator) {
|
||||||
this.creator = creator;
|
this.creator = creator;
|
||||||
}
|
}
|
||||||
|
@ -161,8 +163,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public Short getStatus() {
|
public Short getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setStatus(Short status) {
|
public void setStatus(Short status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
@ -171,8 +171,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public Date getCreated() {
|
public Date getCreated() {
|
||||||
return created;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public void setCreated(Date created) {
|
||||||
this.created = created;
|
this.created = created;
|
||||||
}
|
}
|
||||||
|
@ -181,8 +179,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public Date getModified() {
|
public Date getModified() {
|
||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setModified(Date modified) {
|
public void setModified(Date modified) {
|
||||||
this.modified = modified;
|
this.modified = modified;
|
||||||
}
|
}
|
||||||
|
@ -191,8 +187,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public Set<Registry> getRegistries() {
|
public Set<Registry> getRegistries() {
|
||||||
return registries;
|
return registries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setRegistries(Set<Registry> registries) {
|
public void setRegistries(Set<Registry> registries) {
|
||||||
this.registries = registries;
|
this.registries = registries;
|
||||||
}
|
}
|
||||||
|
@ -200,7 +194,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public Set<DatasetService> getServices() {
|
public Set<DatasetService> getServices() {
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setServices(Set<DatasetService> services) {
|
public void setServices(Set<DatasetService> services) {
|
||||||
this.services = services;
|
this.services = services;
|
||||||
}
|
}
|
||||||
|
@ -208,8 +201,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public void setId(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
@ -218,8 +209,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public String getLabel() {
|
public String getLabel() {
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
public void setLabel(String label) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
@ -228,8 +217,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public DMP getDmp() {
|
public DMP getDmp() {
|
||||||
return dmp;
|
return dmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setDmp(DMP dmp) {
|
public void setDmp(DMP dmp) {
|
||||||
this.dmp = dmp;
|
this.dmp = dmp;
|
||||||
}
|
}
|
||||||
|
@ -238,8 +225,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public String getUri() {
|
public String getUri() {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setUri(String uri) {
|
public void setUri(String uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
}
|
}
|
||||||
|
@ -248,8 +233,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public String getProperties() {
|
public String getProperties() {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setProperties(String properties) {
|
public void setProperties(String properties) {
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
}
|
}
|
||||||
|
@ -258,8 +241,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public DatasetProfile getProfile() {
|
public DatasetProfile getProfile() {
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setProfile(DatasetProfile profile) {
|
public void setProfile(DatasetProfile profile) {
|
||||||
this.profile = profile;
|
this.profile = profile;
|
||||||
}
|
}
|
||||||
|
@ -268,7 +249,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public Set<DatasetDataRepository> getDatasetDataRepositories() {
|
public Set<DatasetDataRepository> getDatasetDataRepositories() {
|
||||||
return datasetDataRepositories;
|
return datasetDataRepositories;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDatasetDataRepositories(Set<DatasetDataRepository> datasetDataRepositories) {
|
public void setDatasetDataRepositories(Set<DatasetDataRepository> datasetDataRepositories) {
|
||||||
this.datasetDataRepositories = datasetDataRepositories;
|
this.datasetDataRepositories = datasetDataRepositories;
|
||||||
}
|
}
|
||||||
|
@ -276,8 +256,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public String getReference() {
|
public String getReference() {
|
||||||
return reference;
|
return reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setReference(String reference) {
|
public void setReference(String reference) {
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
@ -285,7 +263,6 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public Set<DatasetExternalDataset> getDatasetExternalDatasets() {
|
public Set<DatasetExternalDataset> getDatasetExternalDatasets() {
|
||||||
return datasetExternalDatasets;
|
return datasetExternalDatasets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDatasetExternalDatasets(Set<DatasetExternalDataset> datasetExternalDatasets) {
|
public void setDatasetExternalDatasets(Set<DatasetExternalDataset> datasetExternalDatasets) {
|
||||||
this.datasetExternalDatasets = datasetExternalDatasets;
|
this.datasetExternalDatasets = datasetExternalDatasets;
|
||||||
}
|
}
|
||||||
|
@ -293,11 +270,17 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
public boolean isPublic() {
|
public boolean isPublic() {
|
||||||
return isPublic;
|
return isPublic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPublic(boolean aPublic) {
|
public void setPublic(boolean aPublic) {
|
||||||
isPublic = aPublic;
|
isPublic = aPublic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getFinalizedDat() {
|
||||||
|
return finalizedDat;
|
||||||
|
}
|
||||||
|
public void setFinalizedDat(Date finalizedDat) {
|
||||||
|
this.finalizedDat = finalizedDat;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Dataset entity) {
|
public void update(Dataset entity) {
|
||||||
this.setRegistries(entity.getRegistries());
|
this.setRegistries(entity.getRegistries());
|
||||||
|
@ -324,6 +307,7 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
this.setStatus(entity.getStatus());
|
this.setStatus(entity.getStatus());
|
||||||
this.setProfile(entity.getProfile());
|
this.setProfile(entity.getProfile());
|
||||||
this.setModified(new Date());
|
this.setModified(new Date());
|
||||||
|
if (entity.getStatus().equals(Status.FINALISED.getValue())) this.setFinalizedDat(new Date());
|
||||||
if (entity.getCreator() != null) this.creator = entity.getCreator();
|
if (entity.getCreator() != null) this.creator = entity.getCreator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
||||||
private String description;
|
private String description;
|
||||||
private String projectAbbreviation;
|
private String projectAbbreviation;
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
private Date finalizedDat;
|
||||||
|
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
@ -151,6 +152,14 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
||||||
this.projectId = projectId;
|
this.projectId = projectId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getFinalizedDat() {
|
||||||
|
return finalizedDat;
|
||||||
|
}
|
||||||
|
public void setFinalizedDat(Date finalizedDat) {
|
||||||
|
this.finalizedDat = finalizedDat;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataManagementPlanListingModel fromDataModel(DMP entity) {
|
public DataManagementPlanListingModel fromDataModel(DMP entity) {
|
||||||
this.id = entity.getId().toString();
|
this.id = entity.getId().toString();
|
||||||
|
@ -173,6 +182,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
||||||
this.description = entity.getDescription();
|
this.description = entity.getDescription();
|
||||||
this.projectAbbreviation = entity.getProject().getAbbreviation();
|
this.projectAbbreviation = entity.getProject().getAbbreviation();
|
||||||
this.projectId = entity.getProject().getId().toString();
|
this.projectId = entity.getProject().getId().toString();
|
||||||
|
this.finalizedDat = entity.getFinalizedDat();
|
||||||
|
|
||||||
if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) {
|
if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) {
|
||||||
this.associatedProfiles = new LinkedList<>();
|
this.associatedProfiles = new LinkedList<>();
|
||||||
|
@ -180,19 +190,6 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
|
||||||
AssociatedProfile associatedProfile = new AssociatedProfile().fromData(datasetProfile);
|
AssociatedProfile associatedProfile = new AssociatedProfile().fromData(datasetProfile);
|
||||||
this.associatedProfiles.add(associatedProfile);
|
this.associatedProfiles.add(associatedProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Document viewStyleDoc = XmlBuilder.fromXml(entity.getAssociatedDmps());
|
|
||||||
Element item = (Element) viewStyleDoc.getElementsByTagName("profiles").item(0);
|
|
||||||
this.associatedProfiles = new LinkedList<>();
|
|
||||||
if (item != null) {
|
|
||||||
NodeList associatedProfilesElement = item.getChildNodes();
|
|
||||||
for (int temp = 0; temp < associatedProfilesElement.getLength(); temp++) {
|
|
||||||
Node associatedProfileElement = associatedProfilesElement.item(temp);
|
|
||||||
if (associatedProfileElement.getNodeType() == Node.ELEMENT_NODE) {
|
|
||||||
this.associatedProfiles.add(new AssociatedProfile().fromXml((Element) associatedProfileElement));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -26,6 +26,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
||||||
private String description;
|
private String description;
|
||||||
private String projectAbbreviation;
|
private String projectAbbreviation;
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
private Date finalizedDat;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -132,6 +133,13 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
||||||
this.projectId = projectId;
|
this.projectId = projectId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getFinalizedDat() {
|
||||||
|
return finalizedDat;
|
||||||
|
}
|
||||||
|
public void setFinalizedDat(Date finalizedDat) {
|
||||||
|
this.finalizedDat = finalizedDat;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetListingModel fromDataModel(Dataset entity) {
|
public DatasetListingModel fromDataModel(Dataset entity) {
|
||||||
this.id = entity.getId().toString();
|
this.id = entity.getId().toString();
|
||||||
|
@ -149,6 +157,7 @@ public class DatasetListingModel implements DataModel<Dataset, DatasetListingMod
|
||||||
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()));
|
||||||
|
this.finalizedDat = entity.getFinalizedDat();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue