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.api.identifiable.entity.DigitalObject> digitalObjects)  
      org.springframework.http.ResponseEntity addSubcollection​(UUID collectionUuid, UUID subcollectionUuid)  
      org.springframework.http.ResponseEntity addSubcollections​(UUID collectionUuid, List<de.digitalcollections.model.api.identifiable.entity.Collection> subcollections)  
      de.digitalcollections.model.api.identifiable.entity.Collection create()  
      String create​(org.springframework.ui.Model model, String parentType, String parentUuid)  
      String edit​(UUID uuid, Locale activeLanguage, org.springframework.ui.Model model)  
      de.digitalcollections.model.api.identifiable.entity.Collection findOneByIdentifier​(String namespace, String id)  
      de.digitalcollections.model.api.identifiable.entity.Collection get​(UUID uuid)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.DigitalObject> getDigitalObjects​(UUID uuid, int pageNumber, int pageSize)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Collection> getSubcollections​(UUID uuid, int pageNumber, int pageSize)  
      String list​(org.springframework.ui.Model model, org.springframework.data.domain.Pageable pageable)  
      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.api.identifiable.entity.Collection collection, String parentType, UUID parentUuid)  
      de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.impl.identifiable.entity.CollectionImpl> search​(int pageNumber, int pageSize, String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, String searchTerm)  
      org.springframework.http.ResponseEntity update​(UUID uuid, de.digitalcollections.model.api.identifiable.entity.Collection collection)  
      String view​(UUID uuid, org.springframework.data.domain.Pageable pageable, org.springframework.ui.Model model)  
      • Methods inherited from class de.digitalcollections.commons.springmvc.controller.AbstractController

        verifyBinding
    • Method Detail

      • module

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

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

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

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

        @GetMapping({"/collections/new","/subcollections/new"})
        public String create​(org.springframework.ui.Model model,
                             @RequestParam(name="parentType",required=false)
                             String parentType,
                             @RequestParam(name="parentUuid",required=false)
                             String parentUuid)
                      throws HttpException
        Throws:
        HttpException
      • create

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

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

        @GetMapping("/api/collections/{uuid}")
        @ResponseBody
        public de.digitalcollections.model.api.identifiable.entity.Collection get​(@PathVariable
                                                                                  UUID uuid)
                                                                           throws HttpException
        Throws:
        HttpException
      • findOneByIdentifier

        @GetMapping({"/api/collections/identifier/{namespace}:{id}","/api/subcollections/identifier/{namespace}:{id}"})
        @ResponseBody
        public de.digitalcollections.model.api.identifiable.entity.Collection findOneByIdentifier​(@PathVariable
                                                                                                  String namespace,
                                                                                                  @PathVariable
                                                                                                  String id)
                                                                                           throws HttpException
        Throws:
        HttpException
      • getDigitalObjects

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

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

        @GetMapping("/collections")
        public String list​(org.springframework.ui.Model model,
                           @PageableDefault(sort="lastModified",direction=DESC,size=25)
                           org.springframework.data.domain.Pageable pageable)
                    throws HttpException
        Throws:
        HttpException
      • removeDigitalObject

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

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

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

        @GetMapping({"/api/collections/search","/api/subcollections/search"})
        @ResponseBody
        public de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.impl.identifiable.entity.CollectionImpl> search​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                                     int pageNumber,
                                                                                                                                                     @RequestParam(name="pageSize",required=false,defaultValue="5")
                                                                                                                                                     int pageSize,
                                                                                                                                                     @RequestParam(name="sortField",required=false,defaultValue="lastModified")
                                                                                                                                                     String sortField,
                                                                                                                                                     @RequestParam(name="sortDirection",required=false,defaultValue="DESC")
                                                                                                                                                     de.digitalcollections.model.api.paging.enums.Direction sortDirection,
                                                                                                                                                     @RequestParam(name="searchTerm",required=false)
                                                                                                                                                     String searchTerm)
                                                                                                                                              throws HttpException
        Throws:
        HttpException
      • update

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

        @GetMapping({"/collections/{uuid}","/subcollections/{uuid}"})
        public String view​(@PathVariable
                           UUID uuid,
                           @PageableDefault(size=25)
                           org.springframework.data.domain.Pageable pageable,
                           org.springframework.ui.Model model)
                    throws HttpException
        Throws:
        HttpException