public class VersionUtil
extends java.lang.Object
| Constructor and Description |
|---|
VersionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.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 java.lang.String |
getSummary(Context context,
java.lang.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 java.lang.Integer |
processCreateNewVersion(Context context,
int itemID,
java.lang.String summary)
Create a new version of the specified item, otherwise return null
|
static java.lang.Integer |
processDeleteVersions(Context context,
int itemId,
java.lang.String[] versionIDs)
Delete version(s)
|
static void |
processRestoreVersion(Context context,
int versionID,
java.lang.String summary)
Restore a version
|
static void |
processUpdateVersion(Context context,
int itemID,
java.lang.String summary)
Modify latest version
|
static VersionHistory |
retrieveVersionHistory(Context context,
Item item)
Retrieve the version history of the item
|
public static java.lang.Integer processCreateNewVersion(Context context, int itemID, java.lang.String summary) throws java.sql.SQLException, AuthorizeException, java.io.IOException
context - The DSpace contextitemID - The id of the to-be-versioned itemsummary - The motif of the versioningjava.sql.SQLExceptionAuthorizeExceptionjava.io.IOExceptionpublic static void processUpdateVersion(Context context, int itemID, java.lang.String summary) throws java.sql.SQLException, AuthorizeException, java.io.IOException
context - The DSpace contextitemID - The id of the to-be-versioned itemsummary - The motif of the versioningjava.sql.SQLExceptionAuthorizeExceptionjava.io.IOExceptionpublic static void processRestoreVersion(Context context, int versionID, java.lang.String summary) throws java.sql.SQLException, AuthorizeException, java.io.IOException
versionID - id of the version to restorecontext - The DSpace contextsummary - java.sql.SQLExceptionAuthorizeExceptionjava.io.IOExceptionpublic static java.lang.Integer processDeleteVersions(Context context, int itemId, java.lang.String[] versionIDs) throws java.sql.SQLException, AuthorizeException, java.io.IOException
context - The DSpace contextversionIDs - list of versionIDs to deleteitemId - java.sql.SQLExceptionAuthorizeExceptionjava.io.IOExceptionpublic 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 java.sql.SQLException
context - item - java.sql.SQLExceptionpublic static VersionHistory retrieveVersionHistory(Context context, Item item)
context - item - public static boolean isItemInSubmission(Context context, Item item) throws java.sql.SQLException
context - item - java.sql.SQLExceptionpublic static java.lang.String[] addItemIdentifier(Item item, Version version)
item - version - public static java.lang.String getSummary(Context context, java.lang.String stringVersionID)
context - stringVersionID - Copyright © 2018 DuraSpace. All Rights Reserved.