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)
private Date publishedAt;
@Column(name = "\"DOI\"")
private String doi;
public String getDescription() {
return description;
@ -315,7 +318,14 @@ public class DMP implements DataEntity<DMP, UUID> {
this.publishedAt = publishedAt;
}
@Override
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
@Override
public void update(DMP entity) {
this.associatedDmps = entity.associatedDmps;
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.isPublic) this.setPublishedAt(new Date());
if (entity.getUsers() != null) this.users = entity.getUsers();
if (entity.getDoi() != null && entity.getDoi().trim().isEmpty()) this.doi = entity.doi;
}
@Override

View File

@ -41,6 +41,7 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
private List<DynamicFieldWithValue> dynamicFields;
private Map<String, Object> properties;
private List<UserInfoListingModel> users;
private String doi;
public UUID getId() {
return id;
@ -189,6 +190,13 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
this.users = users;
}
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
@Override
public DataManagementPlan fromDataModel(DMP entity) {
this.id = entity.getId();
@ -228,6 +236,7 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
this.status = entity.getStatus();
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.doi = entity.getDoi();
return this;
}

View File

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