Class EntityController<E extends de.digitalcollections.model.api.identifiable.entity.Entity>


  • @RestController
    @Api(description="The entity controller",
         name="Entity controller")
    public class EntityController<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    extends Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long count()  
      de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.api.identifiable.entity.Entity> find​(int pageNumber, int pageSize, String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling, String searchTerm)  
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Entity> 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.identifiable.entity.Entity findById​(UUID uuid)  
      de.digitalcollections.model.api.identifiable.entity.Entity findByIdentifier​(String namespace, String id)  
      de.digitalcollections.model.api.identifiable.entity.Entity findByRefId​(long refId)  
    • Constructor Detail

      • EntityController

        public EntityController()
    • Method Detail

      • count

        @ApiMethod(description="Get count of entities")
        @GetMapping(value={"/latest/entities/count","/v3/entities/count"},
                    produces="application/json")
        @ApiResponseObject
        public long count()
      • findAll

        @ApiMethod(description="Get all entities")
        @GetMapping(value={"/latest/entities","/v3/entities"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.entity.Entity> findAll​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                       int pageNumber,
                                                                                                                                       @RequestParam(name="pageSize",required=false,defaultValue="25")
                                                                                                                                       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)
      • find

        @ApiMethod(description="Find limited amount of entities containing searchTerm in label or description")
        @GetMapping(value={"/latest/entities/search","/v2/entities/search"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.SearchPageResponse<de.digitalcollections.model.api.identifiable.entity.Entity> find​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                          int pageNumber,
                                                                                                                                          @RequestParam(name="pageSize",required=false,defaultValue="5")
                                                                                                                                          int pageSize,
                                                                                                                                          @RequestParam(name="sortField",required=false,defaultValue="uuid")
                                                                                                                                          String sortField,
                                                                                                                                          @RequestParam(name="sortDirection",required=false,defaultValue="ASC")
                                                                                                                                          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="searchTerm",required=false)
                                                                                                                                          String searchTerm)
      • findById

        @ApiMethod(description="Get entity by uuid")
        @GetMapping(value={"/latest/entities/{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}}","/v2/entities/{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}}"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.Entity findById​(@PathVariable
                                                                                   UUID uuid)
      • findByIdentifier

        @ApiMethod(description="Get entity by namespace and id")
        @GetMapping(value="/latest/entities/identifier/{namespace}:{id}",
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.Entity findByIdentifier​(@PathVariable
                                                                                           String namespace,
                                                                                           @PathVariable
                                                                                           String id)
                                                                                    throws IdentifiableServiceException
        Throws:
        IdentifiableServiceException
      • findByRefId

        @ApiMethod(description="Get entity by reference id")
        @GetMapping(value="/latest/entities/{refId:[0-9]+}",
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.entity.Entity findByRefId​(@PathVariable
                                                                                      long refId)