Package org.dspace.content
Class Bundle
- java.lang.Object
-
- org.dspace.content.DSpaceObject
-
- org.dspace.content.Bundle
-
- All Implemented Interfaces:
Serializable,DSpaceObjectLegacySupport,ReloadableEntity<UUID>
@Entity public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport
Class representing bundles of bitstreams stored in the DSpace systemThe corresponding Bitstream objects are loaded into memory. At present, there is no metadata associated with bundles - they are simple containers. Thus, the
updatemethod doesn't do much yet. Creating, adding or removing bitstreams has instant effect in the database.- Version:
- $Revision$
- Author:
- Robert Tansley
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BundleServicebundleService-
Fields inherited from class org.dspace.content.DSpaceObject
id, predefinedUUID
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBundle()Protected constructor, create object using:BundleService.create(Context, Item, String)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearBitstreams()Clear the list of bitstream of this bundlebooleanequals(Object obj)List<Bitstream>getBitstreams()Get a copy of the bitstream list of this bundle Note that this is a copy and if you wish to manipulate the bistream list, you should use , orList<Item>getItems()Get the items this bundle appears inIntegergetLegacyId()StringgetName()Get the name of the bundleBitstreamgetPrimaryBitstream()Get the primary bitstream ID of the bundleintgetType()return type found in ConstantsinthashCode()voidremoveBitstream(Bitstream bitstream)Remove the given bitstream from this bundles bitstream listvoidsetName(Context context, String name)Set the name of the bundlevoidsetPrimaryBitstreamID(Bitstream bitstream)Set the primary bitstream ID of the bundlevoidunsetPrimaryBitstreamID()Unset the primary bitstream ID of the bundle-
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
-
-
-
-
Field Detail
-
bundleService
protected transient BundleService bundleService
-
-
Constructor Detail
-
Bundle
protected Bundle()
Protected constructor, create object using:BundleService.create(Context, Item, String)
-
-
Method Detail
-
getLegacyId
public Integer getLegacyId()
- Specified by:
getLegacyIdin interfaceDSpaceObjectLegacySupport- Returns:
- the old integer based legacy identifier
-
getName
public String getName()
Get the name of the bundle- Specified by:
getNamein classDSpaceObject- Returns:
- name of the bundle (ORIGINAL, TEXT, THUMBNAIL) or NULL if not set
-
setName
public void setName(Context context, String name) throws SQLException
Set the name of the bundle- Parameters:
context- contextname- string name of the bundle (ORIGINAL, TEXT, THUMBNAIL) are the values currently used- Throws:
SQLException- if database error
-
getPrimaryBitstream
public Bitstream getPrimaryBitstream()
Get the primary bitstream ID of the bundle- Returns:
- primary bitstream ID or -1 if not set
-
setPrimaryBitstreamID
public void setPrimaryBitstreamID(Bitstream bitstream)
Set the primary bitstream ID of the bundle- Parameters:
bitstream- primary bitstream (e.g. index html file)
-
unsetPrimaryBitstreamID
public void unsetPrimaryBitstreamID()
Unset the primary bitstream ID of the bundle
-
getBitstreams
public List<Bitstream> getBitstreams()
Get a copy of the bitstream list of this bundle Note that this is a copy and if you wish to manipulate the bistream list, you should use , or- Returns:
- the bitstreams
-
clearBitstreams
public void clearBitstreams()
Clear the list of bitstream of this bundle
-
removeBitstream
public void removeBitstream(Bitstream bitstream)
Remove the given bitstream from this bundles bitstream list- Parameters:
bitstream- The bitstream to remove
-
getItems
public List<Item> getItems()
Get the items this bundle appears in- Returns:
- array of
Items this bundle appears in
-
getType
public int getType()
return type found in Constants- Specified by:
getTypein classDSpaceObject- Returns:
- bundle type
-
-