Interface WorkspaceItemService

All Superinterfaces:
InProgressSubmissionService<WorkspaceItem>
All Known Implementing Classes:
WorkspaceItemServiceImpl

public interface WorkspaceItemService extends InProgressSubmissionService<WorkspaceItem>
Service interface class for the WorkspaceItem object. The implementation of this class is responsible for all business logic calls for the WorkspaceItem object and is autowired by spring
Author:
kevinvandevelde at atmire.com
  • Method Details

    • find

      WorkspaceItem find(Context context, int id) throws SQLException
      Get a workspace item from the database. The item, collection and submitter are loaded into memory.
      Parameters:
      context - DSpace context object
      id - ID of the workspace item
      Returns:
      the workspace item, or null if the ID is invalid.
      Throws:
      SQLException - if database error
    • create

      WorkspaceItem create(Context context, Collection collection, boolean template) throws AuthorizeException, SQLException
      Create a new workspace item, with a new ID. An Item is also created. The submitter is the current user in the context.
      Parameters:
      context - DSpace context object
      collection - Collection being submitted to
      template - if true, the workspace item starts as a copy of the collection's template item
      Returns:
      the newly created workspace item
      Throws:
      SQLException - if database error
      AuthorizeException - if authorization error
    • create

      WorkspaceItem create(Context context, Collection collection, boolean template, boolean isNewVersion) throws AuthorizeException, SQLException
      Create a new workspace item, with a new ID. An Item is also created. The submitter is the current user in the context.
      Parameters:
      context - DSpace context object
      collection - Collection being submitted to
      template - if true, the workspace item starts as a copy of the collection's template item
      isNewVersion - whether we are creating a new workspace item version of an existing item
      Returns:
      the newly created workspace item
      Throws:
      SQLException - if database error
      AuthorizeException - if authorization error
    • create

      WorkspaceItem create(Context context, Collection collection, UUID uuid, boolean template, boolean isNewVersion) throws AuthorizeException, SQLException
      Create a new workspace item, with a new ID. An Item is also created. The submitter is the current user in the context.
      Parameters:
      context - DSpace context object
      collection - Collection being submitted to
      uuid - the preferred uuid of the new item (used if restoring an item and retaining old uuid)
      template - if true, the workspace item starts as a copy of the collection's template item
      isNewVersion - whether we are creating a new workspace item version of an existing item
      Returns:
      the newly created workspace item
      Throws:
      SQLException - if database error
      AuthorizeException - if authorization error
    • create

      Throws:
      SQLException
      AuthorizeException
    • findByEPerson

      List<WorkspaceItem> findByEPerson(Context context, EPerson ep) throws SQLException
      Get 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.
      Parameters:
      context - the context object
      ep - the eperson
      Returns:
      the corresponding workspace items
      Throws:
      SQLException - if database error
    • findByEPerson

      List<WorkspaceItem> findByEPerson(Context context, EPerson ep, Integer limit, Integer offset) throws SQLException
      Get 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.
      Parameters:
      context - the context object
      ep - the eperson
      limit - the max number of workspaceitems to return
      offset - the offset
      Returns:
      the corresponding workspace items
      Throws:
      SQLException - if database error
    • findByCollection

      List<WorkspaceItem> findByCollection(Context context, Collection collection) throws SQLException
      Get all workspace items for a particular collection.
      Parameters:
      context - the context object
      collection - the collection
      Returns:
      the corresponding workspace items
      Throws:
      SQLException - if database error
    • findByItem

      WorkspaceItem findByItem(Context context, Item item) throws SQLException
      Check 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
      Parameters:
      context - the context object
      item - the item
      Returns:
      workflow item corresponding to the item, or null
      Throws:
      SQLException - if database error
    • findAll

      List<WorkspaceItem> findAll(Context context) throws SQLException
      Get all workspace items in the whole system
      Parameters:
      context - the context object
      Returns:
      all workspace items
      Throws:
      SQLException - if database error
    • findAll

      List<WorkspaceItem> findAll(Context context, Integer limit, Integer offset) throws SQLException
      Get all workspace items in the whole system, paginated.
      Parameters:
      context - the context object
      limit - limit
      offset - offset
      Returns:
      a page of workspace items
      Throws:
      SQLException - if database error
    • deleteAll

      void deleteAll(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException, IOException
      Delete the workspace item. The entry in workspaceitem, the unarchived item and its contents are all removed (multiple inclusion notwithstanding.)
      Parameters:
      context - context
      workspaceItem - workspace item
      Throws:
      IOException - if IO error
      SQLException - if database error
      AuthorizeException - if authorization error
    • countTotal

      int countTotal(Context context) throws SQLException
      Throws:
      SQLException
    • getStageReachedCounts

      List<Map.Entry<Integer,Long>> getStageReachedCounts(Context context) throws SQLException
      The map entry returned contains stage reached as the key and count of items in that stage as a value
      Parameters:
      context - The relevant DSpace Context.
      Returns:
      the map
      Throws:
      SQLException - if database error
    • countByEPerson

      int countByEPerson(Context context, EPerson ep) throws SQLException
      Throws:
      SQLException