Class WebpageController


  • @RestController
    @Api(description="The webpage controller",
         name="Webpage controller")
    public class WebpageController
    extends Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRelatedFileResource​(UUID uuid, UUID fileResourceUuid)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> findAll​(int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy, de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationStart, de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationEnd)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.view.BreadcrumbNavigation> getBreadcrumb​(UUID uuid, Locale pLocale)  
      List<de.digitalcollections.model.api.identifiable.resource.FileResource> getRelatedFileResources​(UUID uuid)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> getWebpage​(UUID uuid, Locale pLocale, String active)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> getWebpageChildren​(UUID uuid, int pageNumber, int pageSize, List<de.digitalcollections.model.api.paging.Order> sortBy, String active)  
      List<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> getWebpageChildrenTree​(UUID uuid, String active)  
      de.digitalcollections.model.api.identifiable.entity.parts.Webpage getWebpageParent​(UUID uuid)  
      de.digitalcollections.model.api.identifiable.entity.Website getWebsite​(UUID uuid)  
      de.digitalcollections.model.api.identifiable.entity.parts.Webpage saveWithParentWebpage​(UUID parentWebpageUuid, de.digitalcollections.model.api.identifiable.entity.parts.Webpage webpage, org.springframework.validation.BindingResult errors)  
      de.digitalcollections.model.api.identifiable.entity.parts.Webpage saveWithParentWebsite​(UUID parentWebsiteUuid, de.digitalcollections.model.api.identifiable.entity.parts.Webpage webpage, org.springframework.validation.BindingResult errors)  
      de.digitalcollections.model.api.identifiable.entity.parts.Webpage update​(UUID uuid, de.digitalcollections.model.api.identifiable.entity.parts.Webpage webpage, org.springframework.validation.BindingResult errors)  
      org.springframework.http.ResponseEntity updateChildrenOrder​(UUID uuid, List<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> rootPages)  
    • Constructor Detail

      • WebpageController

        public WebpageController()
    • Method Detail

      • addRelatedFileResource

        @ApiMethod(description="Add file resource related to webpage")
        @PostMapping({"/latest/webpages/{uuid}/related/fileresources/{fileResourceUuid}","/v2/webpages/{uuid}/related/fileresources/{fileResourceUuid}"})
        @ResponseStatus(OK)
        @ApiResponseObject
        public void addRelatedFileResource​(@PathVariable
                                           UUID uuid,
                                           @PathVariable
                                           UUID fileResourceUuid)
      • findAll

        @ApiMethod(description="Get all webpages")
        @GetMapping(value={"/latest/webpages","/v2/webpages"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> 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,
                                                                                                                                              @RequestParam(name="publicationStart",required=false)
                                                                                                                                              de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationStart,
                                                                                                                                              @RequestParam(name="publicationEnd",required=false)
                                                                                                                                              de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationEnd)
      • getBreadcrumb

        @ApiMethod(description="Get the breadcrumb for a webpage")
        @GetMapping(value={"/latest/webpages/{uuid}/breadcrumb","/v3/webpages/{uuid}/breadcrumb"},
                    produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.view.BreadcrumbNavigation> getBreadcrumb​(@ApiPathParam(description="UUID of the webpage, e.g. <tt>6119d8e9-9c92-4091-8dcb-bc4053385406</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)
      • getRelatedFileResources

        @ApiMethod(description="Get file resources related to webpage")
        @GetMapping(value={"/latest/webpages/{uuid}/related/fileresources","/v2/webpages/{uuid}/related/fileresources"},
                    produces="application/json")
        @ApiResponseObject
        public List<de.digitalcollections.model.api.identifiable.resource.FileResource> getRelatedFileResources​(@PathVariable
                                                                                                                UUID uuid)
      • getWebpage

        @ApiMethod(description="Get a webpage as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header")
        @GetMapping(value={"/latest/webpages/{uuid}","/v3/webpages/{uuid}"},
                    produces={"application/json","application/xml"})
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> getWebpage​(@ApiPathParam(description="UUID of the webpage, 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,
                                                                                                                                     @ApiQueryParam(name="active",description="If set, object will only be returned if active") @RequestParam(name="active",required=false)
                                                                                                                                     String active)
                                                                                                                              throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • getWebpageChildren

        @ApiMethod(description="Get (active or all) paged children of a webpage as JSON")
        @GetMapping(value={"/latest/webpages/{uuid}/children","/v3/webpages/{uuid}/children"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> getWebpageChildren​(@ApiPathParam(description="UUID of the parent webpage, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid")
                                                                                                                                                         UUID uuid,
                                                                                                                                                         @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,
                                                                                                                                                         @RequestParam(name="active",required=false)
                                                                                                                                                         String active)
                                                                                                                                                  throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • getWebpageChildrenTree

        @ApiMethod(description="Get (active or all) children of a webpage recursivly as JSON")
        @GetMapping(value={"/latest/webpages/{uuid}/childrentree","/v3/webpages/{uuid}/childrentree"},
                    produces="application/json")
        @ApiResponseObject
        public List<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> getWebpageChildrenTree​(@ApiPathParam(description="UUID of the root webpage, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid")
                                                                                                              UUID uuid,
                                                                                                              @ApiQueryParam(name="active",description="If set, only active children will be returned") @RequestParam(name="active",required=false)
                                                                                                              String active)
      • getWebpageParent

        @ApiMethod(description="Get parent of a webpage as JSON")
        @GetMapping(value={"/latest/webpages/{uuid}/parent","/v3/webpages/{uuid}/parent"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.parts.Webpage getWebpageParent​(@ApiPathParam(description="UUID of the webpage, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid")
                                                                                                  UUID uuid)
                                                                                           throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • getWebsite

        @ApiMethod(description="Get website of a webpage as JSON")
        @GetMapping(value={"/latest/webpages/{uuid}/website","/v3/webpages/{uuid}/website"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.Website getWebsite​(@ApiPathParam(description="UUID of the webpage, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid")
                                                                                      UUID uuid)
                                                                               throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • saveWithParentWebpage

        @ApiMethod(description="Save a newly created webpage")
        @PostMapping(value={"/latest/webpages/{parentWebpageUuid}/webpage","/v2/webpages/{parentWebpageUuid}/webpage"},
                     produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.parts.Webpage saveWithParentWebpage​(@PathVariable
                                                                                                       UUID parentWebpageUuid,
                                                                                                       @RequestBody
                                                                                                       de.digitalcollections.model.api.identifiable.entity.parts.Webpage webpage,
                                                                                                       org.springframework.validation.BindingResult errors)
                                                                                                throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • saveWithParentWebsite

        @ApiMethod(description="Save a newly created top-level webpage")
        @PostMapping(value={"/latest/websites/{parentWebsiteUuid}/webpage","/v2/websites/{parentWebsiteUuid}/webpage"},
                     produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.parts.Webpage saveWithParentWebsite​(@PathVariable
                                                                                                       UUID parentWebsiteUuid,
                                                                                                       @RequestBody
                                                                                                       de.digitalcollections.model.api.identifiable.entity.parts.Webpage webpage,
                                                                                                       org.springframework.validation.BindingResult errors)
                                                                                                throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • update

        @ApiMethod(description="Update a webpage")
        @PutMapping(value={"/latest/webpages/{uuid}","/v2/webpages/{uuid}"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.parts.Webpage update​(@PathVariable
                                                                                        UUID uuid,
                                                                                        @RequestBody
                                                                                        de.digitalcollections.model.api.identifiable.entity.parts.Webpage webpage,
                                                                                        org.springframework.validation.BindingResult errors)
                                                                                 throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • updateChildrenOrder

        @ApiMethod(description="Update the order of a webpage\'s children")
        @PutMapping(value={"/latest/webpages/{uuid}/children","/v3/webpages/{uuid}/children"},
                    produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity updateChildrenOrder​(@ApiPathParam(description="UUID of the webpage") @PathVariable("uuid")
                                                                           UUID uuid,
                                                                           @ApiPathParam(description="List of the children") @RequestBody
                                                                           List<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> rootPages)