This commit is contained in:
parent
a00eec68d8
commit
06272c79da
|
@ -48,7 +48,9 @@ import entities.DMPProfile;
|
|||
import entities.Dataset;
|
||||
import entities.DatasetProfile;
|
||||
import entities.DatasetProfileRuleset;
|
||||
import entities.Organisation;
|
||||
import entities.Project;
|
||||
import entities.Researcher;
|
||||
import entities.UserInfo;
|
||||
import entities.responses.IDLabelPair;
|
||||
import helpers.SerializerProvider;
|
||||
|
@ -91,9 +93,14 @@ public class DMPs {
|
|||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = { "/dmps/{id}" }, produces="application/json")
|
||||
public @ResponseBody ResponseEntity<Object> getDMP(@PathVariable("id") String id){
|
||||
public @ResponseBody ResponseEntity<Object> getDMP(@PathVariable("id") String id, @RequestParam(value="eager", defaultValue="false") boolean eager){
|
||||
try {
|
||||
DMP dmp = dMPDao.read(UUID.fromString(id));
|
||||
if(eager) {
|
||||
dmp.getOrganisations().size(); //used only for lazy load trigger...
|
||||
dmp.getResearchers().size(); //used only for lazy load trigger...
|
||||
dmp.getUsers().size(); //used only for lazy load trigger...
|
||||
}
|
||||
return ResponseEntity.status(HttpStatus.OK).body(SerializerProvider.toJson(dmp));
|
||||
}
|
||||
catch(Exception ex) {
|
||||
|
@ -102,6 +109,7 @@ public class DMPs {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = { "/dmp/listDMPLabelID" }, produces="text/plain")
|
||||
public @ResponseBody ResponseEntity<Object> listDmpLabelID(){
|
||||
try {
|
||||
|
|
|
@ -117,11 +117,13 @@ public class Projects {
|
|||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = { "/projects/{id}" }, produces="application/json")
|
||||
public @ResponseBody ResponseEntity<Object> getProject(@PathVariable("id") String id) {
|
||||
public @ResponseBody ResponseEntity<Object> getProject(@PathVariable("id") String id, @RequestParam(value="eager", defaultValue="false") boolean eager) {
|
||||
try {
|
||||
Project project = projectDao.read(UUID.fromString(id));
|
||||
|
||||
System.out.println(project.getId().toString());
|
||||
if(eager) {
|
||||
project.getDmps().size(); //used only for lazy load trigger...
|
||||
}
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(SerializerProvider.toJson(project));
|
||||
}
|
||||
|
|
|
@ -35,9 +35,8 @@
|
|||
<constructor-arg type = "String" value = "${proxy.allowed.host}"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="externalUrlLoader" class="proxy.config.ConfigLoader">
|
||||
<constructor-arg type="java.lang.String" value = "classpath:ExternalUrlsTEST.xml"/>
|
||||
<constructor-arg type="java.lang.String" value = "file:///home/nikolas/git/OpenAIRE-EUDAT-DMP/dmp-backend/src/test/resources/ExternalUrlsTEST.xml"/>
|
||||
</bean>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue