public class VersionUtil extends Object
| Constructor and Description |
|---|
VersionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String[] |
addItemIdentifier(Item item,
Version version)
Retrieve an array of string where in first position there is the path
builded from the dc.identifier (e.g.
|
static Version |
checkLatestVersion(Context context,
Item item)
Return the latest version, if there isn't or the user not have permission
then return null.
|
static String |
getSummary(Context context,
String stringVersionID)
Retrieve the summary for the version
|
static boolean |
hasVersionHistory(Context context,
Item item)
Check if the item have a version history
|
static boolean |
isItemInSubmission(Context context,
Item item)
Check item if it is in workspace or workflow
|
static boolean |
isLatest(Context context,
Item item)
Check if the item is the last version builded
|
static Integer |
processCreateNewVersion(Context context,
int itemID,
String summary)
Create a new version of the specified item, otherwise return null
|
static Integer |
processDeleteVersions(Context context,
int itemId,
String[] versionIDs)
Delete version(s)
|
static void |
processRestoreVersion(Context context,
int versionID,
String summary)
Restore a version
|
static void |
processUpdateVersion(Context context,
int itemID,
String summary)
Modify latest version
|
static VersionHistory |
retrieveVersionHistory(Context context,
Item item)
Retrieve the version history of the item
|
public static Integer processCreateNewVersion(Context context, int itemID, String summary) throws SQLException, AuthorizeException, IOException
context - The DSpace contextitemID - The id of the to-be-versioned itemsummary - The motif of the versioningSQLExceptionAuthorizeExceptionIOExceptionpublic static void processUpdateVersion(Context context, int itemID, String summary) throws SQLException, AuthorizeException, IOException
context - The DSpace contextitemID - The id of the to-be-versioned itemsummary - The motif of the versioningSQLExceptionAuthorizeExceptionIOExceptionpublic static void processRestoreVersion(Context context, int versionID, String summary) throws SQLException, AuthorizeException, IOException
versionID - id of the version to restorecontext - The DSpace contextsummary - SQLExceptionAuthorizeExceptionIOExceptionpublic static Integer processDeleteVersions(Context context, int itemId, String[] versionIDs) throws SQLException, AuthorizeException, IOException
context - The DSpace contextversionIDs - list of versionIDs to deleteitemId - SQLExceptionAuthorizeExceptionIOExceptionpublic static boolean isLatest(Context context, Item item)
context - item - public static boolean hasVersionHistory(Context context, Item item)
context - item - public static Version checkLatestVersion(Context context, Item item) throws SQLException
context - item - SQLExceptionpublic static VersionHistory retrieveVersionHistory(Context context, Item item)
context - item - public static boolean isItemInSubmission(Context context, Item item) throws SQLException
context - item - SQLExceptionpublic static String[] addItemIdentifier(Item item, Version version)
item - version - Copyright © 2016 DuraSpace. All Rights Reserved.