Class VersionRestRepository

    • Field Detail

      • workflowItemService

        @Autowired(required=true)
        protected org.dspace.workflow.WorkflowItemService workflowItemService
    • Constructor Detail

      • VersionRestRepository

        public VersionRestRepository()
    • Method Detail

      • findOne

        @PreAuthorize("@versioningSecurity.isEnableVersioning() && hasPermission(#id, \'VERSION\', \'READ\')")
        public VersionRest findOne​(org.dspace.core.Context context,
                                   Integer id)
        Description copied from class: DSpaceRestRepository
        Method to implement to support retrieval of a specific REST object instance
        Specified by:
        findOne in class DSpaceRestRepository<VersionRest,​Integer>
        Parameters:
        context - the dspace context
        id - the rest object id
        Returns:
        the REST object identified by its ID
      • createAndReturn

        @PreAuthorize("@versioningSecurity.isEnableVersioning() && hasAuthority(\'AUTHENTICATED\')")
        protected VersionRest createAndReturn​(org.dspace.core.Context context,
                                              List<String> stringList)
                                       throws org.dspace.authorize.AuthorizeException,
                                              SQLException,
                                              RepositoryMethodNotImplementedException
        Description copied from class: DSpaceRestRepository
        Method to implement to support the creation of a new instance. Usually require to retrieve the http request from the thread bound attribute
        Overrides:
        createAndReturn in class DSpaceRestRepository<VersionRest,​Integer>
        Parameters:
        context - the dspace context
        stringList - The list of Strings that will be used as data for the object that's to be created This list is retrieved from the uri-list body
        Returns:
        the created REST object
        Throws:
        org.dspace.authorize.AuthorizeException
        SQLException
        RepositoryMethodNotImplementedException - returned by the default implementation when the operation is not supported for the entity
      • patch

        @PreAuthorize("@versioningSecurity.isEnableVersioning() && hasPermission(#versionId, \'version\', \'ADMIN\')")
        protected void patch​(org.dspace.core.Context context,
                             javax.servlet.http.HttpServletRequest request,
                             String apiCategory,
                             String model,
                             Integer versionId,
                             Patch patch)
                      throws org.dspace.authorize.AuthorizeException,
                             SQLException
        Description copied from class: DSpaceRestRepository
        Method to implement to allow partial update of the REST object via JSON Patch
        Overrides:
        patch in class DSpaceRestRepository<VersionRest,​Integer>
        request - the http request
        versionId - the ID of the target REST object
        patch - the JSON Patch (https://tools.ietf.org/html/rfc6902) operation
        Throws:
        org.dspace.authorize.AuthorizeException
        SQLException
      • findAll

        public org.springframework.data.domain.Page<VersionRest> findAll​(org.dspace.core.Context context,
                                                                         org.springframework.data.domain.Pageable pageable)
        Description copied from class: DSpaceRestRepository
        Method to implement to support scroll of entity instances from the collection resource endpoint
        Specified by:
        findAll in class DSpaceRestRepository<VersionRest,​Integer>
        Parameters:
        context - the dspace context
        pageable - object embedding the requested pagination info
        Returns:
      • findDomainObjectByPk

        public org.dspace.versioning.Version findDomainObjectByPk​(org.dspace.core.Context context,
                                                                  Integer id)
                                                           throws SQLException
        Specified by:
        findDomainObjectByPk in interface ReloadableEntityObjectRepository<org.dspace.versioning.Version,​Integer>
        Parameters:
        context - the DSpace context
        id - the primary key shared between the rest and dspace api object
        Returns:
        the dspace api model object related to the specified id
        Throws:
        SQLException - if a database error occurs