Class Collection

  • All Implemented Interfaces:
    Serializable, DSpaceObjectLegacySupport, ReloadableEntity<UUID>

    @Entity
    public class Collection
    extends DSpaceObject
    implements DSpaceObjectLegacySupport
    Class representing a collection.

    The collection's metadata (name, introductory text etc), workflow groups, and default group of submitters are loaded into memory. Changes to metadata are not written to the database until update is called. If you create or remove a workflow group, the change is only reflected in the database after calling update. The default group of submitters is slightly different - creating or removing this has instant effect.

    Author:
    Robert Tansley
    See Also:
    Serialized Form
    • Method Detail

      • getLogo

        public Bitstream getLogo()
        Get the logo for the collection. null is returned if the collection does not have a logo.
        Returns:
        the logo of the collection, or null
      • setLogo

        protected void setLogo​(Bitstream logo)
      • getSubmitters

        public Group getSubmitters()
        Get the default group of submitters, if there is one. Note that the authorization system may allow others to submit to the collection, so this is not necessarily a definitive list of potential submitters.

        The default group of submitters for collection 100 is the one called collection_100_submit.

        Returns:
        the default group of submitters, or null if there is no default group.
      • getAdministrators

        public Group getAdministrators()
        Get the default group of administrators, if there is one. Note that the authorization system may allow others to be administrators for the collection.

        The default group of administrators for collection 100 is the one called collection_100_admin.

        Returns:
        group of administrators, or null if there is no default group.
      • getWorkflowStep1

        public Group getWorkflowStep1​(Context context)
      • getWorkflowStep2

        public Group getWorkflowStep2​(Context context)
      • getWorkflowStep3

        public Group getWorkflowStep3​(Context context)
      • getLicenseCollection

        @Nonnull
        public String getLicenseCollection()
        Get the license that users must grant before submitting to this collection.
        Returns:
        the license for this collection. Never null.
      • setLicense

        public void setLicense​(Context context,
                               String license)
                        throws SQLException
        Set the license for this collection. Passing in null means that the site-wide default will be used.
        Parameters:
        context - context
        license - the license, or null
        Throws:
        SQLException - if database error
      • getTemplateItem

        public Item getTemplateItem()
                             throws SQLException
        Get the template item for this collection. null is returned if the collection does not have a template. Submission mechanisms may copy this template to provide a convenient starting point for a submission.
        Returns:
        the item template, or null
        Throws:
        SQLException - if database error
      • getCommunities

        public List<Community> getCommunities()
                                       throws SQLException
        Get the communities this collection appears in
        Returns:
        array of Community objects
        Throws:
        SQLException - if database error
      • equals

        public boolean equals​(Object other)
        Return true if other is the same Collection as this object, false otherwise
        Overrides:
        equals in class Object
        Parameters:
        other - object to compare to
        Returns:
        true if object passed in represents the same collection as this object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getType

        public int getType()
        return type found in Constants
        Specified by:
        getType in class DSpaceObject
        Returns:
        int Constants.COLLECTION