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) |
int |
countTotal(Context context) |
int |
countWithdrawnItems(Context context) |
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, 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 objectSQLExceptionAuthorizeExceptionItem 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.SQLExceptionAuthorizeExceptionIterator<Item> findAll(Context context) throws SQLException
context - DSpace context objectSQLExceptionIterator<Item> findAllUnfiltered(Context context) throws SQLException
context - DSpace context objectSQLExceptionIterator<Item> findBySubmitter(Context context, EPerson eperson) throws SQLException
context - DSpace context objecteperson - the submitterSQLExceptionIterator<Item> findBySubmitterDateSorted(Context context, EPerson eperson, Integer limit) throws SQLException
context - eperson - limit - a positive integer to limit, -1 or null for unlimitedSQLExceptionIterator<Item> findByCollection(Context context, Collection collection) throws SQLException
SQLExceptionIterator<Item> findByCollection(Context context, Collection collection, Integer limit, Integer offset) throws SQLException
SQLExceptionIterator<Item> findInArchiveOrWithdrawnDiscoverableModifiedSince(Context context, Date since) throws SQLException
context - since - earliest interesting last-modified date, or null for no date test.SQLExceptionIterator<Item> findAllByCollection(Context context, Collection collection) throws SQLException
SQLExceptionboolean isIn(Item item, Collection collection) throws SQLException
collection - collection contains this Item.SQLExceptionList<Community> getCommunities(Context context, Item item) throws SQLException
SQLExceptionList<Bundle> getBundles(Item item, String name) throws SQLException
name - name of bundle (ORIGINAL/TEXT/THUMBNAIL)SQLExceptionvoid addBundle(Context context, Item item, Bundle bundle) throws SQLException, AuthorizeException
bundle - the bundle to addSQLExceptionAuthorizeExceptionvoid removeBundle(Context context, Item item, Bundle bundle) throws SQLException, AuthorizeException, IOException
bundle - the bundle to removeSQLExceptionAuthorizeExceptionIOExceptionvoid removeAllBundles(Context context, Item item) throws AuthorizeException, SQLException, IOException
item - the item from which to remove our bundlesSQLExceptionAuthorizeExceptionIOExceptionBitstream createSingleBitstream(Context context, InputStream is, Item item, String name) throws AuthorizeException, IOException, SQLException
is - the stream to create the new bitstream fromname - is the name of the bundle (ORIGINAL, TEXT, THUMBNAIL)AuthorizeExceptionIOExceptionSQLExceptionBitstream createSingleBitstream(Context context, InputStream is, Item item) throws AuthorizeException, IOException, SQLException
is - InputStreamAuthorizeExceptionIOExceptionSQLExceptionList<Bitstream> getNonInternalBitstreams(Context context, Item item) throws SQLException
SQLExceptionvoid removeDSpaceLicense(Context context, Item item) throws SQLException, AuthorizeException, IOException
This method is used by the org.dspace.submit.step.LicenseStep class
void removeLicenses(Context context, Item item) throws SQLException, AuthorizeException, IOException
void withdraw(Context context, Item item) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionvoid reinstate(Context context, Item item) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionboolean isOwningCollection(Item item, Collection collection)
collection - Collectionvoid replaceAllItemPolicies(Context context, Item item, List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException
newpolicies - -
this will be all of the new policies for the item and its
contentsSQLExceptionAuthorizeExceptionvoid replaceAllBitstreamPolicies(Context context, Item item, List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException
newpolicies - -
this will be all of the new policies for the bundle and
bitstream contentsSQLExceptionAuthorizeExceptionvoid removeGroupPolicies(Context context, Item item, Group group) throws SQLException, AuthorizeException
group - Group referenced by policies that needs to be removedSQLExceptionAuthorizeExceptionvoid inheritCollectionDefaultPolicies(Context context, Item item, Collection collection) throws SQLException, AuthorizeException
collection - CollectionSQLException - if an SQL error or if no default policies found. It's a bit
draconian, but default policies must be enforced.AuthorizeExceptionvoid 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
void move(Context context, Item item, Collection from, Collection to, boolean inheritDefaultPolicies) throws SQLException, AuthorizeException, IOException
boolean hasUploadedFiles(Item item) throws SQLException
SQLExceptionList<Collection> getCollectionsNotLinked(Context context, Item item) throws SQLException
SQLExceptionboolean canEdit(Context context, Item item) throws SQLException
SQLExceptionIterator<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, - AuthorizeException, IOExceptionSQLExceptionAuthorizeExceptionIOExceptionIterator<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, - AuthorizeException, IOExceptionSQLExceptionAuthorizeExceptionIOExceptionIterator<Item> findByMetadataFieldAuthority(Context context, String mdString, String authority) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionboolean isItemListedForUser(Context context, Item item)
context - item - int countItems(Context context, Collection collection) throws SQLException
SQLExceptionIterator<Item> findByLastModifiedSince(Context context, Date last) throws SQLException
context - last - Earliest interesting last-modified date.SQLExceptionint countItems(Context context, Community community) throws SQLException
SQLExceptionint countTotal(Context context) throws SQLException
SQLExceptionint countNotArchivedItems(Context context) throws SQLException
SQLExceptionint countWithdrawnItems(Context context) throws SQLException
SQLExceptionCopyright © 2016 DuraSpace. All Rights Reserved.