Minor edit
This commit is contained in:
parent
dcc9f2087a
commit
d3ab03d2df
|
@ -149,6 +149,48 @@ public class Datasets {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.GET, value = { "/assignDMPToDataset" })
|
||||||
|
public @ResponseBody ResponseEntity<Object> assignDMPToDataset(@RequestParam("datasetID") String datasetID, @RequestParam("dmpID") String dmpID) {
|
||||||
|
DMP dmp = null;
|
||||||
|
Dataset dataset = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
dmp = dMPDao.read(UUID.fromString(dmpID));
|
||||||
|
dataset = datasetDao.read(UUID.fromString(datasetID));
|
||||||
|
dataset.setDmp(dmp);
|
||||||
|
datasetDao.update(dataset);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).build();
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// try {dmp = dMPDao.read(UUID.fromString(dmpID));}
|
||||||
|
// catch(Exception e) {
|
||||||
|
// RestResponse rr = new RestResponse("Could not find a DMP with id: "+dmpID+"! Detailed message: " + e.getMessage(), null);
|
||||||
|
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(rr.toString());
|
||||||
|
// }
|
||||||
|
// try {dataset = datasetDao.read(UUID.fromString(datasetID));}
|
||||||
|
// catch(Exception e) {
|
||||||
|
// RestResponse rr = new RestResponse("Could not find a Dataset with id: "+datasetID+"! Detailed message: " + e.getMessage(), null);
|
||||||
|
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(rr.toString());
|
||||||
|
// }
|
||||||
|
// try {
|
||||||
|
// dataset.setDmp(dmp);
|
||||||
|
// datasetDao.update(dataset);
|
||||||
|
// RestResponse rr = new RestResponse("Assigned DMP with id: "+dmpID+" on Dataset with id: "+datasetID+"!", null);
|
||||||
|
// return ResponseEntity.status(HttpStatus.OK).body(rr.toString());
|
||||||
|
// }
|
||||||
|
// catch(Exception e) {
|
||||||
|
// RestResponse rr = new RestResponse("Could not assign DMP with id: "+dmpID+" on Dataset with id: "+datasetID+"! Detailed message: " + e.getMessage(), null);
|
||||||
|
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(rr.toString());
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@RequestMapping(method = RequestMethod.GET, value = { "/createEmptyDataset" })
|
@RequestMapping(method = RequestMethod.GET, value = { "/createEmptyDataset" })
|
||||||
public @ResponseBody ResponseEntity<Object> createEmptyDataset() {
|
public @ResponseBody ResponseEntity<Object> createEmptyDataset() {
|
||||||
|
|
Loading…
Reference in New Issue