Class ProjectController


  • @RestController
    @Api(description="The project controller",
         name="Project controller")
    public class ProjectController
    extends Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity addDigitalObject​(UUID projectUuid, UUID digitalObjectUuid)  
      org.springframework.http.ResponseEntity addDigitalObjects​(UUID projectUuid, List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)  
      org.springframework.http.ResponseEntity deleteProject​(UUID uuid)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Project> findAll​(int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy)  
      List<de.digitalcollections.model.api.identifiable.entity.Project> findAllReducedAsList()  
      de.digitalcollections.model.api.identifiable.entity.Project findByIdentifier​(String namespace, String id)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.Project> findByUuid​(UUID uuid, Locale pLocale)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.DigitalObject> getDigitalObjects​(UUID projectUuid, int pageNumber, int pageSize)  
      org.springframework.http.ResponseEntity removeDigitalObject​(UUID projectUuid, UUID digitalObjectUuid)  
      de.digitalcollections.model.api.identifiable.entity.Project save​(de.digitalcollections.model.api.identifiable.entity.Project project, org.springframework.validation.BindingResult errors)  
      org.springframework.http.ResponseEntity saveDigitalObjects​(UUID projectUuid, List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)  
      de.digitalcollections.model.api.identifiable.entity.Project update​(UUID uuid, de.digitalcollections.model.api.identifiable.entity.Project project, org.springframework.validation.BindingResult errors)  
    • Constructor Detail

      • ProjectController

        @Autowired
        public ProjectController​(ProjectService projectService)
    • Method Detail

      • addDigitalObject

        @ApiMethod(description="Add an existing digital object to an existing project")
        @PostMapping(value={"/latest/projects/{uuid}/digitalobjects/{digitalObjectUuid}","/v3/projects/{uuid}/digitalobjects/{digitalObjectUuid}"},
                     produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity addDigitalObject​(@ApiPathParam(description="UUID of the project") @PathVariable("uuid")
                                                                        UUID projectUuid,
                                                                        @ApiPathParam(description="UUID of the digital object") @PathVariable("digitalObjectUuid")
                                                                        UUID digitalObjectUuid)
      • addDigitalObjects

        @ApiMethod(description="Add existing digital objects to an existing project")
        @PostMapping(value={"/latest/projects/{uuid}/digitalobjects","/v3/projects/{uuid}/digitalobjects"},
                     produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity addDigitalObjects​(@ApiPathParam(description="UUID of the project") @PathVariable("uuid")
                                                                         UUID projectUuid,
                                                                         @ApiPathParam(description="List of the digital objects") @RequestBody
                                                                         List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)
      • deleteProject

        @ApiMethod(description="Delete an existing project and the identifiers, which belong to this project")
        @DeleteMapping(value={"/latest/projects/{uuid}","/v3/projects/{uuid}"},
                       produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity deleteProject​(@ApiPathParam(description="UUID of the project") @PathVariable("uuid")
                                                                     UUID uuid)
      • findAll

        @ApiMethod(description="Get all projects in reduced form (no identifiers)")
        @GetMapping(value={"/latest/projects","/v2/projects"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Project> findAll​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                        int pageNumber,
                                                                                                                                        @RequestParam(name="pageSize",required=false,defaultValue="25")
                                                                                                                                        int pageSize,
                                                                                                                                        @RequestParam(name="sortBy",required=false)
                                                                                                                                        List<de.digitalcollections.model.api.paging.Order> sortBy)
      • findAllReducedAsList

        @ApiMethod(description="Get all projects as list")
        @GetMapping(value={"/latest/projectlist","/v2/projectlist"},
                    produces="application/json")
        @ApiResponseObject
        public List<de.digitalcollections.model.api.identifiable.entity.Project> findAllReducedAsList()
      • findByIdentifier

        @ApiMethod(description="Get project by namespace and id")
        @GetMapping(value={"/latest/projects/identifier/{namespace}:{id}","/v3/projects/identifier/{namespace}:{id}"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.Project findByIdentifier​(@PathVariable
                                                                                            String namespace,
                                                                                            @PathVariable
                                                                                            String id)
                                                                                     throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • findByUuid

        @ApiMethod(description="Get an project as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header")
        @GetMapping(value={"/latest/projects/{uuid}","/v2/projects/{uuid}"},
                    produces={"application/json","application/xml"})
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.Project> findByUuid​(@ApiPathParam(description="UUID of the project, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid")
                                                                                                                               UUID uuid,
                                                                                                                               @ApiQueryParam(name="pLocale",description="Desired locale, e.g. <tt>de_DE</tt>. If unset, contents in all languages will be returned") @RequestParam(name="pLocale",required=false)
                                                                                                                               Locale pLocale)
                                                                                                                        throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • getDigitalObjects

        @ApiMethod(description="Get paged digital objects of a project")
        @GetMapping(value={"/latest/projects/{uuid}/digitalobjects","/v3/projects/{uuid}/digitalobjects"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.DigitalObject> getDigitalObjects​(@ApiPathParam(description="UUID of the project") @PathVariable("uuid")
                                                                                                                                                        UUID projectUuid,
                                                                                                                                                        @RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                                        int pageNumber,
                                                                                                                                                        @RequestParam(name="pageSize",required=false,defaultValue="25")
                                                                                                                                                        int pageSize)
      • removeDigitalObject

        @ApiMethod(description="Remove an existing digital object from an existing project")
        @DeleteMapping(value={"/latest/projects/{uuid}/digitalobjects/{digitalObjectUuid}","/v3/projects/{uuid}/digitalobjects/{digitalObjectUuid}"},
                       produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity removeDigitalObject​(@ApiPathParam(description="UUID of the project") @PathVariable("uuid")
                                                                           UUID projectUuid,
                                                                           @ApiPathParam(description="UUID of the digital object") @PathVariable("digitalObjectUuid")
                                                                           UUID digitalObjectUuid)
      • save

        @ApiMethod(description="Save a newly created project")
        @PostMapping(value={"/latest/projects","/v2/projects"},
                     produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.Project save​(@RequestBody
                                                                                de.digitalcollections.model.api.identifiable.entity.Project project,
                                                                                org.springframework.validation.BindingResult errors)
                                                                         throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • saveDigitalObjects

        @ApiMethod(description="Save existing digital objects into an existing project")
        @PutMapping(value={"/latest/projects/{uuid}/digitalobjects","/v3/projects/{uuid}/digitalobjects"},
                    produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity saveDigitalObjects​(@ApiPathParam(description="UUID of the project") @PathVariable("uuid")
                                                                          UUID projectUuid,
                                                                          @ApiPathParam(description="List of the digital objects") @RequestBody
                                                                          List<de.digitalcollections.model.api.identifiable.entity.DigitalObject> digitalObjects)
      • update

        @ApiMethod(description="Update an project")
        @PutMapping(value={"/latest/projects/{uuid}","/v2/projects/{uuid}"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.Project update​(@PathVariable
                                                                                  UUID uuid,
                                                                                  @RequestBody
                                                                                  de.digitalcollections.model.api.identifiable.entity.Project project,
                                                                                  org.springframework.validation.BindingResult errors)
                                                                           throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException