Package org.dspace.content.service
Interface BundleService
-
- All Superinterfaces:
DSpaceObjectLegacySupportService<Bundle>,DSpaceObjectService<Bundle>
- All Known Implementing Classes:
BundleServiceImpl
public interface BundleService extends DSpaceObjectService<Bundle>, DSpaceObjectLegacySupportService<Bundle>
Service interface class for the Bundle object. The implementation of this class is responsible for all business logic calls for the Bundle object and is autowired by spring- Author:
- kevinvandevelde at atmire.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddBitstream(Context context, Bundle bundle, Bitstream bitstream)Add an existing bitstream to this bundleintcountTotal(Context context)Bundlecreate(Context context, Item item, String name)Create a new bundle, with a new ID and link it to the provided itemBitstreamgetBitstreamByName(Bundle bundle, String name)List<ResourcePolicy>getBitstreamPolicies(Context context, Bundle bundle)List<ResourcePolicy>getBundlePolicies(Context context, Bundle bundle)voidinheritCollectionDefaultPolicies(Context context, Bundle bundle, Collection collection)remove all policies on the bundle and its contents, and replace them with the DEFAULT_BITSTREAM_READ policies belonging to the collection.voidmoveBitstreamToBundle(Context context, Bundle targetBundle, Bitstream bitstream)Moves a bitstream from its current bundle to a new target bundlevoidremoveBitstream(Context context, Bundle bundle, Bitstream bitstream)Remove a bitstream from this bundle - the bitstream is only deleted if this was the last reference to itvoidreplaceAllBitstreamPolicies(Context context, Bundle bundle, List<ResourcePolicy> newpolicies)remove all of the policies for the bundle and bitstream contents and replace them with a new list of policiesvoidsetOrder(Context context, Bundle bundle, UUID[] bitstreamIds)Changes bitstream order according to the arrayvoidupdateBitstreamOrder(Context context, Bundle bundle, int from, int to)Moves a bitstream within a bundle from one place to another, shifting all other bitstreams in the process-
Methods inherited from interface org.dspace.content.service.DSpaceObjectLegacySupportService
findByIdOrLegacyId, findByLegacyId, getSupportsTypeConstant
-
Methods inherited from interface org.dspace.content.service.DSpaceObjectService
addAndShiftRightMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, delete, find, getAdminObject, getIdentifiers, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getName, getParentObject, getSupportsTypeConstant, getTypeText, moveMetadata, removeMetadataValues, replaceMetadata, setMetadataModified, setMetadataSingleValue, update, updateLastModified
-
-
-
-
Method Detail
-
create
Bundle create(Context context, Item item, String name) throws SQLException, AuthorizeException
Create a new bundle, with a new ID and link it to the provided item- Parameters:
context- DSpace context objectitem- DSpace itemname- bundle name- Returns:
- the newly created bundle
- Throws:
AuthorizeException- if authorization errorSQLException- if database error
-
addBitstream
void addBitstream(Context context, Bundle bundle, Bitstream bitstream) throws SQLException, AuthorizeException
Add an existing bitstream to this bundle- Parameters:
context- DSpace Contextbundle- the bitstream bundlebitstream- the bitstream to add- Throws:
AuthorizeException- if authorization errorSQLException- if database error
-
removeBitstream
void removeBitstream(Context context, Bundle bundle, Bitstream bitstream) throws AuthorizeException, SQLException, IOException
Remove a bitstream from this bundle - the bitstream is only deleted if this was the last reference to itIf 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
cleanupprocess can run normally.- Parameters:
context- DSpace Contextbundle- the bitstream bundlebitstream- the bitstream to remove- Throws:
IOException- if IO errorAuthorizeException- if authorization errorSQLException- if database error
-
inheritCollectionDefaultPolicies
void inheritCollectionDefaultPolicies(Context context, Bundle bundle, Collection collection) throws SQLException, AuthorizeException
remove all policies on the bundle and its contents, and replace them with the DEFAULT_BITSTREAM_READ policies belonging to the collection.- Parameters:
context- DSpace Contextbundle- the bitstream bundlecollection- Collection- Throws:
SQLException- if an SQL error or if no default policies found. It's a bit draconian, but default policies must be enforced.AuthorizeException- if authorization error
-
replaceAllBitstreamPolicies
void replaceAllBitstreamPolicies(Context context, Bundle bundle, List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException
remove all of the policies for the bundle and bitstream contents and replace them with a new list of policies- Parameters:
context- DSpace Contextbundle- the bitstream bundlenewpolicies- - this will be all of the new policies for the bundle and bitstream contents- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
getBitstreamPolicies
List<ResourcePolicy> getBitstreamPolicies(Context context, Bundle bundle) throws SQLException
- Throws:
SQLException
-
getBundlePolicies
List<ResourcePolicy> getBundlePolicies(Context context, Bundle bundle) throws SQLException
- Throws:
SQLException
-
updateBitstreamOrder
void updateBitstreamOrder(Context context, Bundle bundle, int from, int to) throws AuthorizeException, SQLException
Moves a bitstream within a bundle from one place to another, shifting all other bitstreams in the process- Parameters:
context- DSpace Contextbundle- The bitstream bundlefrom- The index of the bitstream to moveto- The index to move the bitstream to- Throws:
AuthorizeException- when an SQL error has occurred (querying DSpace)SQLException- If the user can't make the changes
-
moveBitstreamToBundle
void moveBitstreamToBundle(Context context, Bundle targetBundle, Bitstream bitstream) throws SQLException, AuthorizeException, IOException
Moves a bitstream from its current bundle to a new target bundle- Parameters:
context- DSpace ContexttargetBundle- The target bundle where bitstream will be moved tobitstream- The bitstream being moved- Throws:
SQLException- if database errorAuthorizeException- if authorization errorIOException- if IO error
-
setOrder
void setOrder(Context context, Bundle bundle, UUID[] bitstreamIds) throws AuthorizeException, SQLException
Changes bitstream order according to the array- Parameters:
context- DSpace Contextbundle- the bitstream bundlebitstreamIds- the identifiers in the order they are to be set- Throws:
SQLException- when an SQL error has occurred (querying DSpace)AuthorizeException- If the user can't make the changes
-
countTotal
int countTotal(Context context) throws SQLException
- Throws:
SQLException
-
-