Package org.dspace.versioning
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 Summary
Fields Modifier and Type Field Description protected IdentifierServiceidentifierServiceprotected RelationshipServicerelationshipServiceprotected VersionHistoryServiceversionHistoryServiceprotected VersioningServiceversioningServiceprotected WorkflowItemServiceworkflowItemServiceprotected WorkspaceItemServiceworkspaceItemService-
Fields inherited from class org.dspace.versioning.AbstractVersionProvider
authorizeService, bitstreamService, bitstreamStorageService, bundleService, itemService
-
-
Constructor Summary
Constructors Constructor Description DefaultItemVersionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopyRelationships(Context context, Item newItem, Item oldItem)Copy all relationships of the old item to the new item.ItemcreateNewItemAndAddItInWorkspace(Context context, Item nativeItem)voiddeleteVersionedItem(Context c, Version versionToDelete, VersionHistory history)ItemupdateItemState(Context c, Item itemNew, Item previousItem)Copy all data (minus a few exceptions) from the old item to the new item.-
Methods inherited from class org.dspace.versioning.AbstractVersionProvider
copyMetadata, createBundlesAndAddBitstreams, getIgnoredMetadataFields, setIgnoredMetadataFields
-
-
-
-
Field Detail
-
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
-
-
Method Detail
-
createNewItemAndAddItInWorkspace
public Item createNewItemAndAddItInWorkspace(Context context, Item nativeItem)
- Specified by:
createNewItemAndAddItInWorkspacein interfaceItemVersionProvider
-
deleteVersionedItem
public void deleteVersionedItem(Context c, Version versionToDelete, VersionHistory history) throws SQLException
- Specified by:
deleteVersionedItemin interfaceItemVersionProvider- 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:
updateItemStatein interfaceItemVersionProvider- 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:
SQLExceptionAuthorizeException
-
-