public class Bundle extends DSpaceObject
The corresponding Bitstream objects are loaded into memory. At present, there
is no metadata associated with bundles - they are simple containers. Thus,
the update method doesn't do much yet. Creating, adding or
removing bitstreams has instant effect in the database.
allMetadataFields, metadataCache, modifiedMetadata, ourContext| Modifier and Type | Method and Description |
|---|---|
void |
addBitstream(Bitstream b)
Add an existing bitstream to this bundle
|
Bitstream |
createBitstream(InputStream is)
Create a new bitstream in this bundle.
|
static Bundle |
find(Context context,
int id)
Get a bundle from the database.
|
DSpaceObject |
getAdminObject(int action)
Return the dspace object where an ADMIN action right is sufficient to
grant the initial authorize check.
|
Bitstream |
getBitstreamByName(String name) |
List<ResourcePolicy> |
getBitstreamPolicies() |
Bitstream[] |
getBitstreams()
Get the bitstreams in this bundle
|
List<ResourcePolicy> |
getBundlePolicies() |
String |
getHandle()
Get the Handle of the object.
|
int |
getID()
Get the internal identifier of this bundle
|
Item[] |
getItems()
Get the items this bundle appears in
|
String |
getName()
Get the name of the bundle
|
DSpaceObject |
getParentObject()
Return the dspace object that "own" the current object in the hierarchy.
|
int |
getPrimaryBitstreamID()
Get the primary bitstream ID of the bundle
|
int |
getType()
return type found in Constants
|
void |
inheritCollectionDefaultPolicies(Collection c)
remove all policies on the bundle and its contents, and replace them with
the DEFAULT_BITSTREAM_READ policies belonging to the collection.
|
Bitstream |
registerBitstream(int assetstore,
String bitstreamPath)
Create a new bitstream in this bundle.
|
void |
removeBitstream(Bitstream b)
Remove a bitstream from this bundle - the bitstream is only deleted if
this was the last reference to it
|
void |
replaceAllBitstreamPolicies(List<ResourcePolicy> newpolicies)
remove all of the policies for the bundle and bitstream contents and replace
them with a new list of policies
|
void |
setName(String name)
Set the name of the bundle
|
void |
setOrder(int[] bitstreamIds)
Changes bitstream order according to the array
|
void |
setPrimaryBitstreamID(int bitstreamID)
Set the primary bitstream ID of the bundle
|
void |
unsetPrimaryBitstreamID()
Unset the primary bitstream ID of the bundle
|
void |
update()
Update the bundle metadata
|
void |
updateLastModified() |
addDC, addDC, addDetails, addMetadata, addMetadata, addMetadata, addMetadata, clearDC, clearDetails, clearMetadata, find, getAuthoritiesAndConfidences, getDC, getDetails, getElements, getElementsFilled, getIdentifiers, getMDValueByField, getMDValueByLegacyField, getMetadata, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataField, getMetadataFirstValue, getTypeText, removeMetadataFromDatabase, replaceMetadataValue, resetIdentifiersCache, setMetadataSingleValue, updateMetadatapublic static Bundle find(Context context, int id) throws SQLException
context - DSpace context objectid - ID of the bundleSQLExceptionpublic int getID()
getID in class DSpaceObjectpublic String getName()
getName in class DSpaceObjectpublic void setName(String name)
name - string name of the bundle (ORIGINAL, TEXT, THUMBNAIL) are the
values currently usedpublic int getPrimaryBitstreamID()
public void setPrimaryBitstreamID(int bitstreamID)
bitstreamID - int ID of primary bitstream (e.g. index html file)public void unsetPrimaryBitstreamID()
public String getHandle()
DSpaceObjectnullgetHandle in class DSpaceObjectnull if it doesn't have
onepublic Bitstream getBitstreamByName(String name)
name - name of the bitstream you're looking forpublic Bitstream[] getBitstreams()
public Item[] getItems() throws SQLException
Item s this bundle appears inSQLExceptionpublic Bitstream createBitstream(InputStream is) throws AuthorizeException, IOException, SQLException
is - the stream to read the new bitstream fromAuthorizeExceptionIOExceptionSQLExceptionpublic Bitstream registerBitstream(int assetstore, String bitstreamPath) throws AuthorizeException, IOException, SQLException
assetstore - corresponds to an assetstore in dspace.cfgbitstreamPath - the path and filename relative to the assetstoreIOExceptionSQLExceptionAuthorizeExceptionpublic void addBitstream(Bitstream b) throws SQLException, AuthorizeException
b - the bitstream to addSQLExceptionAuthorizeExceptionpublic void setOrder(int[] bitstreamIds)
throws AuthorizeException,
SQLException
bitstreamIds - the identifiers in the order they are to be setSQLException - when an SQL error has occurred (querying DSpace)AuthorizeException - If the user can't make the changespublic void removeBitstream(Bitstream b) throws AuthorizeException, SQLException, IOException
If the bitstream in question is the primary bitstream recorded for the
bundle the primary bitstream field is unset in order to free the
bitstream from the foreign key constraint so that the
cleanup process can run normally.
b - the bitstream to removeAuthorizeExceptionSQLExceptionIOExceptionpublic void update()
throws SQLException,
AuthorizeException
update in class DSpaceObjectSQLExceptionAuthorizeExceptionpublic int getType()
getType in class DSpaceObjectpublic void inheritCollectionDefaultPolicies(Collection c) throws SQLException, AuthorizeException
c - CollectionSQLException - if an SQL error or if no default policies found. It's a bit
draconian, but default policies must be enforced.AuthorizeExceptionpublic void replaceAllBitstreamPolicies(List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException
newpolicies - -
this will be all of the new policies for the bundle and
bitstream contentsSQLExceptionAuthorizeExceptionpublic List<ResourcePolicy> getBundlePolicies() throws SQLException
SQLExceptionpublic List<ResourcePolicy> getBitstreamPolicies() throws SQLException
SQLExceptionpublic DSpaceObject getAdminObject(int action) throws SQLException
DSpaceObjectDefault behaviour is ADMIN right on the object grant right on all other action on the object itself. Subclass should override this method as needed.
getAdminObject in class DSpaceObjectaction - ID of action being attempted, from
org.dspace.core.Constants. The ADMIN action is
not a valid parameter for this method, an
IllegalArgumentException should be thrownSQLExceptionpublic DSpaceObject getParentObject() throws SQLException
DSpaceObjectgetParentObject in class DSpaceObjectSQLExceptionpublic void updateLastModified()
updateLastModified in class DSpaceObjectCopyright © 2014 DuraSpace. All Rights Reserved.