Class BundleRestRepository

  • All Implemented Interfaces:
    ReloadableEntityObjectRepository<org.dspace.content.Bundle,​UUID>, org.springframework.data.repository.CrudRepository<BundleRest,​UUID>, org.springframework.data.repository.PagingAndSortingRepository<BundleRest,​UUID>, org.springframework.data.repository.Repository<BundleRest,​UUID>

    @Component("core.bundle")
    public class BundleRestRepository
    extends DSpaceObjectRestRepository<org.dspace.content.Bundle,​BundleRest>
    This is the repository responsible for managing the Bundle Rest object
    Author:
    Jelle Pelgrims (jelle.pelgrims at atmire.com)
    • Constructor Detail

      • BundleRestRepository

        public BundleRestRepository​(org.dspace.content.service.BundleService dsoService)
    • Method Detail

      • findOne

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

        public org.springframework.data.domain.Page<BundleRest> 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<BundleRest,​UUID>
        Parameters:
        context - the dspace context
        pageable - object embedding the requested pagination info
        Returns:
      • patch

        @PreAuthorize("hasPermission(#uuid, \'BUNDLE\', \'WRITE\')")
        protected void patch​(org.dspace.core.Context context,
                             javax.servlet.http.HttpServletRequest request,
                             String apiCategory,
                             String model,
                             UUID uuid,
                             Patch patch)
                      throws org.dspace.authorize.AuthorizeException,
                             SQLException
        Apply a patch operation to a bundle
        Overrides:
        patch in class DSpaceRestRepository<BundleRest,​UUID>
        Parameters:
        context - The context
        request - The http request
        apiCategory - The API category e.g. "api"
        model - The DSpace model e.g. "metadatafield"
        uuid - The UUID of the bundle to perform patch operations on
        patch - The JSON Patch (https://tools.ietf.org/html/rfc6902) operation
        Throws:
        org.dspace.authorize.AuthorizeException
        SQLException
      • uploadBitstream

        public BitstreamRest uploadBitstream​(org.dspace.core.Context context,
                                             org.dspace.content.Bundle bundle,
                                             String fileName,
                                             InputStream fileInputStream,
                                             String properties)
        Method to upload a bitstream to a bundle.
        Parameters:
        context - The context
        bundle - The bundle where the bitstream should be stored
        fileName - The filename as it was uploaded
        fileInputStream - The input stream used to create the bitstream
        properties - The properties to be assigned to the bitstream
        Returns:
        The uploaded bitstream
      • delete

        @PreAuthorize("hasPermission(#id, \'BUNDLE\', \'DELETE\')")
        protected void delete​(org.dspace.core.Context context,
                              UUID id)
                       throws org.dspace.authorize.AuthorizeException
        Deletes a bundle whose uuid is given and deletes all the bitstreams it contains in BundleService.delete
        Overrides:
        delete in class DSpaceRestRepository<BundleRest,​UUID>
        Parameters:
        context - the dspace context
        id - the id of the bundle to delete
        Throws:
        org.dspace.authorize.AuthorizeException