public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLegacySupportService<Item>
| Modifier and Type | Method and Description |
|---|---|
void |
addBundle(Context context,
Item item,
Bundle bundle)
Add an existing bundle to this item.
|
void |
adjustBundleBitstreamPolicies(Context context,
Item item,
Collection collection) |
void |
adjustItemPolicies(Context context,
Item item,
Collection collection) |
boolean |
canEdit(Context context,
Item item)
return TRUE if context's user can edit item, false otherwise
|
int |
countItems(Context context,
Collection collection)
counts items in the given collection
|
int |
countItems(Context context,
Community community)
counts items in the given community
|
int |
countNotArchivedItems(Context context)
counts all items not in archive
|
int |
countTotal(Context context)
counts all items
|
int |
countWithdrawnItems(Context context)
counts all withdrawn items
|
Item |
create(Context context,
WorkspaceItem workspaceItem)
Create a new item, with a new internal ID.
|
Bitstream |
createSingleBitstream(Context context,
InputStream is,
Item item)
Convenience method, calls createSingleBitstream() with name "ORIGINAL"
|
Bitstream |
createSingleBitstream(Context context,
InputStream is,
Item item,
String name)
Create a single bitstream in a new bundle.
|
Item |
createTemplateItem(Context context,
Collection collection)
Create an empty template item for this collection.
|
Iterator<Item> |
findAll(Context context)
Get all the items in the archive.
|
Iterator<Item> |
findAllByCollection(Context context,
Collection collection)
Get all the items in this collection.
|
Iterator<Item> |
findAllUnfiltered(Context context)
Get all "final" items in the archive, both archived ("in archive" flag) or
withdrawn items are included.
|
Iterator<Item> |
findByAuthorityValue(Context context,
String schema,
String element,
String qualifier,
String value)
Find all the items in the archive with a given authority key value
in the indicated metadata field.
|
Iterator<Item> |
findByCollection(Context context,
Collection collection)
Get all the items in this collection.
|
Iterator<Item> |
findByCollection(Context context,
Collection collection,
Integer limit,
Integer offset)
Get all the items in this collection.
|
Iterator<Item> |
findByLastModifiedSince(Context context,
Date last)
Find all Items modified since a Date.
|
Iterator<Item> |
findByMetadataField(Context context,
String schema,
String element,
String qualifier,
String value)
Returns an iterator of Items possessing the passed metadata field, or only
those matching the passed value, if value is not Item.ANY
|
Iterator<Item> |
findByMetadataFieldAuthority(Context context,
String mdString,
String authority) |
Iterator<Item> |
findByMetadataQuery(Context context,
List<List<MetadataField>> listFieldList,
List<String> query_op,
List<String> query_val,
List<UUID> collectionUuids,
String regexClause,
int offset,
int limit) |
Iterator<Item> |
findBySubmitter(Context context,
EPerson eperson)
Find all the items in the archive by a given submitter.
|
Iterator<Item> |
findBySubmitterDateSorted(Context context,
EPerson eperson,
Integer limit)
Retrieve the list of Items submitted by eperson, ordered by recently submitted, optionally limitable
|
Iterator<Item> |
findInArchiveOrWithdrawnDiscoverableModifiedSince(Context context,
Date since)
Get all Items installed or withdrawn, discoverable, and modified since a Date.
|
List<Bundle> |
getBundles(Item item,
String name)
Get the bundles matching a bundle name (name corresponds roughly to type)
|
List<Collection> |
getCollectionsNotLinked(Context context,
Item item)
Get the collections this item is not in.
|
List<Community> |
getCommunities(Context context,
Item item)
Get the communities this item is in.
|
List<Bitstream> |
getNonInternalBitstreams(Context context,
Item item)
Get all non-internal bitstreams in the item.
|
Thumbnail |
getThumbnail(Context context,
Item item,
boolean requireOriginal) |
boolean |
hasUploadedFiles(Item item)
Check the bundle ORIGINAL to see if there are any uploaded files
|
void |
inheritCollectionDefaultPolicies(Context context,
Item item,
Collection collection)
remove all policies on an item and its contents, and replace them with
the DEFAULT_ITEM_READ and DEFAULT_BITSTREAM_READ policies belonging to
the collection.
|
boolean |
isIn(Item item,
Collection collection)
See whether this Item is contained by a given Collection.
|
boolean |
isItemListedForUser(Context context,
Item item)
Service method for knowing if this Item should be visible in the item list.
|
boolean |
isOwningCollection(Item item,
Collection collection)
Return true if this Collection 'owns' this item
|
void |
move(Context context,
Item item,
Collection from,
Collection to)
Moves the item from one collection to another one
|
void |
move(Context context,
Item item,
Collection from,
Collection to,
boolean inheritDefaultPolicies)
Moves the item from one collection to another one
|
void |
reinstate(Context context,
Item item)
Reinstate a withdrawn item
|
void |
removeAllBundles(Context context,
Item item)
Remove all bundles linked to this item.
|
void |
removeBundle(Context context,
Item item,
Bundle bundle)
Remove a bundle.
|
void |
removeDSpaceLicense(Context context,
Item item)
Remove just the DSpace license from an item This is useful to update the
current DSpace license, in case the user must accept the DSpace license
again (either the item was rejected, or resumed after saving)
|
void |
removeGroupPolicies(Context context,
Item item,
Group group)
remove all of the policies for item's bitstreams and bundles that belong
to a given Group
|
void |
removeLicenses(Context context,
Item item)
Remove all licenses from an item - it was rejected
|
void |
replaceAllBitstreamPolicies(Context context,
Item item,
List<ResourcePolicy> newpolicies)
remove all of the policies for item's bitstreams and bundles and replace
them with a new list of policies
|
void |
replaceAllItemPolicies(Context context,
Item item,
List<ResourcePolicy> newpolicies)
remove all of the policies for item and replace them with a new list of
policies
|
void |
withdraw(Context context,
Item item)
Withdraw the item from the archive.
|
addMetadata, 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, getSupportsTypeConstantThumbnail getThumbnail(Context context, Item item, boolean requireOriginal) throws SQLException
SQLExceptionItem create(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException
context - DSpace context objectworkspaceItem - in progress workspace itemSQLException - if database errorAuthorizeException - if authorization errorItem 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.context - DSpace context objectcollection - Collection (parent)SQLException - if database errorAuthorizeException - if authorization errorIterator<Item> findAll(Context context) throws SQLException
context - DSpace context objectSQLException - if database errorIterator<Item> findAllUnfiltered(Context context) throws SQLException
context - DSpace context objectSQLException - if database errorIterator<Item> findBySubmitter(Context context, EPerson eperson) throws SQLException
context - DSpace context objecteperson - the submitterSQLException - if database errorIterator<Item> findBySubmitterDateSorted(Context context, EPerson eperson, Integer limit) throws SQLException
context - contexteperson - epersonlimit - a positive integer to limit, -1 or null for unlimitedSQLException - if database errorIterator<Item> findByCollection(Context context, Collection collection) throws SQLException
context - DSpace context objectcollection - Collection (parent)SQLException - if database errorIterator<Item> findByCollection(Context context, Collection collection, Integer limit, Integer offset) throws SQLException
context - DSpace context objectcollection - Collection (parent)limit - limited number of itemsoffset - offset valueSQLException - if database errorIterator<Item> findInArchiveOrWithdrawnDiscoverableModifiedSince(Context context, Date since) throws SQLException
context - contextsince - earliest interesting last-modified date, or null for no date test.SQLException - if database errorIterator<Item> findAllByCollection(Context context, Collection collection) throws SQLException
context - DSpace context objectcollection - Collection (parent)SQLException - if database errorboolean isIn(Item item, Collection collection) throws SQLException
item - Itemcollection - Collection (parentcollection contains this Item.SQLException - if database errorList<Community> getCommunities(Context context, Item item) throws SQLException
context - DSpace context objectitem - ItemSQLException - if database errorList<Bundle> getBundles(Item item, String name) throws SQLException
item - Itemname - name of bundle (ORIGINAL/TEXT/THUMBNAIL)SQLException - if database errorvoid addBundle(Context context, Item item, Bundle bundle) throws SQLException, AuthorizeException
context - DSpace context objectitem - Itembundle - the bundle to addSQLException - if database errorAuthorizeException - if authorization errorvoid removeBundle(Context context, Item item, Bundle bundle) throws SQLException, AuthorizeException, IOException
context - DSpace context objectitem - Itembundle - the bundle to removeSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorvoid removeAllBundles(Context context, Item item) throws AuthorizeException, SQLException, IOException
context - DSpace context objectitem - the item from which to remove our bundlesSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorBitstream createSingleBitstream(Context context, InputStream is, Item item, String name) throws AuthorizeException, IOException, SQLException
context - DSpace context objectitem - Itemis - the stream to create the new bitstream fromname - is the name of the bundle (ORIGINAL, TEXT, THUMBNAIL)AuthorizeException - if authorization errorIOException - if IO errorSQLException - if database errorBitstream createSingleBitstream(Context context, InputStream is, Item item) throws AuthorizeException, IOException, SQLException
context - DSpace context objectitem - Itemis - InputStreamAuthorizeException - if authorization errorIOException - if IO errorSQLException - if database errorList<Bitstream> getNonInternalBitstreams(Context context, Item item) throws SQLException
context - DSpace context objectitem - ItemSQLException - if database errorvoid removeDSpaceLicense(Context context, Item item) throws SQLException, AuthorizeException, IOException
This method is used by the org.dspace.submit.step.LicenseStep class
context - DSpace context objectitem - ItemSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorvoid removeLicenses(Context context, Item item) throws SQLException, AuthorizeException, IOException
context - DSpace context objectitem - ItemSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorvoid withdraw(Context context, Item item) throws SQLException, AuthorizeException
context - DSpace context objectitem - ItemSQLException - if database errorAuthorizeException - if authorization errorvoid reinstate(Context context, Item item) throws SQLException, AuthorizeException
context - DSpace context objectitem - ItemSQLException - if database errorAuthorizeException - if authorization errorboolean isOwningCollection(Item item, Collection collection)
item - Itemcollection - Collectionvoid replaceAllItemPolicies(Context context, Item item, List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException
context - DSpace context objectitem - Itemnewpolicies - -
this will be all of the new policies for the item and its
contentsSQLException - if database errorAuthorizeException - if authorization errorvoid replaceAllBitstreamPolicies(Context context, Item item, List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException
context - DSpace context objectitem - Itemnewpolicies - -
this will be all of the new policies for the bundle and
bitstream contentsSQLException - if database errorAuthorizeException - if authorization errorvoid removeGroupPolicies(Context context, Item item, Group group) throws SQLException, AuthorizeException
context - DSpace context objectitem - Itemgroup - Group referenced by policies that needs to be removedSQLException - if database errorAuthorizeException - if authorization errorvoid inheritCollectionDefaultPolicies(Context context, Item item, Collection collection) throws SQLException, AuthorizeException
context - DSpace context objectitem - Itemcollection - CollectionSQLException - if database error
if an SQL error or if no default policies found. It's a bit
draconian, but default policies must be enforced.AuthorizeException - if authorization errorvoid adjustBundleBitstreamPolicies(Context context, Item item, Collection collection) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionvoid adjustItemPolicies(Context context, Item item, Collection collection) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionvoid move(Context context, Item item, Collection from, Collection to) throws SQLException, AuthorizeException, IOException
context - DSpace context objectitem - Itemfrom - Collection to move fromto - Collection to move toSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorvoid move(Context context, Item item, Collection from, Collection to, boolean inheritDefaultPolicies) throws SQLException, AuthorizeException, IOException
context - DSpace context objectitem - Itemfrom - Collection to move fromto - Collection to move toinheritDefaultPolicies - whether to inherit policies from new collectionSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorboolean hasUploadedFiles(Item item) throws SQLException
item - ItemSQLException - if database errorList<Collection> getCollectionsNotLinked(Context context, Item item) throws SQLException
context - DSpace context objectitem - ItemSQLException - if database errorboolean canEdit(Context context, Item item) throws SQLException
context - DSpace context objectitem - ItemSQLException - if database errorIterator<Item> findByMetadataField(Context context, String schema, String element, String qualifier, String value) throws SQLException, AuthorizeException, IOException
context - DSpace context objectschema - metadata field schemaelement - metadata field elementqualifier - metadata field qualifiervalue - field value or Item.ANY to match any valueSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorIterator<Item> findByMetadataQuery(Context context, List<List<MetadataField>> listFieldList, List<String> query_op, List<String> query_val, List<UUID> collectionUuids, String regexClause, int offset, int limit) throws SQLException, AuthorizeException, IOException
Iterator<Item> findByAuthorityValue(Context context, String schema, String element, String qualifier, String value) throws SQLException, AuthorizeException, IOException
context - DSpace context objectschema - metadata field schemaelement - metadata field elementqualifier - metadata field qualifiervalue - the value of authority key to look forSQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorIterator<Item> findByMetadataFieldAuthority(Context context, String mdString, String authority) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionboolean isItemListedForUser(Context context, Item item)
context - contextitem - itemint countItems(Context context, Collection collection) throws SQLException
context - DSpace context objectcollection - CollectionSQLException - if database errorIterator<Item> findByLastModifiedSince(Context context, Date last) throws SQLException
context - contextlast - Earliest interesting last-modified date.SQLException - if database errorint countItems(Context context, Community community) throws SQLException
context - DSpace context objectcommunity - CommunitySQLException - if database errorint countTotal(Context context) throws SQLException
context - DSpace context objectSQLException - if database errorint countNotArchivedItems(Context context) throws SQLException
context - DSpace context objectSQLException - if database errorint countWithdrawnItems(Context context) throws SQLException
context - DSpace context objectSQLException - if database errorCopyright © 2016 DuraSpace. All rights reserved.