Class XmlWorkflowItemServiceImpl
- java.lang.Object
-
- org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItemServiceImpl
-
- All Implemented Interfaces:
InProgressSubmissionService<XmlWorkflowItem>,WorkflowItemService<XmlWorkflowItem>,XmlWorkflowItemService
public class XmlWorkflowItemServiceImpl extends Object implements XmlWorkflowItemService
Service implementation for the XmlWorkflowItem object. This class is responsible for all business logic calls for the XmlWorkflowItem 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 ClaimedTaskServiceclaimedTaskServiceprotected ItemServiceitemServiceprotected PoolTaskServicepoolTaskServiceprotected WorkflowItemRoleServiceworkflowItemRoleServiceprotected WorkflowRequirementsServiceworkflowRequirementsServiceprotected XmlWorkflowItemDAOxmlWorkflowItemDAO
-
Constructor Summary
Constructors Modifier Constructor Description protectedXmlWorkflowItemServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountAll(Context context)return how many workflow items appear in the databaseintcountAllInCollection(Context context, Collection collection)return how many workflow items that appear in the collectionintcountBySubmitter(Context context, EPerson ep)Count the number of workflow items from a specific submitterXmlWorkflowItemcreate(Context context, Item item, Collection collection)Wrap an Item in a WorkflowItem to place it in a Collection's workflow.voiddelete(Context context, XmlWorkflowItem workflowItem)Delete the specified workflow item.voiddeleteByCollection(Context context, Collection collection)Delete all workflow items present in the specified collection.voiddeleteWrapper(Context context, XmlWorkflowItem workflowItem)Deletes submission wrapper, doesn't delete item contentsXmlWorkflowItemfind(Context context, int id)Get a workflow item from the database.List<XmlWorkflowItem>findAll(Context context)return all workflowitemsList<XmlWorkflowItem>findAll(Context context, Integer page, Integer pagesize)return all workflowitems for a certain pageList<XmlWorkflowItem>findAllInCollection(Context context, Integer page, Integer pagesize, Collection collection)return all workflowitems for a certain page with a certain collectionList<XmlWorkflowItem>findByCollection(Context context, Collection collection)Get all workflow items for a particular collection.XmlWorkflowItemfindByItem(Context context, Item item)Check to see if a particular item is currently under Workflow.List<XmlWorkflowItem>findBySubmitter(Context context, EPerson ep)Get all workflow items that were original submissions by a particular e-person.List<XmlWorkflowItem>findBySubmitter(Context context, EPerson ep, Integer pageNumber, Integer pageSize)Return all the workflow items from a specific submitter respecting the pagination parametersvoidmove(Context context, XmlWorkflowItem inProgressSubmission, Collection fromCollection, Collection toCollection)voidupdate(Context context, XmlWorkflowItem workflowItem)Update the submission, including the unarchived item.
-
-
-
Field Detail
-
xmlWorkflowItemDAO
@Autowired(required=true) protected XmlWorkflowItemDAO xmlWorkflowItemDAO
-
claimedTaskService
@Autowired(required=true) protected ClaimedTaskService claimedTaskService
-
itemService
@Autowired(required=true) protected ItemService itemService
-
poolTaskService
@Autowired(required=true) protected PoolTaskService poolTaskService
-
workflowRequirementsService
@Autowired(required=true) protected WorkflowRequirementsService workflowRequirementsService
-
workflowItemRoleService
@Autowired(required=true) protected WorkflowItemRoleService workflowItemRoleService
-
-
Method Detail
-
create
public XmlWorkflowItem create(Context context, Item item, Collection collection) throws SQLException, AuthorizeException
Description copied from interface:WorkflowItemServiceWrap an Item in a WorkflowItem to place it in a Collection's workflow.- Specified by:
createin interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- current DSpace session.item- the Item to be wrapped.collection- place the Item in this Collection's workflow (if any).- Returns:
- the wrapped Item.
- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
find
public XmlWorkflowItem find(Context context, int id) throws SQLException
Description copied from interface:WorkflowItemServiceGet a workflow item from the database.- Specified by:
findin interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- The relevant DSpace Context.id- ID of the workflow item- Returns:
- the workflow item, or null if the ID is invalid.
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findAll
public List<XmlWorkflowItem> findAll(Context context) throws SQLException
Description copied from interface:WorkflowItemServicereturn all workflowitems- Specified by:
findAllin interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- The relevant DSpace Context.- Returns:
- List of all workflowItems in system
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findAll
public List<XmlWorkflowItem> findAll(Context context, Integer page, Integer pagesize) throws SQLException
Description copied from interface:XmlWorkflowItemServicereturn all workflowitems for a certain page- Specified by:
findAllin interfaceXmlWorkflowItemService- Parameters:
context- The relevant DSpace Context.page- paging: page numberpagesize- paging: items per page- Returns:
- WorkflowItem list of all the workflow items in system
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findAllInCollection
public List<XmlWorkflowItem> findAllInCollection(Context context, Integer page, Integer pagesize, Collection collection) throws SQLException
Description copied from interface:XmlWorkflowItemServicereturn all workflowitems for a certain page with a certain collection- Specified by:
findAllInCollectionin interfaceXmlWorkflowItemService- Parameters:
context- The relevant DSpace Context.page- paging: page numberpagesize- paging: items per pagecollection- restrict to this collection- Returns:
- WorkflowItem list of all the workflow items in system
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
countAll
public int countAll(Context context) throws SQLException
Description copied from interface:XmlWorkflowItemServicereturn how many workflow items appear in the database- Specified by:
countAllin interfaceXmlWorkflowItemService- Parameters:
context- The relevant DSpace Context.- Returns:
- the number of workflow items
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
countAllInCollection
public int countAllInCollection(Context context, Collection collection) throws SQLException
Description copied from interface:XmlWorkflowItemServicereturn how many workflow items that appear in the collection- Specified by:
countAllInCollectionin interfaceXmlWorkflowItemService- Parameters:
context- The relevant DSpace Context.collection- restrict to this collection- Returns:
- the number of workflow items
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findBySubmitter
public List<XmlWorkflowItem> findBySubmitter(Context context, EPerson ep) throws SQLException
Description copied from interface:WorkflowItemServiceGet all workflow items that were original submissions by a particular e-person.- Specified by:
findBySubmitterin interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- The relevant DSpace Context.ep- the eperson- Returns:
- the corresponding workflow items
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findBySubmitter
public List<XmlWorkflowItem> findBySubmitter(Context context, EPerson ep, Integer pageNumber, Integer pageSize) throws SQLException
Description copied from interface:XmlWorkflowItemServiceReturn all the workflow items from a specific submitter respecting the pagination parameters- Specified by:
findBySubmitterin interfaceXmlWorkflowItemService- Parameters:
context- The relevant DSpace Context.ep- the eperson that has submitted the itempageNumber- paging: page numberpageSize- paging: items per page- Returns:
- Throws:
SQLException
-
countBySubmitter
public int countBySubmitter(Context context, EPerson ep) throws SQLException
Description copied from interface:XmlWorkflowItemServiceCount the number of workflow items from a specific submitter- Specified by:
countBySubmitterin interfaceXmlWorkflowItemService- Parameters:
context- The relevant DSpace Context.ep- the eperson that has submitted the item- Returns:
- Throws:
SQLException
-
deleteByCollection
public void deleteByCollection(Context context, Collection collection) throws SQLException, IOException, AuthorizeException
Description copied from interface:WorkflowItemServiceDelete all workflow items present in the specified collection.- Specified by:
deleteByCollectionin interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- The relevant DSpace Context.collection- the containing collection- Throws:
SQLException- An exception that provides information on a database access error or other errors.IOException- A general class of exceptions produced by failed or interrupted I/O operations.AuthorizeException- Exception indicating the current user of the context does not have permission to perform a particular action.
-
delete
public void delete(Context context, XmlWorkflowItem workflowItem) throws SQLException, AuthorizeException, IOException
Description copied from interface:WorkflowItemServiceDelete the specified workflow item.- Specified by:
deletein interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- The relevant DSpace Context.workflowItem- which workflow item to delete- Throws:
SQLException- An exception that provides information on a database access error or other errors.AuthorizeException- Exception indicating the current user of the context does not have permission to perform a particular action.IOException- A general class of exceptions produced by failed or interrupted I/O operations.
-
findByCollection
public List<XmlWorkflowItem> findByCollection(Context context, Collection collection) throws SQLException
Description copied from interface:WorkflowItemServiceGet all workflow items for a particular collection.- Specified by:
findByCollectionin interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- The relevant DSpace Context.collection- the collection- Returns:
- array of the corresponding workflow items
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findByItem
public XmlWorkflowItem findByItem(Context context, Item item) throws SQLException
Description copied from interface:WorkflowItemServiceCheck to see if a particular item is currently under Workflow. If so, its WorkflowItem is returned. If not, null is returned- Specified by:
findByItemin interfaceWorkflowItemService<XmlWorkflowItem>- Parameters:
context- The relevant DSpace Context.item- the item- Returns:
- workflow item corresponding to the item, or null
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
update
public void update(Context context, XmlWorkflowItem workflowItem) throws SQLException, AuthorizeException
Description copied from interface:InProgressSubmissionServiceUpdate the submission, including the unarchived item.- Specified by:
updatein interfaceInProgressSubmissionService<XmlWorkflowItem>- Parameters:
context- contextworkflowItem- submission- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
deleteWrapper
public void deleteWrapper(Context context, XmlWorkflowItem workflowItem) throws SQLException, AuthorizeException
Description copied from interface:InProgressSubmissionServiceDeletes submission wrapper, doesn't delete item contents- Specified by:
deleteWrapperin interfaceInProgressSubmissionService<XmlWorkflowItem>- Parameters:
context- contextworkflowItem- submission- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
move
public void move(Context context, XmlWorkflowItem inProgressSubmission, Collection fromCollection, Collection toCollection)
- Specified by:
movein interfaceInProgressSubmissionService<XmlWorkflowItem>
-
-