Package org.dspace.content
Class WorkspaceItemServiceImpl
- java.lang.Object
-
- org.dspace.content.WorkspaceItemServiceImpl
-
- All Implemented Interfaces:
InProgressSubmissionService<WorkspaceItem>,WorkspaceItemService
public class WorkspaceItemServiceImpl extends Object implements WorkspaceItemService
Service implementation for the WorkspaceItem object. This class is responsible for all business logic calls for the WorkspaceItem object and is autowired by spring. This class should never be accessed directly.- Author:
- kevinvandevelde at atmire.com
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorizeServiceauthorizeServiceprotected CollectionServicecollectionServiceprotected ItemServiceitemServiceprotected WorkflowServiceworkflowServiceprotected WorkspaceItemDAOworkspaceItemDAO
-
Constructor Summary
Constructors Modifier Constructor Description protectedWorkspaceItemServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountByEPerson(Context context, EPerson ep)intcountTotal(Context context)WorkspaceItemcreate(Context context, Collection collection, boolean template)Create a new workspace item, with a new ID.WorkspaceItemcreate(Context context, Collection collection, UUID uuid, boolean template)Create a new workspace item, with a new ID.WorkspaceItemcreate(Context c, WorkflowItem workflowItem)voiddeleteAll(Context context, WorkspaceItem workspaceItem)Delete the workspace item.voiddeleteWrapper(Context context, WorkspaceItem workspaceItem)Deletes submission wrapper, doesn't delete item contentsWorkspaceItemfind(Context context, int id)Get a workspace item from the database.List<WorkspaceItem>findAll(Context context)Get all workspace items in the whole systemList<WorkspaceItem>findAll(Context context, Integer limit, Integer offset)Get all workspace items in the whole system, paginated.List<WorkspaceItem>findAllSupervisedItems(Context context)List<WorkspaceItem>findByCollection(Context context, Collection collection)Get all workspace items for a particular collection.List<WorkspaceItem>findByEPerson(Context context, EPerson ep)Get all workspace items for a particular e-person.List<WorkspaceItem>findByEPerson(Context context, EPerson ep, Integer limit, Integer offset)Get a page of workspace items for a particular e-person.WorkspaceItemfindByItem(Context context, Item item)Check to see if a particular item is currently still in a user's Workspace.List<WorkspaceItem>findSupervisedItemsByEPerson(Context context, EPerson ePerson)List<Map.Entry<Integer,Long>>getStageReachedCounts(Context context)The map entry returned contains stage reached as the key and count of items in that stage as a valuevoidmove(Context context, WorkspaceItem source, Collection fromCollection, Collection toCollection)voidupdate(Context context, WorkspaceItem workspaceItem)Update the submission, including the unarchived item.
-
-
-
Field Detail
-
workspaceItemDAO
@Autowired(required=true) protected WorkspaceItemDAO workspaceItemDAO
-
authorizeService
@Autowired(required=true) protected AuthorizeService authorizeService
-
collectionService
@Autowired(required=true) protected CollectionService collectionService
-
itemService
@Autowired(required=true) protected ItemService itemService
-
workflowService
@Autowired(required=true) protected WorkflowService workflowService
-
-
Method Detail
-
find
public WorkspaceItem find(Context context, int id) throws SQLException
Description copied from interface:WorkspaceItemServiceGet a workspace item from the database. The item, collection and submitter are loaded into memory.- Specified by:
findin interfaceWorkspaceItemService- Parameters:
context- DSpace context objectid- ID of the workspace item- Returns:
- the workspace item, or null if the ID is invalid.
- Throws:
SQLException- if database error
-
create
public WorkspaceItem create(Context context, Collection collection, boolean template) throws AuthorizeException, SQLException
Description copied from interface:WorkspaceItemServiceCreate a new workspace item, with a new ID. An Item is also created. The submitter is the current user in the context.- Specified by:
createin interfaceWorkspaceItemService- Parameters:
context- DSpace context objectcollection- Collection being submitted totemplate- iftrue, the workspace item starts as a copy of the collection's template item- Returns:
- the newly created workspace item
- Throws:
AuthorizeException- if authorization errorSQLException- if database error
-
create
public WorkspaceItem create(Context context, Collection collection, UUID uuid, boolean template) throws AuthorizeException, SQLException
Description copied from interface:WorkspaceItemServiceCreate a new workspace item, with a new ID. An Item is also created. The submitter is the current user in the context.- Specified by:
createin interfaceWorkspaceItemService- Parameters:
context- DSpace context objectcollection- Collection being submitted touuid- the preferred uuid of the new item (used if restoring an item and retaining old uuid)template- iftrue, the workspace item starts as a copy of the collection's template item- Returns:
- the newly created workspace item
- Throws:
AuthorizeException- if authorization errorSQLException- if database error
-
create
public WorkspaceItem create(Context c, WorkflowItem workflowItem) throws SQLException, AuthorizeException
- Specified by:
createin interfaceWorkspaceItemService- Throws:
SQLExceptionAuthorizeException
-
findByEPerson
public List<WorkspaceItem> findByEPerson(Context context, EPerson ep) throws SQLException
Description copied from interface:WorkspaceItemServiceGet all workspace items for a particular e-person. These are ordered by workspace item ID, since this should likely keep them in the order in which they were created.- Specified by:
findByEPersonin interfaceWorkspaceItemService- Parameters:
context- the context objectep- the eperson- Returns:
- the corresponding workspace items
- Throws:
SQLException- if database error
-
findByEPerson
public List<WorkspaceItem> findByEPerson(Context context, EPerson ep, Integer limit, Integer offset) throws SQLException
Description copied from interface:WorkspaceItemServiceGet a page of workspace items for a particular e-person. These are ordered by workspace item ID, since this should likely keep them in the order in which they were created.- Specified by:
findByEPersonin interfaceWorkspaceItemService- Parameters:
context- the context objectep- the epersonlimit- the max number of workspaceitems to returnoffset- the offset- Returns:
- the corresponding workspace items
- Throws:
SQLException- if database error
-
findByCollection
public List<WorkspaceItem> findByCollection(Context context, Collection collection) throws SQLException
Description copied from interface:WorkspaceItemServiceGet all workspace items for a particular collection.- Specified by:
findByCollectionin interfaceWorkspaceItemService- Parameters:
context- the context objectcollection- the collection- Returns:
- the corresponding workspace items
- Throws:
SQLException- if database error
-
findByItem
public WorkspaceItem findByItem(Context context, Item item) throws SQLException
Description copied from interface:WorkspaceItemServiceCheck to see if a particular item is currently still in a user's Workspace. If so, its WorkspaceItem is returned. If not, null is returned- Specified by:
findByItemin interfaceWorkspaceItemService- Parameters:
context- the context objectitem- the item- Returns:
- workflow item corresponding to the item, or null
- Throws:
SQLException- if database error
-
findAllSupervisedItems
public List<WorkspaceItem> findAllSupervisedItems(Context context) throws SQLException
- Specified by:
findAllSupervisedItemsin interfaceWorkspaceItemService- Throws:
SQLException
-
findSupervisedItemsByEPerson
public List<WorkspaceItem> findSupervisedItemsByEPerson(Context context, EPerson ePerson) throws SQLException
- Specified by:
findSupervisedItemsByEPersonin interfaceWorkspaceItemService- Throws:
SQLException
-
findAll
public List<WorkspaceItem> findAll(Context context) throws SQLException
Description copied from interface:WorkspaceItemServiceGet all workspace items in the whole system- Specified by:
findAllin interfaceWorkspaceItemService- Parameters:
context- the context object- Returns:
- all workspace items
- Throws:
SQLException- if database error
-
findAll
public List<WorkspaceItem> findAll(Context context, Integer limit, Integer offset) throws SQLException
Description copied from interface:WorkspaceItemServiceGet all workspace items in the whole system, paginated.- Specified by:
findAllin interfaceWorkspaceItemService- Parameters:
context- the context objectlimit- limitoffset- offset- Returns:
- a page of workspace items
- Throws:
SQLException- if database error
-
update
public void update(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException
Description copied from interface:InProgressSubmissionServiceUpdate the submission, including the unarchived item.- Specified by:
updatein interfaceInProgressSubmissionService<WorkspaceItem>- Parameters:
context- contextworkspaceItem- submission- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
deleteAll
public void deleteAll(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException, IOException
Description copied from interface:WorkspaceItemServiceDelete the workspace item. The entry in workspaceitem, the unarchived item and its contents are all removed (multiple inclusion notwithstanding.)- Specified by:
deleteAllin interfaceWorkspaceItemService- Parameters:
context- contextworkspaceItem- workspace item- Throws:
SQLException- if database errorAuthorizeException- if authorization errorIOException- if IO error
-
countTotal
public int countTotal(Context context) throws SQLException
- Specified by:
countTotalin interfaceWorkspaceItemService- Throws:
SQLException
-
countByEPerson
public int countByEPerson(Context context, EPerson ep) throws SQLException
- Specified by:
countByEPersonin interfaceWorkspaceItemService- Throws:
SQLException
-
getStageReachedCounts
public List<Map.Entry<Integer,Long>> getStageReachedCounts(Context context) throws SQLException
Description copied from interface:WorkspaceItemServiceThe map entry returned contains stage reached as the key and count of items in that stage as a value- Specified by:
getStageReachedCountsin interfaceWorkspaceItemService- Parameters:
context- The relevant DSpace Context.- Returns:
- the map
- Throws:
SQLException- if database error
-
deleteWrapper
public void deleteWrapper(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException
Description copied from interface:InProgressSubmissionServiceDeletes submission wrapper, doesn't delete item contents- Specified by:
deleteWrapperin interfaceInProgressSubmissionService<WorkspaceItem>- Parameters:
context- contextworkspaceItem- submission- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
move
public void move(Context context, WorkspaceItem source, Collection fromCollection, Collection toCollection) throws DCInputsReaderException
- Specified by:
movein interfaceInProgressSubmissionService<WorkspaceItem>- Throws:
DCInputsReaderException
-
-