Class CollectionsController


  • @Controller
    public class CollectionsController
    extends de.digitalcollections.commons.springmvc.controller.AbstractController
    Controller for collection management pages.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity addDigitalObjects​(UUID uuid, List<de.digitalcollections.model.identifiable.entity.DigitalObject> digitalObjects)  
      org.springframework.http.ResponseEntity addSubcollection​(UUID collectionUuid, UUID subcollectionUuid)  
      org.springframework.http.ResponseEntity addSubcollections​(UUID collectionUuid, List<de.digitalcollections.model.identifiable.entity.Collection> subcollections)  
      de.digitalcollections.model.identifiable.entity.Collection create()  
      String create​(org.springframework.ui.Model model, String parentType, UUID parentUuid)  
      String edit​(UUID uuid, Locale activeLanguage, org.springframework.ui.Model model)  
      de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> find​(int pageNumber, int pageSize, String searchTerm, List<de.digitalcollections.model.list.sorting.Order> sortBy)  
      de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.DigitalObject> findDigitalObjects​(UUID uuid, int pageNumber, int pageSize, String searchTerm)  
      de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findSubcollections​(UUID uuid, int pageNumber, int pageSize, String searchTerm)  
      de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findTop​(int pageNumber, int pageSize, String searchTerm, List<de.digitalcollections.model.list.sorting.Order> sortBy)  
      de.digitalcollections.model.identifiable.entity.Collection getByIdentifier​(String namespace, String id)  
      de.digitalcollections.model.identifiable.entity.Collection getByRefId​(long refId)  
      de.digitalcollections.model.identifiable.entity.Collection getByUuid​(UUID uuid)  
      String list​(org.springframework.ui.Model model)  
      protected String module()  
      org.springframework.http.ResponseEntity removeDigitalObject​(UUID collectionUuid, UUID digitalobjectUuid)  
      org.springframework.http.ResponseEntity removeSubcollection​(UUID collectionUuid, UUID subcollectionUuid)  
      org.springframework.http.ResponseEntity save​(de.digitalcollections.model.identifiable.entity.Collection collection, String parentType, UUID parentUuid)  
      org.springframework.http.ResponseEntity update​(UUID uuid, de.digitalcollections.model.identifiable.entity.Collection collection)  
      String view​(UUID uuid, org.springframework.ui.Model model)  
      String viewByRefId​(long refId, org.springframework.ui.Model model)  
      • Methods inherited from class de.digitalcollections.commons.springmvc.controller.AbstractController

        verifyBinding
    • Method Detail

      • addDigitalObjects

        @PostMapping("/api/collections/{uuid}/digitalobjects")
        public org.springframework.http.ResponseEntity addDigitalObjects​(@PathVariable
                                                                         UUID uuid,
                                                                         @RequestBody
                                                                         List<de.digitalcollections.model.identifiable.entity.DigitalObject> digitalObjects)
                                                                  throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • addSubcollection

        @PostMapping("/api/collections/{collectionUuid}/collections/{subcollectionUuid}")
        public org.springframework.http.ResponseEntity addSubcollection​(@PathVariable
                                                                        UUID collectionUuid,
                                                                        @PathVariable
                                                                        UUID subcollectionUuid)
                                                                 throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • addSubcollections

        @PostMapping("/api/collections/{collectionUuid}/collections")
        public org.springframework.http.ResponseEntity addSubcollections​(@PathVariable
                                                                         UUID collectionUuid,
                                                                         @RequestBody
                                                                         List<de.digitalcollections.model.identifiable.entity.Collection> subcollections)
                                                                  throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • create

        @GetMapping("/collections/new")
        public String create​(org.springframework.ui.Model model,
                             @RequestParam(name="parentType",required=false)
                             String parentType,
                             @RequestParam(name="parentUuid",required=false)
                             UUID parentUuid)
                      throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • create

        @GetMapping("/api/collections/new")
        @ResponseBody
        public de.digitalcollections.model.identifiable.entity.Collection create()
                                                                          throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • edit

        @GetMapping("/collections/{uuid}/edit")
        public String edit​(@PathVariable
                           UUID uuid,
                           @RequestParam(name="activeLanguage",required=false)
                           Locale activeLanguage,
                           org.springframework.ui.Model model)
                    throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • find

        @GetMapping("/api/collections/search")
        @ResponseBody
        public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> find​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                     int pageNumber,
                                                                                                                                     @RequestParam(name="pageSize",required=false,defaultValue="5")
                                                                                                                                     int pageSize,
                                                                                                                                     @RequestParam(name="searchTerm",required=false)
                                                                                                                                     String searchTerm,
                                                                                                                                     @RequestParam(name="sortBy",required=false)
                                                                                                                                     List<de.digitalcollections.model.list.sorting.Order> sortBy)
                                                                                                                              throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • findDigitalObjects

        @GetMapping("/api/collections/{uuid}/digitalobjects")
        @ResponseBody
        public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.DigitalObject> findDigitalObjects​(@PathVariable
                                                                                                                                                      UUID uuid,
                                                                                                                                                      @RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                                      int pageNumber,
                                                                                                                                                      @RequestParam(name="pageSize",required=false,defaultValue="25")
                                                                                                                                                      int pageSize,
                                                                                                                                                      @RequestParam(name="searchTerm",required=false)
                                                                                                                                                      String searchTerm)
                                                                                                                                               throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • findSubcollections

        @GetMapping("/api/collections/{uuid}/collections")
        @ResponseBody
        public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findSubcollections​(@PathVariable
                                                                                                                                                   UUID uuid,
                                                                                                                                                   @RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                                   int pageNumber,
                                                                                                                                                   @RequestParam(name="pageSize",required=false,defaultValue="25")
                                                                                                                                                   int pageSize,
                                                                                                                                                   @RequestParam(name="searchTerm",required=false)
                                                                                                                                                   String searchTerm)
                                                                                                                                            throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • findTop

        @GetMapping("/api/collections")
        @ResponseBody
        public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findTop​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                        int pageNumber,
                                                                                                                                        @RequestParam(name="pageSize",required=false,defaultValue="25")
                                                                                                                                        int pageSize,
                                                                                                                                        @RequestParam(name="searchTerm",required=false)
                                                                                                                                        String searchTerm,
                                                                                                                                        @RequestParam(name="sortBy",required=false)
                                                                                                                                        List<de.digitalcollections.model.list.sorting.Order> sortBy)
                                                                                                                                 throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • getByIdentifier

        @GetMapping("/api/collections/identifier/{namespace}:{id}")
        @ResponseBody
        public de.digitalcollections.model.identifiable.entity.Collection getByIdentifier​(@PathVariable
                                                                                          String namespace,
                                                                                          @PathVariable
                                                                                          String id)
                                                                                   throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • getByRefId

        @GetMapping("/api/collections/{refId:[0-9]+}")
        @ResponseBody
        public de.digitalcollections.model.identifiable.entity.Collection getByRefId​(@PathVariable
                                                                                     long refId)
                                                                              throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • getByUuid

        @GetMapping("/api/collections/{uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}}")
        @ResponseBody
        public de.digitalcollections.model.identifiable.entity.Collection getByUuid​(@PathVariable
                                                                                    UUID uuid)
                                                                             throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • list

        @GetMapping("/collections")
        public String list​(org.springframework.ui.Model model)
                    throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • module

        @ModelAttribute("menu")
        protected String module()
      • removeDigitalObject

        @DeleteMapping("/api/collections/{collectionUuid}/digitalobjects/{digitalobjectUuid}")
        @ResponseBody
        public org.springframework.http.ResponseEntity removeDigitalObject​(@PathVariable
                                                                           UUID collectionUuid,
                                                                           @PathVariable
                                                                           UUID digitalobjectUuid)
                                                                    throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • removeSubcollection

        @DeleteMapping("/api/collections/{collectionUuid}/collections/{subcollectionUuid}")
        public org.springframework.http.ResponseEntity removeSubcollection​(@PathVariable
                                                                           UUID collectionUuid,
                                                                           @PathVariable
                                                                           UUID subcollectionUuid)
                                                                    throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • save

        @PostMapping("/api/collections")
        public org.springframework.http.ResponseEntity save​(@RequestBody
                                                            de.digitalcollections.model.identifiable.entity.Collection collection,
                                                            @RequestParam(name="parentType",required=false)
                                                            String parentType,
                                                            @RequestParam(name="parentUuid",required=false)
                                                            UUID parentUuid)
      • update

        @PutMapping("/api/collections/{uuid}")
        public org.springframework.http.ResponseEntity update​(@PathVariable
                                                              UUID uuid,
                                                              @RequestBody
                                                              de.digitalcollections.model.identifiable.entity.Collection collection)
      • view

        @GetMapping("/collections/{uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}}")
        public String view​(@PathVariable
                           UUID uuid,
                           org.springframework.ui.Model model)
                    throws de.digitalcollections.model.exception.TechnicalException,
                           de.digitalcollections.model.exception.ResourceNotFoundException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
        de.digitalcollections.model.exception.ResourceNotFoundException
      • viewByRefId

        @GetMapping("/collections/{refId:[0-9]+}")
        public String viewByRefId​(@PathVariable
                                  long refId,
                                  org.springframework.ui.Model model)
                           throws de.digitalcollections.model.exception.TechnicalException,
                                  de.digitalcollections.model.exception.ResourceNotFoundException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
        de.digitalcollections.model.exception.ResourceNotFoundException