Allow to manually add reference

This commit is contained in:
George Kalampokis 2021-04-29 11:28:46 +03:00
parent 501ca9fcc2
commit df5281eeaa
6 changed files with 36 additions and 7 deletions

View File

@ -700,7 +700,9 @@ public class DataManagementPlanManager {
}
if (createNew) {
if (organisation.getReference() == null) {
organisation.setReference("Internal:" + UUID.randomUUID().toString());
}
organisationRepository.createOrUpdate(organisation);
}
}

View File

@ -295,7 +295,7 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
grant.setAbbreviation("");
grant.setLabel(this.grant.getLabel());
grant.setType(Grant.GrantType.INTERNAL.getValue());
grant.setReference("dmp:" + grant.getId());
grant.setReference("dmp:" + (this.grant.getReference() != null ? this.grant.getReference() : grant.getId()));
grant.setUri("");
grant.setDefinition("");
grant.setCreated(new Date());
@ -319,7 +319,7 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
funder.setId(UUID.randomUUID());
funder.setLabel(this.funder.getLabel());
funder.setType(Funder.FunderType.INTERNAL.getValue());
funder.setReference("dmp:" + funder.getId());
funder.setReference("dmp:" + (this.funder.getReference() != null ? this.funder.getReference() : funder.getId()));
funder.setDefinition("");
funder.setCreated(new Date());
funder.setStatus(Funder.Status.ACTIVE.getValue());
@ -341,7 +341,7 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
project.setAbbreviation("");
project.setLabel(this.project.getLabel());
project.setType(Project.ProjectType.INTERNAL.getValue());
project.setReference("dmp:" + project.getId());
project.setReference("dmp:" + (this.project.getReference() != null ? this.project.getReference() : project.getId()));
project.setUri("");
project.setDefinition("");
project.setCreated(new Date());

View File

@ -196,7 +196,7 @@ public class DataManagementPlanNewVersionModel implements DataModel<DMP, DataMan
grant.setAbbreviation("");
grant.setLabel(this.grant.getLabel());
grant.setType(eu.eudat.data.entities.Grant.GrantType.INTERNAL.getValue());
grant.setReference("dmp:" + grant.getId());
grant.setReference("dmp:" + (this.grant.getReference() != null ? this.grant.getReference() : grant.getId()));
grant.setUri("");
grant.setDefinition("");
grant.setCreated(new Date());
@ -220,7 +220,7 @@ public class DataManagementPlanNewVersionModel implements DataModel<DMP, DataMan
funder.setId(UUID.randomUUID());
funder.setLabel(this.funder.getLabel());
funder.setType(Funder.FunderType.INTERNAL.getValue());
funder.setReference("dmp:" + funder.getId());
funder.setReference("dmp:" + (this.funder.getReference() != null ? this.funder.getReference() : funder.getId()));
funder.setDefinition("");
funder.setCreated(new Date());
funder.setStatus(Funder.Status.ACTIVE.getValue());
@ -242,7 +242,7 @@ public class DataManagementPlanNewVersionModel implements DataModel<DMP, DataMan
project.setAbbreviation("");
project.setLabel(this.project.getLabel());
project.setType(Project.ProjectType.INTERNAL.getValue());
project.setReference("dmp:" + project.getId());
project.setReference("dmp:" + (this.project.getReference() != null ? this.project.getReference() : project.getId()));
project.setUri("");
project.setDefinition("");
project.setCreated(new Date());

View File

@ -3,6 +3,7 @@ package eu.eudat.models.data.funder;
public class FunderDMPEditorModel {
private Funder existFunder;
private String label;
private String reference;
public Funder getExistFunder() {
return existFunder;
@ -17,4 +18,12 @@ public class FunderDMPEditorModel {
public void setLabel(String label) {
this.label = label;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
}

View File

@ -4,6 +4,7 @@ public class GrantDMPEditorModel {
private Grant existGrant;
private String label;
private String description;
private String reference;
public Grant getExistGrant() {
return existGrant;
@ -25,4 +26,12 @@ public class GrantDMPEditorModel {
public void setDescription(String description) {
this.description = description;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
}

View File

@ -4,6 +4,7 @@ public class ProjectDMPEditorModel {
private Project existProject;
private String label;
private String description;
private String reference;
public Project getExistProject() {
return existProject;
@ -25,4 +26,12 @@ public class ProjectDMPEditorModel {
public void setDescription(String description) {
this.description = description;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
}