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
FieldsModifier and TypeFieldDescriptionprotected IdentifierServiceprotected RelationshipServiceprotected VersionHistoryServiceprotected VersioningServiceprotected WorkflowItemServiceprotected WorkspaceItemServiceFields inherited from class org.dspace.versioning.AbstractVersionProvider
authorizeService, bitstreamService, bitstreamStorageService, bundleService, itemService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyRelationships(Context context, Item newItem, Item oldItem) Copy all relationships of the old item to the new item.createNewItemAndAddItInWorkspace(Context context, Item nativeItem) voiddeleteVersionedItem(Context c, Version versionToDelete, VersionHistory history) updateItemState(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 Details
-
workspaceItemService
-
workflowItemService
-
versionHistoryService
-
versioningService
-
identifierService
-
relationshipService
-
-
Constructor Details
-
DefaultItemVersionProvider
public DefaultItemVersionProvider()
-
-
Method Details
-
createNewItemAndAddItInWorkspace
- Specified by:
createNewItemAndAddItInWorkspacein interfaceItemVersionProvider
-
deleteVersionedItem
public void deleteVersionedItem(Context c, Version versionToDelete, VersionHistory history) throws SQLException - Specified by:
deleteVersionedItemin interfaceItemVersionProvider- Throws:
SQLException
-
updateItemState
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
-