Package org.dspace.versioning
Class VersionHistoryServiceImpl
java.lang.Object
org.dspace.versioning.VersionHistoryServiceImpl
- All Implemented Interfaces:
DSpaceCRUDService<VersionHistory>,VersionHistoryService
- 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Context context, VersionHistory versionHistory, Version version) booleancanSeeDraftVersion(Context context, VersionHistory versionHistory) This method has a scope to verify if the logged user has permission to see the attribute 'draftVersion' of the latest version.voiddelete(Context context, VersionHistory versionHistory) findByItem(Context context, Item item) getFirstVersion(Context context, VersionHistory versionHistory) getLatestVersion(Context context, VersionHistory versionHistory) getNext(Context c, VersionHistory versionHistory, Version version) getPrevious(Context context, VersionHistory versionHistory, Version version) getVersion(Context context, VersionHistory versionHistory, Item item) booleanhasNext(Context context, VersionHistory versionHistory, Item item) booleanhasNext(Context context, VersionHistory versionHistory, Version version) booleanhasVersionHistory(Context context, Item item) booleanisFirstVersion(Context context, Item item) booleanisFirstVersion(Context context, VersionHistory versionHistory, Version version) booleanisLastVersion(Context context, Item item) booleanisLastVersion(Context context, VersionHistory versionHistory, Version version) voidremove(VersionHistory versionHistory, Version version) voidupdate(Context context, List<VersionHistory> versionHistories) Persist a collection of model objects.voidupdate(Context context, VersionHistory versionHistory) Persist a model object.
-
Field Details
-
versionHistoryDAO
-
-
Constructor Details
-
VersionHistoryServiceImpl
protected VersionHistoryServiceImpl()
-
-
Method Details
-
create
- Specified by:
createin interfaceDSpaceCRUDService<VersionHistory>- Throws:
SQLException
-
find
- Specified by:
findin interfaceDSpaceCRUDService<VersionHistory>- Throws:
SQLException
-
update
public void update(Context context, VersionHistory versionHistory) throws SQLException, AuthorizeException Description copied from interface:DSpaceCRUDServicePersist a model object.- Specified by:
updatein interfaceDSpaceCRUDService<VersionHistory>versionHistory- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
update
public void update(Context context, List<VersionHistory> versionHistories) throws SQLException, AuthorizeException Description copied from interface:DSpaceCRUDServicePersist a collection of model objects.- Specified by:
updatein interfaceDSpaceCRUDService<VersionHistory>versionHistories- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
delete
public void delete(Context context, VersionHistory versionHistory) throws SQLException, AuthorizeException - Specified by:
deletein interfaceDSpaceCRUDService<VersionHistory>- Throws:
SQLExceptionAuthorizeException
-
getPrevious
public Version getPrevious(Context context, VersionHistory versionHistory, Version version) throws SQLException - Specified by:
getPreviousin interfaceVersionHistoryService- Throws:
SQLException
-
getNext
public Version getNext(Context c, VersionHistory versionHistory, Version version) throws SQLException - Specified by:
getNextin interfaceVersionHistoryService- Throws:
SQLException
-
getVersion
public Version getVersion(Context context, VersionHistory versionHistory, Item item) throws SQLException - Specified by:
getVersionin interfaceVersionHistoryService- Throws:
SQLException
-
hasNext
public boolean hasNext(Context context, VersionHistory versionHistory, Item item) throws SQLException - Specified by:
hasNextin interfaceVersionHistoryService- Throws:
SQLException
-
hasNext
public boolean hasNext(Context context, VersionHistory versionHistory, Version version) throws SQLException - Specified by:
hasNextin interfaceVersionHistoryService- Throws:
SQLException
-
hasVersionHistory
- Specified by:
hasVersionHistoryin interfaceVersionHistoryService- Throws:
SQLException
-
add
public void add(Context context, VersionHistory versionHistory, Version version) throws SQLException - Specified by:
addin interfaceVersionHistoryService- Throws:
SQLException
-
getLatestVersion
- Specified by:
getLatestVersionin interfaceVersionHistoryService- Throws:
SQLException
-
getFirstVersion
- Specified by:
getFirstVersionin interfaceVersionHistoryService- Throws:
SQLException
-
isFirstVersion
- Specified by:
isFirstVersionin interfaceVersionHistoryService- Throws:
SQLException
-
isFirstVersion
public boolean isFirstVersion(Context context, VersionHistory versionHistory, Version version) throws SQLException - Specified by:
isFirstVersionin interfaceVersionHistoryService- Throws:
SQLException
-
isLastVersion
- Specified by:
isLastVersionin interfaceVersionHistoryService- Throws:
SQLException
-
isLastVersion
public boolean isLastVersion(Context context, VersionHistory versionHistory, Version version) throws SQLException - Specified by:
isLastVersionin interfaceVersionHistoryService- Throws:
SQLException
-
remove
- Specified by:
removein interfaceVersionHistoryService
-
findByItem
- Specified by:
findByItemin interfaceVersionHistoryService- Throws:
SQLException
-
canSeeDraftVersion
public boolean canSeeDraftVersion(Context context, VersionHistory versionHistory) throws SQLException Description copied from interface:VersionHistoryServiceThis method has a scope to verify if the logged user has permission to see the attribute 'draftVersion' of the latest version.- Specified by:
canSeeDraftVersionin interfaceVersionHistoryService- Parameters:
context- DSpace context objectversionHistory- Version history object- Returns:
- return true if the logged user has permission to see the attribute 'draftVersion' of the latest version, otherwise false
- Throws:
SQLException- If database error
-