Class TopicsController


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      de.digitalcollections.model.identifiable.entity.Topic 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.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Topic> findAllTop​(int pageNumber, int pageSize, String searchTerm)  
      de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Topic> findSubtopic​(UUID uuid, int pageNumber, int pageSize, String searchTerm)  
      de.digitalcollections.model.identifiable.entity.Topic get​(UUID uuid)  
      de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Entity> getAttachedEntites​(UUID uuid, int pageNumber, int pageSize)  
      de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.resource.FileResource> getRelatedFileResources​(UUID uuid, int pageNumber, int pageSize)  
      String list​(org.springframework.ui.Model model)  
      protected String module()  
      org.springframework.http.ResponseEntity save​(de.digitalcollections.model.identifiable.entity.Topic topic, UUID parentUuid)  
      org.springframework.http.ResponseEntity update​(UUID uuid, de.digitalcollections.model.identifiable.entity.Topic topic)  
      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

      • module

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

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

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

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

        @GetMapping("/api/topics")
        @ResponseBody
        public de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Topic> findAllTop​(@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 HttpException
        Throws:
        HttpException
      • findSubtopic

        @GetMapping("/api/topics/{uuid}/subtopics")
        @ResponseBody
        public de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Topic> findSubtopic​(@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 HttpException
        Throws:
        HttpException
      • get

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

        @GetMapping("/api/topics/{uuid}/entities")
        @ResponseBody
        public de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Entity> getAttachedEntites​(@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
      • getRelatedFileResources

        @GetMapping("/api/topics/{uuid}/fileresources")
        @ResponseBody
        public de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.resource.FileResource> getRelatedFileResources​(@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
      • save

        @PostMapping("/api/topics")
        public org.springframework.http.ResponseEntity save​(@RequestBody
                                                            de.digitalcollections.model.identifiable.entity.Topic topic,
                                                            @RequestParam(name="parentUuid",required=false)
                                                            UUID parentUuid)
      • update

        @PutMapping("/api/topics/{uuid}")
        public org.springframework.http.ResponseEntity update​(@PathVariable
                                                              UUID uuid,
                                                              @RequestBody
                                                              de.digitalcollections.model.identifiable.entity.Topic topic)
      • viewByRefId

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

        @GetMapping({"/subtopics/{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}}","/topics/{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 HttpException,
                           de.digitalcollections.model.exception.ResourceNotFoundException
        Throws:
        HttpException
        de.digitalcollections.model.exception.ResourceNotFoundException