Package org.dspace.versioning
Class VersioningServiceImpl
- java.lang.Object
-
- org.dspace.versioning.VersioningServiceImpl
-
- All Implemented Interfaces:
VersioningService
public class VersioningServiceImpl extends Object implements VersioningService
- Author:
- Fabio Bolognesi (fabio at atmire dot com), Mark Diggory (markd at atmire dot com), Ben Bosman (ben at atmire dot com), Pascal-Nicolas Becker (dspace at pascal dash becker dot de)
-
-
Field Summary
Fields Modifier and Type Field Description protected VersionDAOversionDAOprotected WorkflowItemServiceworkflowItemService
-
Constructor Summary
Constructors Modifier Constructor Description protectedVersioningServiceImpl()
-
Method Summary
-
-
-
Field Detail
-
versionDAO
@Autowired(required=true) protected VersionDAO versionDAO
-
workflowItemService
@Autowired(required=true) protected WorkflowItemService workflowItemService
-
-
Method Detail
-
setProvider
public void setProvider(DefaultItemVersionProvider provider)
-
createNewVersion
public Version createNewVersion(Context c, Item item)
Service Methods- Specified by:
createNewVersionin interfaceVersioningService
-
createNewVersion
public Version createNewVersion(Context c, Item item, String summary)
- Specified by:
createNewVersionin interfaceVersioningService
-
removeVersion
public void removeVersion(Context c, Version version) throws SQLException
- Specified by:
removeVersionin interfaceVersioningService- Throws:
SQLException
-
removeVersion
public void removeVersion(Context c, Item item) throws SQLException
- Specified by:
removeVersionin interfaceVersioningService- Throws:
SQLException
-
getVersion
public Version getVersion(Context c, int versionID) throws SQLException
- Specified by:
getVersionin interfaceVersioningService- Throws:
SQLException
-
restoreVersion
public Version restoreVersion(Context c, Version version)
- Specified by:
restoreVersionin interfaceVersioningService
-
restoreVersion
public Version restoreVersion(Context c, Version version, String summary)
- Specified by:
restoreVersionin interfaceVersioningService
-
updateVersion
public Version updateVersion(Context c, Item item, String summary) throws SQLException
- Specified by:
updateVersionin interfaceVersioningService- Throws:
SQLException
-
getVersion
public Version getVersion(Context c, Item item) throws SQLException
- Specified by:
getVersionin interfaceVersioningService- Throws:
SQLException
-
createNewVersion
public Version createNewVersion(Context context, VersionHistory history, Item item, String summary, Date date, int versionNumber)
- Specified by:
createNewVersionin interfaceVersioningService
-
getVersionsByHistory
public List<Version> getVersionsByHistory(Context c, VersionHistory vh) throws SQLException
Description copied from interface:VersioningServiceReturns all versions of a version history. To keep version numbers stable we do not delete versions, we do only set the item, date, summary and eperson null. This methods returns only those versions that have an item assigned.- Specified by:
getVersionsByHistoryin interfaceVersioningService- Parameters:
c- The relevant DSpace Context.vh- version history- Returns:
- All versions of a version history that have an item assigned.
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
createVersion
protected Version createVersion(Context c, VersionHistory vh, Item item, String summary, Date date) throws SQLException
- Throws:
SQLException
-
getNextVersionNumer
protected int getNextVersionNumer(Context c, VersionHistory vh) throws SQLException
- Throws:
SQLException
-
-