Class DefaultItemVersionProvider

java.lang.Object
org.dspace.versioning.AbstractVersionProvider
org.dspace.versioning.DefaultItemVersionProvider
All Implemented Interfaces:
ItemVersionProvider

public class DefaultItemVersionProvider extends AbstractVersionProvider implements ItemVersionProvider
Author:
Fabio Bolognesi (fabio at atmire dot com), Mark Diggory (markd at atmire dot com), Ben Bosman (ben at atmire dot com)
  • Field Details

    • workspaceItemService

      @Autowired(required=true) protected WorkspaceItemService workspaceItemService
    • workflowItemService

      @Autowired(required=true) protected WorkflowItemService workflowItemService
    • versionHistoryService

      @Autowired(required=true) protected VersionHistoryService versionHistoryService
    • versioningService

      @Autowired(required=true) protected VersioningService versioningService
    • identifierService

      @Autowired(required=true) protected IdentifierService identifierService
    • relationshipService

      @Autowired(required=true) protected RelationshipService relationshipService
  • Constructor Details

    • DefaultItemVersionProvider

      public DefaultItemVersionProvider()
  • Method Details

    • createNewItemAndAddItInWorkspace

      public Item createNewItemAndAddItInWorkspace(Context context, Item nativeItem)
      Specified by:
      createNewItemAndAddItInWorkspace in interface ItemVersionProvider
    • deleteVersionedItem

      public void deleteVersionedItem(Context c, Version versionToDelete, VersionHistory history) throws SQLException
      Specified by:
      deleteVersionedItem in interface ItemVersionProvider
      Throws:
      SQLException
    • updateItemState

      public Item updateItemState(Context c, Item itemNew, Item previousItem)
      Copy all data (minus a few exceptions) from the old item to the new item.
      Specified by:
      updateItemState in interface ItemVersionProvider
      Parameters:
      c - the DSpace context.
      itemNew - the new version of the item.
      previousItem - the old version of the item.
      Returns:
      the new version of the item, with data from the old item.
    • copyRelationships

      protected void copyRelationships(Context context, Item newItem, Item oldItem) throws SQLException, AuthorizeException
      Copy all relationships of the old item to the new item. At this point in the lifecycle of the item-version (before archival), only the opposite item receives "latest" status. On item archival of the item-version, the "latest" status of the relevant relationships will be updated.
      Parameters:
      context - the DSpace context.
      newItem - the new version of the item.
      oldItem - the old version of the item.
      Throws:
      SQLException
      AuthorizeException