Interface BundleService

    • Method Detail

      • removeBitstream

        void removeBitstream​(Context context,
                             Bundle bundle,
                             Bitstream bitstream)
                      throws AuthorizeException,
                             SQLException,
                             IOException
        Remove a bitstream from this bundle - the bitstream is only deleted if this was the last reference to it

        If the bitstream in question is the primary bitstream recorded for the bundle the primary bitstream field is unset in order to free the bitstream from the foreign key constraint so that the cleanup process can run normally.

        Parameters:
        context - DSpace Context
        bundle - the bitstream bundle
        bitstream - the bitstream to remove
        Throws:
        IOException - if IO error
        AuthorizeException - if authorization error
        SQLException - if database error
      • inheritCollectionDefaultPolicies

        void inheritCollectionDefaultPolicies​(Context context,
                                              Bundle bundle,
                                              Collection collection)
                                       throws SQLException,
                                              AuthorizeException
        remove all policies on the bundle and its contents, and replace them with the DEFAULT_BITSTREAM_READ policies belonging to the collection.
        Parameters:
        context - DSpace Context
        bundle - the bitstream bundle
        collection - Collection
        Throws:
        SQLException - if an SQL error or if no default policies found. It's a bit draconian, but default policies must be enforced.
        AuthorizeException - if authorization error
      • replaceAllBitstreamPolicies

        void replaceAllBitstreamPolicies​(Context context,
                                         Bundle bundle,
                                         List<ResourcePolicy> newpolicies)
                                  throws SQLException,
                                         AuthorizeException
        remove all of the policies for the bundle and bitstream contents and replace them with a new list of policies
        Parameters:
        context - DSpace Context
        bundle - the bitstream bundle
        newpolicies - - this will be all of the new policies for the bundle and bitstream contents
        Throws:
        SQLException - if database error
        AuthorizeException - if authorization error
      • updateBitstreamOrder

        void updateBitstreamOrder​(Context context,
                                  Bundle bundle,
                                  int from,
                                  int to)
                           throws AuthorizeException,
                                  SQLException
        Moves a bitstream within a bundle from one place to another, shifting all other bitstreams in the process
        Parameters:
        context - DSpace Context
        bundle - The bitstream bundle
        from - The index of the bitstream to move
        to - The index to move the bitstream to
        Throws:
        AuthorizeException - when an SQL error has occurred (querying DSpace)
        SQLException - If the user can't make the changes
      • setOrder

        void setOrder​(Context context,
                      Bundle bundle,
                      UUID[] bitstreamIds)
               throws AuthorizeException,
                      SQLException
        Changes bitstream order according to the array
        Parameters:
        context - DSpace Context
        bundle - the bitstream bundle
        bitstreamIds - the identifiers in the order they are to be set
        Throws:
        SQLException - when an SQL error has occurred (querying DSpace)
        AuthorizeException - If the user can't make the changes