This commit is contained in:
parent
c2fc7a6fe8
commit
e25964ba29
|
@ -13,6 +13,7 @@ public class SafeCleanAttribs {
|
|||
newdmp.setId(dmp.getId());
|
||||
dataset.setDmp(newdmp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -149,11 +149,15 @@ public class Datasets {
|
|||
dataset.setModified(new Date());
|
||||
dataset.setStatus(new Short("0"));
|
||||
dataset.setCreator(userInfo);
|
||||
if("".equals(dataset.getReference())) dataset.setReference(null);
|
||||
if("".equals(dataset.getProperties())) dataset.setProperties(null);
|
||||
|
||||
try {
|
||||
dataset = datasetDao.create(dataset);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(SerializerProvider.toJson(dataset));
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Could not create or update Dataset! Reason: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
@ -172,6 +176,9 @@ public class Datasets {
|
|||
|
||||
SafeCleanAttribs.clean(dataset);
|
||||
|
||||
if("".equals(dataset.getReference())) dataset.setReference(null);
|
||||
if("".equals(dataset.getProperties())) dataset.setProperties(null);
|
||||
|
||||
try {
|
||||
dataset = datasetDao.update(dataset);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(SerializerProvider.toJson(dataset));
|
||||
|
|
Loading…
Reference in New Issue