Package org.dspace.content
Class Item
- java.lang.Object
-
- org.dspace.content.DSpaceObject
-
- org.dspace.content.Item
-
- All Implemented Interfaces:
Serializable,DSpaceObjectLegacySupport,ReloadableEntity<UUID>
@Entity public class Item extends DSpaceObject implements DSpaceObjectLegacySupport
Class representing an item in DSpace.This class holds in memory the item Dublin Core metadata, the bundles in the item, and the bitstreams in those bundles. When modifying the item, if you modify the Dublin Core or the "in archive" flag, you must call
updatefor the changes to be written to the database. Creating, adding or removing bundles or bitstreams has immediate effect in the database.- Version:
- $Revision$
- Author:
- Robert Tansley, Martin Hald
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringANYWild card for Dublin Core metadata qualifiers/languages-
Fields inherited from class org.dspace.content.DSpaceObject
id
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedItem()Protected constructor, create object using:ItemService.create(Context, WorkspaceItem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCollections()booleanequals(Object obj)Returntrueifotheris the same Item as this object,falseotherwiseList<Bundle>getBundles()Get the bundles in this item.List<Bundle>getBundles(String name)Get the bundles matching a bundle name (name corresponds roughly to type)List<Collection>getCollections()Get the collections this item is in.ItemServicegetItemService()DategetLastModified()Get the date the item was last modified, or the current date if last_modified is nullIntegergetLegacyId()StringgetName()CollectiongetOwningCollection()Get the owning Collection for the itemEPersongetSubmitter()Get the e-person that originally submitted this itemCollectiongetTemplateItemOf()intgetType()return type found in ConstantsinthashCode()booleanisArchived()Find out if the item is part of the main archivebooleanisDiscoverable()Find out if the item is discoverablebooleanisWithdrawn()Find out if the item has been withdrawnvoidsetArchived(boolean isArchived)Set the "is_archived" flag.voidsetDiscoverable(boolean discoverable)Set the "discoverable" flag.voidsetLastModified(Date lastModified)voidsetOwningCollection(Collection c)Set the owning Collection for the itemvoidsetSubmitter(EPerson sub)Set the e-person that originally submitted this item.-
Methods inherited from class org.dspace.content.DSpaceObject
addDetails, addHandle, addMetadata, clearDetails, clearModified, getDetails, getHandle, getHandles, getID, getMetadata, getResourcePolicies, isMetadataModified, isModified, removeMetadata, removeMetadata, setMetadata, setMetadataModified, setModified
-
-
-
-
Field Detail
-
ANY
public static final String ANY
Wild card for Dublin Core metadata qualifiers/languages- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Item
protected Item()
Protected constructor, create object using:ItemService.create(Context, WorkspaceItem)
-
-
Method Detail
-
isArchived
public boolean isArchived()
Find out if the item is part of the main archive- Returns:
- true if the item is in the main archive
-
isWithdrawn
public boolean isWithdrawn()
Find out if the item has been withdrawn- Returns:
- true if the item has been withdrawn
-
isDiscoverable
public boolean isDiscoverable()
Find out if the item is discoverable- Returns:
- true if the item is discoverable
-
getLastModified
public Date getLastModified()
Get the date the item was last modified, or the current date if last_modified is null- Returns:
- the date the item was last modified, or the current date if the column is null.
-
setLastModified
public void setLastModified(Date lastModified)
-
setArchived
public void setArchived(boolean isArchived)
Set the "is_archived" flag. This is public and onlyWorkflowItem.archive()should set this.- Parameters:
isArchived- new value for the flag
-
setDiscoverable
public void setDiscoverable(boolean discoverable)
Set the "discoverable" flag. This is public and only- Parameters:
discoverable- new value for the flag
-
setOwningCollection
public void setOwningCollection(Collection c)
Set the owning Collection for the item- Parameters:
c- Collection
-
getOwningCollection
public Collection getOwningCollection()
Get the owning Collection for the item- Returns:
- Collection that is the owner of the item
-
getSubmitter
public EPerson getSubmitter()
Get the e-person that originally submitted this item- Returns:
- the submitter
-
setSubmitter
public void setSubmitter(EPerson sub)
Set the e-person that originally submitted this item. This is a public method since it is handled by the WorkspaceItem class in the ingest package.updatemust be called to write the change to the database.- Parameters:
sub- the submitter
-
getCollections
public List<Collection> getCollections()
Get the collections this item is in. The order is sorted ascending by collection name.- Returns:
- the collections this item is in, if any.
-
clearCollections
public void clearCollections()
-
getTemplateItemOf
public Collection getTemplateItemOf()
-
getBundles
public List<Bundle> getBundles()
Get the bundles in this item.- Returns:
- the bundles in an unordered array
-
getBundles
public List<Bundle> getBundles(String name)
Get the bundles matching a bundle name (name corresponds roughly to type)- Parameters:
name- name of bundle (ORIGINAL/TEXT/THUMBNAIL)- Returns:
- the bundles in an unordered array
-
equals
public boolean equals(Object obj)
Returntrueifotheris the same Item as this object,falseotherwise
-
getType
public int getType()
return type found in Constants- Specified by:
getTypein classDSpaceObject- Returns:
- int Constants.ITEM
-
getName
public String getName()
- Specified by:
getNamein classDSpaceObject
-
getLegacyId
public Integer getLegacyId()
- Specified by:
getLegacyIdin interfaceDSpaceObjectLegacySupport- Returns:
- the old integer based legacy identifier
-
getItemService
public ItemService getItemService()
-
-