Package org.dspace.content
Class Collection
- java.lang.Object
-
- org.dspace.content.DSpaceObject
-
- org.dspace.content.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
updateis called. If you create or remove a workflow group, the change is only reflected in the database after callingupdate. The default group of submitters is slightly different - creating or removing this has instant effect.- Author:
- Robert Tansley
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.dspace.content.DSpaceObject
id, predefinedUUID
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCollection()Protected constructor, create object using:CollectionService.create(Context, Community)orCollectionService.create(Context, Community, String)protectedCollection(UUID uuid)Takes a pre-determined UUID to be passed to the object to allow for the restoration of previously defined UUID's.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Returntrueifotheris the same Collection as this object,falseotherwiseGroupgetAdministrators()Get the default group of administrators, if there is one.List<Community>getCommunities()Get the communities this collection appears inIntegergetLegacyId()StringgetLicenseCollection()Get the license that users must grant before submitting to this collection.BitstreamgetLogo()Get the logo for the collection.StringgetName()GroupgetSubmitters()Get the default group of submitters, if there is one.ItemgetTemplateItem()Get the template item for this collection.intgetType()return type found in ConstantsGroupgetWorkflowStep1(Context context)GroupgetWorkflowStep2(Context context)GroupgetWorkflowStep3(Context context)inthashCode()voidsetLicense(Context context, String license)Set the license for this collection.protected voidsetLogo(Bitstream logo)voidsetWorkflowGroup(Context context, int step, Group g)-
Methods inherited from class org.dspace.content.DSpaceObject
addDetails, addHandle, addMetadata, clearDetails, clearModified, getDetails, getHandle, getHandles, getID, getMetadata, getPredefinedUUID, getResourcePolicies, isMetadataModified, isModified, removeMetadata, removeMetadata, setMetadata, setMetadataModified, setModified
-
-
-
-
Constructor Detail
-
Collection
protected Collection()
Protected constructor, create object using:CollectionService.create(Context, Community)orCollectionService.create(Context, Community, String)
-
Collection
protected Collection(UUID uuid)
Takes a pre-determined UUID to be passed to the object to allow for the restoration of previously defined UUID's.- Parameters:
uuid- Takes a uuid to be passed to the Pre-Defined UUID Generator
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein classDSpaceObject
-
getLogo
public Bitstream getLogo()
Get the logo for the collection.nullis 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
nullif 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
nullif there is no default group.
-
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 innullmeans that the site-wide default will be used.- Parameters:
context- contextlicense- the license, ornull- Throws:
SQLException- if database error
-
getTemplateItem
public Item getTemplateItem() throws SQLException
Get the template item for this collection.nullis 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
Communityobjects - Throws:
SQLException- if database error
-
equals
public boolean equals(Object other)
Returntrueifotheris the same Collection as this object,falseotherwise
-
getType
public int getType()
return type found in Constants- Specified by:
getTypein classDSpaceObject- Returns:
- int Constants.COLLECTION
-
setWorkflowGroup
public void setWorkflowGroup(Context context, int step, Group g) throws SQLException, AuthorizeException
- Throws:
SQLExceptionAuthorizeException
-
getLegacyId
public Integer getLegacyId()
- Specified by:
getLegacyIdin interfaceDSpaceObjectLegacySupport- Returns:
- the old integer based legacy identifier
-
-