Updating Dmp properties persist
This commit is contained in:
parent
732dfd9bfb
commit
752935f6e5
|
@ -2,6 +2,7 @@ package eu.eudat.model.persist;
|
|||
|
||||
import eu.eudat.commons.enums.DmpStatus;
|
||||
import eu.eudat.commons.validation.ValidId;
|
||||
import eu.eudat.model.persist.dmpproperties.DmpPropertiesPersist;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.UUID;
|
||||
|
@ -15,7 +16,7 @@ public class DmpPersist {
|
|||
|
||||
private DmpStatus status;
|
||||
|
||||
private String properties;
|
||||
private DmpPropertiesPersist properties;
|
||||
|
||||
private String description;
|
||||
|
||||
|
@ -45,11 +46,11 @@ public class DmpPersist {
|
|||
this.status = status;
|
||||
}
|
||||
|
||||
public String getProperties() {
|
||||
public DmpPropertiesPersist getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setProperties(String properties) {
|
||||
public void setProperties(DmpPropertiesPersist properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package eu.eudat.model.persist.dmpproperties;
|
||||
|
||||
public class DmpBlueprintValue {
|
||||
|
||||
private String fieldId;
|
||||
|
||||
private String fieldValue;
|
||||
|
||||
public String getFieldId() {
|
||||
return fieldId;
|
||||
}
|
||||
|
||||
public void setFieldId(String fieldId) {
|
||||
this.fieldId = fieldId;
|
||||
}
|
||||
|
||||
public String getFieldValue() {
|
||||
return fieldValue;
|
||||
}
|
||||
|
||||
public void setFieldValue(String fieldValue) {
|
||||
this.fieldValue = fieldValue;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package eu.eudat.model.persist.dmpproperties;
|
||||
|
||||
public class DmpContact {
|
||||
|
||||
String userId;
|
||||
|
||||
String firstName;
|
||||
|
||||
String lastName;
|
||||
|
||||
String email;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package eu.eudat.model.persist.dmpproperties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DmpPropertiesPersist {
|
||||
|
||||
private List<DmpBlueprintValue> dmpBlueprintValues;
|
||||
|
||||
private List<DmpContact> contacts;
|
||||
|
||||
public List<DmpBlueprintValue> getDmpBlueprintValues() {
|
||||
return dmpBlueprintValues;
|
||||
}
|
||||
|
||||
public void setDmpBlueprintValues(List<DmpBlueprintValue> dmpBlueprintValues) {
|
||||
this.dmpBlueprintValues = dmpBlueprintValues;
|
||||
}
|
||||
|
||||
public List<DmpContact> getContacts() {
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public void setContacts(List<DmpContact> contacts) {
|
||||
this.contacts = contacts;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package eu.eudat.service.dmp;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.authorization.Permission;
|
||||
import eu.eudat.commons.JsonHandlingService;
|
||||
|
@ -56,6 +57,8 @@ public class DmpServiceImpl implements DmpService {
|
|||
|
||||
private final MessageSource messageSource;
|
||||
|
||||
private final JsonHandlingService jsonHandlingService;
|
||||
|
||||
private final EventBroker eventBroker;
|
||||
|
||||
@Autowired
|
||||
|
@ -67,6 +70,7 @@ public class DmpServiceImpl implements DmpService {
|
|||
ConventionService conventionService,
|
||||
ErrorThesaurusProperties errors,
|
||||
MessageSource messageSource,
|
||||
JsonHandlingService jsonHandlingService,
|
||||
EventBroker eventBroker) {
|
||||
this.entityManager = entityManager;
|
||||
this.authorizationService = authorizationService;
|
||||
|
@ -75,6 +79,7 @@ public class DmpServiceImpl implements DmpService {
|
|||
this.conventionService = conventionService;
|
||||
this.errors = errors;
|
||||
this.messageSource = messageSource;
|
||||
this.jsonHandlingService = jsonHandlingService;
|
||||
this.eventBroker = eventBroker;
|
||||
}
|
||||
|
||||
|
@ -101,7 +106,11 @@ public class DmpServiceImpl implements DmpService {
|
|||
|
||||
data.setLabel(model.getLabel());
|
||||
data.setStatus(model.getStatus());
|
||||
data.setProperties(model.getProperties());
|
||||
try {
|
||||
data.setProperties(this.jsonHandlingService.toJson(model.getProperties()));
|
||||
} catch (JsonProcessingException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
data.setDescription(model.getDescription());
|
||||
data.setUpdatedAt(Instant.now());
|
||||
if (isUpdate)
|
||||
|
|
Loading…
Reference in New Issue