Adds DOI variable to DMP models.

This commit is contained in:
gkolokythas 2019-07-05 14:08:24 +03:00
parent 195cea45c1
commit 7d68f93ecd
3 changed files with 30 additions and 1 deletions

View File

@ -167,6 +167,9 @@ public class DMP implements DataEntity<DMP, UUID> {
@Convert(converter = DateToUTCConverter.class) @Convert(converter = DateToUTCConverter.class)
private Date publishedAt; private Date publishedAt;
@Column(name = "\"DOI\"")
private String doi;
public String getDescription() { public String getDescription() {
return description; return description;
@ -315,7 +318,14 @@ public class DMP implements DataEntity<DMP, UUID> {
this.publishedAt = publishedAt; this.publishedAt = publishedAt;
} }
@Override public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
@Override
public void update(DMP entity) { public void update(DMP entity) {
this.associatedDmps = entity.associatedDmps; this.associatedDmps = entity.associatedDmps;
this.label = entity.getLabel(); this.label = entity.getLabel();
@ -333,6 +343,7 @@ public class DMP implements DataEntity<DMP, UUID> {
if (entity.getStatus().equals(DMPStatus.FINALISED.getValue())) this.setFinalizedAt(new Date()); if (entity.getStatus().equals(DMPStatus.FINALISED.getValue())) this.setFinalizedAt(new Date());
if (entity.isPublic) this.setPublishedAt(new Date()); if (entity.isPublic) this.setPublishedAt(new Date());
if (entity.getUsers() != null) this.users = entity.getUsers(); if (entity.getUsers() != null) this.users = entity.getUsers();
if (entity.getDoi() != null && entity.getDoi().trim().isEmpty()) this.doi = entity.doi;
} }
@Override @Override

View File

@ -41,6 +41,7 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
private List<DynamicFieldWithValue> dynamicFields; private List<DynamicFieldWithValue> dynamicFields;
private Map<String, Object> properties; private Map<String, Object> properties;
private List<UserInfoListingModel> users; private List<UserInfoListingModel> users;
private String doi;
public UUID getId() { public UUID getId() {
return id; return id;
@ -189,6 +190,13 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
this.users = users; this.users = users;
} }
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
@Override @Override
public DataManagementPlan fromDataModel(DMP entity) { public DataManagementPlan fromDataModel(DMP entity) {
this.id = entity.getId(); this.id = entity.getId();
@ -228,6 +236,7 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
this.status = entity.getStatus(); this.status = entity.getStatus();
this.associatedUsers = entity.getUsers().stream().map(item -> new UserListingModel().fromDataModel(item.getUser())).collect(Collectors.toList()); this.associatedUsers = entity.getUsers().stream().map(item -> new UserListingModel().fromDataModel(item.getUser())).collect(Collectors.toList());
this.users = entity.getUsers().stream().map(item -> new UserInfoListingModel().fromDataModel(item)).collect(Collectors.toList()); this.users = entity.getUsers().stream().map(item -> new UserInfoListingModel().fromDataModel(item)).collect(Collectors.toList());
this.doi = entity.getDoi();
return this; return this;
} }

View File

@ -41,6 +41,7 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
private String description; private String description;
private boolean isPublic; private boolean isPublic;
private Date publishedAt; private Date publishedAt;
private String doi;
public String getId() { public String getId() {
@ -169,6 +170,13 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.publishedAt = publishedAt; this.publishedAt = publishedAt;
} }
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
@Override @Override
public DataManagementPlanOverviewModel fromDataModel(DMP entity) { public DataManagementPlanOverviewModel fromDataModel(DMP entity) {
this.id = entity.getId().toString(); this.id = entity.getId().toString();
@ -201,6 +209,7 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
} }
this.isPublic = entity.isPublic(); this.isPublic = entity.isPublic();
this.publishedAt = entity.getPublishedAt(); this.publishedAt = entity.getPublishedAt();
this.doi = entity.getDoi();
return this; return this;
} }