public interface CollectionService extends DSpaceObjectService<Collection>, DSpaceObjectLegacySupportService<Collection>
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(Context context,
Collection collection,
Item item)
Add an item to the collection.
|
void |
canEdit(Context context,
Collection collection) |
void |
canEdit(Context context,
Collection collection,
boolean useInheritance) |
boolean |
canEditBoolean(Context context,
Collection collection) |
boolean |
canEditBoolean(Context context,
Collection collection,
boolean useInheritance) |
int |
countTotal(Context context) |
Collection |
create(Context context,
Community community)
Create a new collection with a new ID.
|
Collection |
create(Context context,
Community community,
String handle)
Create a new collection with the supplied handle and with a new ID.
|
Group |
createAdministrators(Context context,
Collection collection)
Create a default administrators group if one does not already exist.
|
Group |
createSubmitters(Context context,
Collection collection)
Create a default submitters group if one does not already exist.
|
void |
createTemplateItem(Context context,
Collection collection)
Create an empty template item for this collection.
|
Group |
createWorkflowGroup(Context context,
Collection collection,
int step)
Create a workflow group for the given step if one does not already exist.
|
List<Collection> |
findAll(Context context)
Get all collections in the system.
|
List<Collection> |
findAll(Context context,
Integer limit,
Integer offset)
Get all collections in the system.
|
List<Collection> |
findAuthorized(Context context,
Community community,
int actionID)
return an array of collections that user has a given permission on
(useful for trimming 'select to collection' list) or figuring out which
collections a person is an editor for.
|
List<Collection> |
findAuthorizedOptimized(Context context,
int actionID) |
Collection |
findByGroup(Context context,
Group group) |
List<Collection> |
findCollectionsWithSubscribers(Context context) |
List<Collection> |
findDirectMapped(Context context,
int actionID) |
List<Collection> |
findGroup2CommunityMapped(Context context) |
List<Collection> |
findGroup2GroupMapped(Context context,
int actionID) |
List<Collection> |
findGroupMapped(Context context,
int actionID) |
List<Map.Entry<Collection,Long>> |
getCollectionsWithBitstreamSizesTotal(Context context)
The map entry returned contains a collection as a key and sum of bitstream sizes in bytes as a value
|
String |
getLicense(Collection collection)
Get the license that users must grant before submitting to this
collection.
|
Group |
getWorkflowGroup(Collection collection,
int step)
Get the the workflow group corresponding to a particular workflow step.
|
boolean |
hasCustomLicense(Collection collection)
Find out if the collection has a custom license
|
void |
removeAdministrators(Context context,
Collection collection)
Remove the administrators group, if no group has already been created
then return without error.
|
void |
removeItem(Context context,
Collection collection,
Item item)
Remove an item.
|
void |
removeSubmitters(Context context,
Collection collection)
Remove the submitters group, if no group has already been created
then return without error.
|
void |
removeTemplateItem(Context context,
Collection collection)
Remove the template item for this collection, if there is one.
|
Bitstream |
setLogo(Context context,
Collection collection,
InputStream is)
Give the collection a logo.
|
void |
setMetadata(Context context,
Collection collection,
String field,
String value)
Deprecated.
|
void |
setWorkflowGroup(Collection collection,
int step,
Group group)
Set the workflow group corresponding to a particular workflow step.
|
addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, delete, find, getAdminObject, getIdentifiers, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getName, getParentObject, getSupportsTypeConstant, getTypeText, removeMetadataValues, setMetadataSingleValue, update, updateLastModifiedfindByIdOrLegacyId, findByLegacyId, getSupportsTypeConstantCollection create(Context context, Community community) throws SQLException, AuthorizeException
context - DSpace context objectSQLExceptionAuthorizeExceptionCollection create(Context context, Community community, String handle) throws SQLException, AuthorizeException
context - DSpace context objecthandle - the pre-determined Handle to assign to the new communitySQLExceptionAuthorizeExceptionList<Collection> findAll(Context context) throws SQLException
context - DSpace context objectSQLExceptionList<Collection> findAll(Context context, Integer limit, Integer offset) throws SQLException
context - limit - offset - SQLExceptionList<Collection> findAuthorizedOptimized(Context context, int actionID) throws SQLException
SQLExceptionList<Collection> findDirectMapped(Context context, int actionID) throws SQLException
SQLExceptionList<Collection> findGroup2CommunityMapped(Context context) throws SQLException
SQLExceptionList<Collection> findGroup2GroupMapped(Context context, int actionID) throws SQLException
SQLExceptionList<Collection> findGroupMapped(Context context, int actionID) throws SQLException
SQLException@Deprecated void setMetadata(Context context, Collection collection, String field, String value) throws MissingResourceException, SQLException
field - the name of the metadata field to getvalue - value to set the field toIllegalArgumentException - if the requested metadata field doesn't existMissingResourceExceptionSQLExceptionBitstream setLogo(Context context, Collection collection, InputStream is) throws AuthorizeException, IOException, SQLException
null removes any
existing logo. You will need to set the format of the new logo bitstream
before it will work, for example to "JPEG". Note that
update will need to be called for the change to take
effect. Setting a logo and not calling update later may
result in a previous logo lying around as an "orphaned" bitstream.is - the stream to use as the new logonull if there is no
logo (null was passed in)AuthorizeExceptionIOExceptionSQLExceptionGroup createWorkflowGroup(Context context, Collection collection, int step) throws SQLException, AuthorizeException
update is called.step - the step (1-3) of the workflow to create or get the group forSQLExceptionAuthorizeExceptionvoid setWorkflowGroup(Collection collection, int step, Group group)
null can be passed in if there should be no associated
group for that workflow step; any existing group is NOT deleted.step - the workflow step (1-3)group - the new workflow group, or nullGroup getWorkflowGroup(Collection collection, int step)
null if there is no group associated with
this collection for the given step.step - the workflow step (1-3)nullGroup createSubmitters(Context context, Collection collection) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionvoid removeSubmitters(Context context, Collection collection) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionGroup createAdministrators(Context context, Collection collection) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionvoid removeAdministrators(Context context, Collection collection) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionString getLicense(Collection collection)
boolean hasCustomLicense(Collection collection)
true if the collection has a custom licensevoid createTemplateItem(Context context, Collection collection) throws SQLException, AuthorizeException
update on
the collection after doing this, or the item will have been created but
the collection record will not refer to it.SQLExceptionAuthorizeExceptionvoid removeTemplateItem(Context context, Collection collection) throws SQLException, AuthorizeException, IOException
update.void addItem(Context context, Collection collection, Item item) throws SQLException, AuthorizeException
update need not be called.item - item to addSQLExceptionAuthorizeExceptionvoid removeItem(Context context, Collection collection, Item item) throws SQLException, AuthorizeException, IOException
item - item to removeSQLExceptionAuthorizeExceptionIOExceptionboolean canEditBoolean(Context context, Collection collection) throws SQLException
SQLExceptionboolean canEditBoolean(Context context, Collection collection, boolean useInheritance) throws SQLException
SQLExceptionvoid canEdit(Context context, Collection collection) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionvoid canEdit(Context context, Collection collection, boolean useInheritance) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionList<Collection> findAuthorized(Context context, Community community, int actionID) throws SQLException
context - community - (optional) restrict search to a community, else nullactionID - of the actionSQLExceptionCollection findByGroup(Context context, Group group) throws SQLException
SQLExceptionList<Collection> findCollectionsWithSubscribers(Context context) throws SQLException
SQLExceptionint countTotal(Context context) throws SQLException
SQLExceptionList<Map.Entry<Collection,Long>> getCollectionsWithBitstreamSizesTotal(Context context) throws SQLException
context - SQLExceptionCopyright © 2016 DuraSpace. All Rights Reserved.