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) { public void setContact_id_type(String contact_id_type) {
this.contact_id_type = 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(); this.name = entity.getName();
// TODO: we should use a contact_id and not our UUID. // TODO: we should use a contact_id and not our UUID.
if (!entity.getId().toString().isEmpty()) { if (!entity.getId().toString().isEmpty()) {
this.contact_id = new ContactIdRDAExportModel(); this.contact_id = new ContactIdRDAExportModel(entity.getId().toString(), "argos_internal");
this.contact_id.setContact_id(entity.getId().toString());
} }
else { else {
this.contact_id = null; this.contact_id = null;

View File

@ -18,7 +18,7 @@ public class DatasetIdRDAExportModel {
this.dataset_id_type = dataset_id_type; 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 = dataset_id;
this.dataset_id_type = dataset_id_type; 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 { public class DatasetRDAExportModel {
private DatasetIdRDAExportModel dataset_id; private DatasetIdRDAExportModel dataset_id;
private String description; private String description;
private Date issued; // created Date private Date issued; // Created Date, could also use finalized one.
private String language; private String language;
private String title; private String title;
private String sensitive_data;
private String data_quality_assurance;
private DatasetMetadataRDAExportModel metadata;
public DatasetIdRDAExportModel getDataset_id() { public DatasetIdRDAExportModel getDataset_id() {
return dataset_id; return dataset_id;
@ -51,7 +54,7 @@ public class DatasetRDAExportModel {
this.title = dataset.getLabel(); this.title = dataset.getLabel();
this.issued = dataset.getCreated(); this.issued = dataset.getCreated();
this.language = "en"; // mock data 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; 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; import java.util.UUID;
public class DmpRDAExportModel { public class DmpRDAExportModel {
private UUID id; private DmpIdRDAExportModel dmp_id;
private String title; private String title;
private String description; private String description;
private Date created; private Date created;
@ -17,11 +17,11 @@ public class DmpRDAExportModel {
private String ethical_issues_exist; private String ethical_issues_exist;
private ProjectRDAExportModel project; private ProjectRDAExportModel project;
public UUID getId() { public DmpIdRDAExportModel getDmp_id() {
return id; return dmp_id;
} }
public void setId(UUID id) { public void setDmp_id(DmpIdRDAExportModel dmp_id) {
this.id = id; this.dmp_id = dmp_id;
} }
public String getTitle() { public String getTitle() {
@ -82,7 +82,7 @@ public class DmpRDAExportModel {
public DmpRDAExportModel fromDataModel(DMP entity) { public DmpRDAExportModel fromDataModel(DMP entity) {
this.id = entity.getId(); this.dmp_id = new DmpIdRDAExportModel(entity.getId().toString(), "argos_internal");
this.title = entity.getLabel(); this.title = entity.getLabel();
this.description = entity.getDescription(); this.description = entity.getDescription();
this.created = entity.getCreated(); this.created = entity.getCreated();

View File

@ -17,4 +17,9 @@ public class FunderIdRDAExportModel {
public void setFunder_id_type(String funder_id_type) { public void setFunder_id_type(String funder_id_type) {
this.funder_id_type = 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) { public FundingRDAExportModel fromDataModel(Funder funder, Grant grant) {
this.funding_status = "planned"; // mock data this.funding_status = "planned"; // mock data
if (funder != null) { if (funder != null) {
this.funder_id = new FunderIdRDAExportModel(); this.funder_id = new FunderIdRDAExportModel(funder.getReference(), "argos_internal");
this.funder_id.setFunder_id(funder.getReference());
} }
if (grant != null) { if (grant != null) {
this.grant_id = new GrantIdRDAExportModel(); this.grant_id = new GrantIdRDAExportModel(grant.getReference(), "argos_internal");
this.grant_id.setGrant_id(grant.getReference());
} }
return this; return this;
} }

View File

@ -17,4 +17,9 @@ public class GrantIdRDAExportModel {
public void setGrant_id_type(String grant_id_type) { public void setGrant_id_type(String grant_id_type) {
this.grant_id_type = 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;
}
} }