Package org.dspace.content
Class Item
java.lang.Object
org.dspace.content.DSpaceObject
org.dspace.content.Item
- All Implemented Interfaces:
Serializable,DSpaceObjectLegacySupport,ReloadableEntity<UUID>
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
update for the changes to be written to the database.
Creating, adding or removing bundles or bitstreams has immediate effect in
the database.
- Author:
- Robert Tansley, Martin Hald
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWild card for Dublin Core metadata qualifiers/languagesFields inherited from class org.dspace.content.DSpaceObject
id, predefinedUUID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedItem()Protected constructor, create object using:ItemService.create(Context, WorkspaceItem)protectedTakes a pre-determined UUID to be passed to the object to allow for the restoration of previously defined UUID's. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanReturntrueifotheris the same Item as this object,falseotherwise.Get the bundles in this item.getBundles(String name) Get the bundles matching a bundle name (name corresponds roughly to type)protected List<MetadataValue>Get the collections this item is in.Get the date the item was last modified, or the current date if last_modified is nullgetName()Get the owning Collection for the itemGet the e-person that originally submitted this itemintgetType()return type found in ConstantsinthashCode()booleanFind out if the item is part of the main archivebooleanFind out if the item is discoverablebooleanbooleanFind out if the item has been withdrawnvoidsetArchived(boolean isArchived) Set the "is_archived" flag.protected voidsetCachedMetadata(List<MetadataValue> cachedMetadata) voidsetDiscoverable(boolean discoverable) Set the "discoverable" flag.voidsetLastModified(Instant lastModified) protected voidvoidSet 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, getPredefinedUUID, getResourcePolicies, isMetadataModified, isModified, removeMetadata, removeMetadata, setMetadata, setModified
-
Field Details
-
ANY
Wild card for Dublin Core metadata qualifiers/languages- See Also:
-
-
Constructor Details
-
Item
protected Item()Protected constructor, create object using:ItemService.create(Context, WorkspaceItem) -
Item
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 Details
-
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
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
-
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
Set the owning Collection for the item- Parameters:
c- Collection
-
getOwningCollection
Get the owning Collection for the item- Returns:
- Collection that is the owner of the item
-
getSubmitter
Get the e-person that originally submitted this item- Returns:
- the submitter
-
setSubmitter
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
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
-
getBundles
Get the bundles in this item.- Returns:
- the bundles in an unordered array
-
getBundles
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
Returntrueifotheris the same Item as this object,falseotherwise. -
hashCode
public int hashCode() -
getType
public int getType()return type found in Constants- Specified by:
getTypein classDSpaceObject- Returns:
- int Constants.ITEM
-
getName
- Specified by:
getNamein classDSpaceObject
-
getLegacyId
- Specified by:
getLegacyIdin interfaceDSpaceObjectLegacySupport- Returns:
- the old integer based legacy identifier
-
getItemService
-
setMetadataModified
protected void setMetadataModified()- Overrides:
setMetadataModifiedin classDSpaceObject
-
isModifiedMetadataCache
public boolean isModifiedMetadataCache() -
getCachedMetadata
-
setCachedMetadata
-