Enriches RDA export model with more detailed descriptions.

This commit is contained in:
gkolokythas 2019-10-15 13:46:49 +03:00
parent 31b21289a0
commit 3c6bd9685b
11 changed files with 112 additions and 15 deletions

View File

@ -17,4 +17,9 @@ public class ContactIdRDAExportModel {
public void setContact_id_type(String contact_id_type) {
this.contact_id_type = contact_id_type;
}
ContactIdRDAExportModel(String contact_id, String contact_id_type) {
this.contact_id = contact_id;
this.contact_id_type = contact_id_type;
}
}

View File

@ -34,8 +34,7 @@ public class ContactRDAExportModel {
this.name = entity.getName();
// TODO: we should use a contact_id and not our UUID.
if (!entity.getId().toString().isEmpty()) {
this.contact_id = new ContactIdRDAExportModel();
this.contact_id.setContact_id(entity.getId().toString());
this.contact_id = new ContactIdRDAExportModel(entity.getId().toString(), "argos_internal");
}
else {
this.contact_id = null;

View File

@ -18,7 +18,7 @@ public class DatasetIdRDAExportModel {
this.dataset_id_type = dataset_id_type;
}
public DatasetIdRDAExportModel(String dataset_id, String dataset_id_type) {
DatasetIdRDAExportModel(String dataset_id, String dataset_id_type) {
this.dataset_id = dataset_id;
this.dataset_id_type = dataset_id_type;
}

View File

@ -0,0 +1,25 @@
package eu.eudat.models.data.rda;
public class DatasetMetadataIdRDAExportModel {
private String metadata_id;
private String metadata_id_type;
public String getMetadata_id() {
return metadata_id;
}
public void setMetadata_id(String metadata_id) {
this.metadata_id = metadata_id;
}
public String getMetadata_id_type() {
return metadata_id_type;
}
public void setMetadata_id_type(String metadata_id_type) {
this.metadata_id_type = metadata_id_type;
}
public DatasetMetadataIdRDAExportModel(String metadata_id, String metadata_id_type) {
this.metadata_id = metadata_id;
this.metadata_id_type = metadata_id_type;
}
}

View File

@ -0,0 +1,32 @@
package eu.eudat.models.data.rda;
public class DatasetMetadataRDAExportModel {
private String description; // Not mandatory.
private String language;
private DatasetMetadataIdRDAExportModel metadata_id;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public DatasetMetadataIdRDAExportModel getMetadata_id() {
return metadata_id;
}
public void setMetadata_id(DatasetMetadataIdRDAExportModel metadata_id) {
this.metadata_id = metadata_id;
}
public DatasetMetadataRDAExportModel fromDataModel() {
return this;
}
}

View File

@ -7,9 +7,12 @@ import java.util.Date;
public class DatasetRDAExportModel {
private DatasetIdRDAExportModel dataset_id;
private String description;
private Date issued; // created Date
private Date issued; // Created Date, could also use finalized one.
private String language;
private String title;
private String sensitive_data;
private String data_quality_assurance;
private DatasetMetadataRDAExportModel metadata;
public DatasetIdRDAExportModel getDataset_id() {
return dataset_id;
@ -51,7 +54,7 @@ public class DatasetRDAExportModel {
this.title = dataset.getLabel();
this.issued = dataset.getCreated();
this.language = "en"; // mock data
this.dataset_id = new DatasetIdRDAExportModel(dataset.getId().toString(), "internal");
this.dataset_id = new DatasetIdRDAExportModel(dataset.getId().toString(), "argos_internal");
return this;
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.models.data.rda;
public class DmpIdRDAExportModel {
private String dmp_id;
private String dmp_id_type;
public String getDmp_id() {
return dmp_id;
}
public void setDmp_id(String dmp_id) {
this.dmp_id = dmp_id;
}
public String getDmp_id_type() {
return dmp_id_type;
}
public void setDmp_id_type(String dmp_id_type) {
this.dmp_id_type = dmp_id_type;
}
DmpIdRDAExportModel(String dmp_id, String dmp_id_type) {
this.dmp_id = dmp_id;
this.dmp_id_type = dmp_id_type;
}
}

View File

@ -7,7 +7,7 @@ import java.util.Date;
import java.util.UUID;
public class DmpRDAExportModel {
private UUID id;
private DmpIdRDAExportModel dmp_id;
private String title;
private String description;
private Date created;
@ -17,11 +17,11 @@ public class DmpRDAExportModel {
private String ethical_issues_exist;
private ProjectRDAExportModel project;
public UUID getId() {
return id;
public DmpIdRDAExportModel getDmp_id() {
return dmp_id;
}
public void setId(UUID id) {
this.id = id;
public void setDmp_id(DmpIdRDAExportModel dmp_id) {
this.dmp_id = dmp_id;
}
public String getTitle() {
@ -82,7 +82,7 @@ public class DmpRDAExportModel {
public DmpRDAExportModel fromDataModel(DMP entity) {
this.id = entity.getId();
this.dmp_id = new DmpIdRDAExportModel(entity.getId().toString(), "argos_internal");
this.title = entity.getLabel();
this.description = entity.getDescription();
this.created = entity.getCreated();

View File

@ -17,4 +17,9 @@ public class FunderIdRDAExportModel {
public void setFunder_id_type(String funder_id_type) {
this.funder_id_type = funder_id_type;
}
FunderIdRDAExportModel(String funder_id, String funder_id_type) {
this.funder_id = funder_id;
this.funder_id_type = funder_id_type;
}
}

View File

@ -32,12 +32,10 @@ public class FundingRDAExportModel {
public FundingRDAExportModel fromDataModel(Funder funder, Grant grant) {
this.funding_status = "planned"; // mock data
if (funder != null) {
this.funder_id = new FunderIdRDAExportModel();
this.funder_id.setFunder_id(funder.getReference());
this.funder_id = new FunderIdRDAExportModel(funder.getReference(), "argos_internal");
}
if (grant != null) {
this.grant_id = new GrantIdRDAExportModel();
this.grant_id.setGrant_id(grant.getReference());
this.grant_id = new GrantIdRDAExportModel(grant.getReference(), "argos_internal");
}
return this;
}

View File

@ -17,4 +17,9 @@ public class GrantIdRDAExportModel {
public void setGrant_id_type(String grant_id_type) {
this.grant_id_type = grant_id_type;
}
GrantIdRDAExportModel(String grant_id, String grant_id_type) {
this.grant_id = grant_id;
this.grant_id_type = grant_id_type;
}
}