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, String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationStart, de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationEnd)  
      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)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.parts.Webpage> getWebpageChildren​(UUID uuid, int pageNumber, int pageSize, String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationStart, de.digitalcollections.model.api.filter.FilterCriterion<LocalDate> publicationEnd)  
      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)  
    • Constructor Detail

      • WebpageController

        public WebpageController()
    • Method Detail

      • findAll

        @ApiMethod(description="Get all webpages")
        @RequestMapping(value={"/latest/webpages","/v2/webpages"},
                        produces="application/json",
                        method=GET)
        @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="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="nullHandling",required=false,defaultValue="NATIVE")
                                                                                                                                              de.digitalcollections.model.api.paging.enums.NullHandling nullHandling,
                                                                                                                                              @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)
      • getWebpage

        @ApiMethod(description="Get a webpage as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header")
        @RequestMapping(value={"/latest/webpages/{uuid}","/v3/webpages/{uuid}"},
                        produces={"application/json","application/xml"},
                        method=GET)
        @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)
                                                                                                                              throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • getWebpageChildren

        @ApiMethod(description="Get children of a webpage as JSON")
        @RequestMapping(value={"/latest/webpages/{uuid}/children","/v3/webpages/{uuid}/children"},
                        produces="application/json",
                        method=GET)
        @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="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="nullHandling",required=false,defaultValue="NATIVE")
                                                                                                                                                         de.digitalcollections.model.api.paging.enums.NullHandling nullHandling,
                                                                                                                                                         @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)
                                                                                                                                                  throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • getWebpageParent

        @ApiMethod(description="Get parent of a webpage as JSON")
        @RequestMapping(value={"/latest/webpages/{uuid}/parent","/v3/webpages/{uuid}/parent"},
                        produces="application/json",
                        method=GET)
        @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")
        @RequestMapping(value={"/latest/webpages/{uuid}/website","/v3/webpages/{uuid}/website"},
                        produces="application/json",
                        method=GET)
        @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
      • saveWithParentWebsite

        @ApiMethod(description="Save a newly created top-level webpage")
        @RequestMapping(value={"/latest/websites/{parentWebsiteUuid}/webpage","/v2/websites/{parentWebsiteUuid}/webpage"},
                        produces="application/json",
                        method=POST)
        @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
      • saveWithParentWebpage

        @ApiMethod(description="Save a newly created webpage")
        @RequestMapping(value={"/latest/webpages/{parentWebpageUuid}/webpage","/v2/webpages/{parentWebpageUuid}/webpage"},
                        produces="application/json",
                        method=POST)
        @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
      • update

        @ApiMethod(description="Update a webpage")
        @RequestMapping(value={"/latest/webpages/{uuid}","/v2/webpages/{uuid}"},
                        produces="application/json",
                        method=PUT)
        @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
      • 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)
      • 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)