|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.vc.VersionControlHelper
Provides access to the VersionControlService
Application Programming
Interface (API) via the static reference VersionControlHelper.service
and several helper methods. Only one of the helper methods makes server-side
access: isReviseAllowed(wt.vc.Versioned, boolean)
.
This API includes static methods to make new iterations/versions, find
the predecessor of an iteration/version, find all the iteration(s) of
a version, and get cookie information. These methods can be categorized
as locally and remotely invokeable. The local methods are getters of
information, typically from cookies, that are held in the client or server.
The remote methods serve as wrappers to services that promote server-side
functionality to clients.
Supported API: true
Extendable: false
Mastered
,
Iterated
,
Versioned
,
VersionControlService
,
Serialized FormField Summary | |
private static String |
CLASSNAME
|
private static boolean |
DEBUG
|
private static String |
DEFAULT_SERIES_NAME
|
static long |
EXTERNALIZATION_VERSION_UID
|
private static String |
FILE_BASED_SERIES
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
private static String |
RULE_CONSTANT_FOR_VERSIONING
|
(package private) static long |
serialVersionUID
|
static VersionControlService |
service
Supported API: true |
Constructor Summary | |
VersionControlHelper()
|
Method Summary | |
static Iterated |
assignIterationBranch(Iterated iteration,
long branchId,
boolean latest)
Assigns a branch id and latest flag on the given iterated object to the given branch id and latest flag. |
static Iterated |
assignIterationCreator(Iterated iteration,
WTPrincipalReference creator)
Assigns a creator on the given iterated object to the given principal. |
static IterationIdentifier |
firstIterationId(Iterated iteration)
For the given Iterated object, return the First IterationIdentifier for the series Supported API: true |
static Enumeration |
getBranchedVersionsFrom(Versioned version,
QueryResult versions)
Gets all of the branched versions from the given version within the given list containing all the found versions. |
static long |
getBranchIdentifier(Iterated iteration)
Gets the value of the iteration's branch id typed as it is returned from the POM's OID pool. |
static Enumeration |
getInlinedVersionsFrom(Versioned version,
QueryResult versions)
Gets all of the inlined (non-branched) versions from the given version within the given list containing all the found versions. |
static IterationIdentifier |
getIterationIdentifier(Iterated iteration)
Gets the series value of the iteration. |
static WTPrincipalReference |
getIterationModifier(Iterated iteration)
Gets the creator/updater (reference) of the iteration. |
static Iterated |
getLatestIteration(Iterated iteration)
Deprecated. |
static Iterated |
getLatestIteration(Iterated iteration,
boolean includeMarkedForDelete)
Gets the "latest" iteration in the same branch as the given one. |
static String |
getNote(Iterated iteration)
Gets the note explaining why the iteration was created. |
static OneOffVersionIdentifier |
getOneOffVersionIdentifier(OneOffVersioned version)
Gets the series value of the version. |
static SearchCondition |
getSearchCondition(Class target,
boolean latest)
Gets a SearchCondition to be appended to a query to find object(s) of the target class that are the "latest" iteration(s). |
static SearchCondition |
getSearchCondition(Class target,
long branchId)
Gets a SearchCondition to be appended to a query to find object(s) of the target class that are in a branch. |
static SearchCondition |
getSearchCondition(Class target,
Mastered master)
Gets a SearchCondition to be appended to a query to find object(s) of the target class that belong to the same master. |
static SearchCondition |
getSearchCondition(Class target,
WTCollection objects,
boolean notIntheBranch)
Gets a SearchCondition to be appended to a query to find object(s) of the target class that are in a branch. |
private static String |
getSeedType(Versioned version,
String seriesName)
|
private static WTKeyedMap |
getSeedType(WTKeyedMap versionToSeriesNameMap)
|
static Enumeration |
getThreadedVersionsFrom(Versioned version,
QueryResult versions)
Gets all of the threaded (inlined and branched) versions from the given version within the given list containing all the found versions. |
static WTPrincipalReference |
getVersionCreator(Iterated iteration)
Gets the creator (reference) of the version. |
static VersionIdentifier |
getVersionIdentifier(Versioned version)
Gets the series value of the version. |
static MultilevelSeries |
getVersionIdentifierSeries(Versioned version)
Internal API used to get the correct series type (using the rules service) when revising a version. |
protected static WTKeyedMap |
getVersionIdentifierSeries(WTCollection versions)
|
protected static MultilevelSeries |
getVersionIdentifierSeriesFromSeriesName(String seriesName)
Convenience API for getInitialVersionInfo and getVersionIdentifierSeries . |
static boolean |
hasPredecessor(Iterated iteration)
Tests if the given iteration has a predecessor. |
static void |
incrementIterationId(Iterated iteration)
For the given Iteration, Increment the IterationIdentifier of the Iteration. |
static void |
incrementVersionId(Versioned version)
For the given Iteration, Increment the VersionIdentifier of the Iteration. |
static boolean |
inSameBranch(Iterated iterationA,
Iterated iterationB)
Tests if two iterations are in the same version branch. |
static boolean |
isAOneOff(OneOffVersioned version)
Returns true if the given version is a one-off version. |
static boolean |
isLatestIteration(Iterated iteration)
Tests if the given iteration is the latest, or last one in the version branch. |
static boolean |
isNewAdHocStringVersionAllowed(AdHocStringVersioned version,
boolean viewBranch)
Returns true if version is not in work or a session iteration. |
protected static boolean |
isNewAdHocStringVersionAllowed(AdHocStringVersioned version,
boolean viewBranch,
boolean throwException)
|
static boolean |
isNewOneOffVersionAllowed(OneOffVersioned version,
boolean viewBranch)
Returns true if version is not a one-off, in work, or a session iteration. |
protected static boolean |
isNewOneOffVersionAllowed(OneOffVersioned version,
boolean viewBranch,
boolean throwException)
|
static boolean |
isNewVersionableAllowed(Versionable version,
boolean viewBranch)
Returns true if version is not in work or a session iteration. |
protected static boolean |
isNewVersionableAllowed(Versionable version,
boolean viewBranch,
boolean throwException)
|
static boolean |
isNewVersionCheckedOut(Versioned version)
This will check to see a if the new version has already been created and checked out, thus hiding from the DB uniquness constraint test. |
static boolean |
isReviseAllowed(Versioned version,
boolean viewBranch)
This method decides if a wt.vc.Versioned object can be revised. |
protected static boolean |
isReviseAllowed(Versioned version,
boolean viewBranch,
boolean throwException)
|
static VersionIdentifier |
newBranchVersionId(Versioned version)
Supported API: true |
static Mastered |
newMasterFor(Iterated iteration)
Constructs a new Mastered object for the given Iterated object using introspection to determine the appropriate master class for the iteration and reflection to invoke that master class's no-arg factory method. |
static IterationIdentifier |
nextIterationId(Iterated iteration)
For the given Iteration, answer the next IterationIdentifier in the series Supported API: true |
static VersionIdentifier |
nextVersionId(Versioned version)
For the given Iteration, answer the next VersionIdentifier in the series Supported API: true |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(VersionControlHelper thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
static void |
setIterationIdentifier(Iterated iteration,
IterationIdentifier identifier)
Sets the series value of the iteration. |
static void |
setIterationModifier(Iterated iteration,
WTPrincipalReference creator)
Sets the creator/updater of the iteration. |
static void |
setNote(Iterated iteration,
String note)
Sets the note explaining why the iteration was created. |
static void |
setOneOffVersionIdentifier(OneOffVersioned version,
OneOffVersionIdentifier identifier)
Sets the one-off identifier. |
static void |
setVersionIdentifier(Versioned version,
VersionIdentifier identifier)
Sets the series value of the version. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
public static final VersionControlService service
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private static boolean DEBUG
private static final String FILE_BASED_SERIES
private static String DEFAULT_SERIES_NAME
private static final String RULE_CONSTANT_FOR_VERSIONING
Constructor Detail |
public VersionControlHelper()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(VersionControlHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public static Iterated getLatestIteration(Iterated iteration, boolean includeMarkedForDelete) throws WTException, VersionControlException
iteration
- includeMarkedForDelete
-
WTException
VersionControlException
public static void setVersionIdentifier(Versioned version, VersionIdentifier identifier) throws WTException, VersionControlException, WTPropertyVetoException, SeriesIncrementInvalidException
version
- identifier
-
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
public static VersionIdentifier getVersionIdentifier(Versioned version) throws VersionControlException
version
-
VersionControlException
public static final void incrementVersionId(Versioned version) throws WTException, VersionControlException, WTPropertyVetoException, SeriesIncrementInvalidException
version
-
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
nextVersion
public static final VersionIdentifier nextVersionId(Versioned version) throws WTException, VersionControlException, WTPropertyVetoException, SeriesIncrementInvalidException
version
-
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
public static final VersionIdentifier newBranchVersionId(Versioned version) throws WTException, VersionControlException, WTPropertyVetoException
version
-
WTException
VersionControlException
WTPropertyVetoException
public static void setIterationIdentifier(Iterated iteration, IterationIdentifier identifier) throws WTException, VersionControlException, WTPropertyVetoException, SeriesIncrementInvalidException
iteration
- identifier
-
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
public static final IterationIdentifier firstIterationId(Iterated iteration) throws WTException, VersionControlException, WTPropertyVetoException
iteration
-
WTException
VersionControlException
WTPropertyVetoException
public static IterationIdentifier getIterationIdentifier(Iterated iteration) throws VersionControlException
iteration
-
VersionControlException
public static final void incrementIterationId(Iterated iteration) throws WTException, VersionControlException, WTPropertyVetoException, SeriesIncrementInvalidException
iteration
-
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
nextIteration
public static final IterationIdentifier nextIterationId(Iterated iteration) throws WTException, VersionControlException, WTPropertyVetoException, SeriesIncrementInvalidException
iteration
-
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
public static long getBranchIdentifier(Iterated iteration) throws VersionControlException
iteration
-
VersionControlException
public static void setIterationModifier(Iterated iteration, WTPrincipalReference creator) throws WTException, VersionControlException, WTPropertyVetoException
iteration
- creator
-
WTException
VersionControlException
WTPropertyVetoException
public static WTPrincipalReference getIterationModifier(Iterated iteration) throws VersionControlException, WTException
iteration
-
VersionControlException
WTException
public static WTPrincipalReference getVersionCreator(Iterated iteration) throws VersionControlException, WTException
iteration
-
VersionControlException
WTException
public static void setNote(Iterated iteration, String note) throws WTException, VersionControlException, WTPropertyVetoException
iteration
- note
-
WTException
VersionControlException
WTPropertyVetoException
public static String getNote(Iterated iteration) throws VersionControlException
iteration
-
VersionControlException
public static SearchCondition getSearchCondition(Class target, Mastered master) throws VersionControlException, QueryException
target
- master
-
VersionControlException
QueryException
public static SearchCondition getSearchCondition(Class target, long branchId) throws VersionControlException, QueryException
target
- branchId
-
VersionControlException
QueryException
public static SearchCondition getSearchCondition(Class target, boolean latest) throws VersionControlException, QueryException
For example, if the given boolean is false then all objects, except the latest iteration(s) will be returned. Otherwise, only the latest iteration(s) are returned.
target
- latest
-
VersionControlException
QueryException
public static Enumeration getInlinedVersionsFrom(Versioned version, QueryResult versions) throws VersionControlException
version
- versions
-
VersionControlException
public static Enumeration getBranchedVersionsFrom(Versioned version, QueryResult versions) throws VersionControlException
version
- versions
-
VersionControlException
public static Enumeration getThreadedVersionsFrom(Versioned version, QueryResult versions) throws VersionControlException
version
- versions
-
VersionControlException
public static Iterated getLatestIteration(Iterated iteration) throws WTException, VersionControlException
iteration
-
WTException
VersionControlException
public static boolean hasPredecessor(Iterated iteration)
iteration
-
public static boolean isLatestIteration(Iterated iteration)
iteration
-
public static boolean inSameBranch(Iterated iterationA, Iterated iterationB) throws VersionControlException
iterationA
- iterationB
-
VersionControlException
public static void setOneOffVersionIdentifier(OneOffVersioned version, OneOffVersionIdentifier identifier) throws WTException, VersionControlException, WTPropertyVetoException, SeriesIncrementInvalidException
version
- identifier
-
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
public static boolean isAOneOff(OneOffVersioned version)
version
-
public static OneOffVersionIdentifier getOneOffVersionIdentifier(OneOffVersioned version) throws VersionControlException
version
-
VersionControlException
public static Mastered newMasterFor(Iterated iteration) throws WTException
iteration
-
WTException
public static SearchCondition getSearchCondition(Class target, WTCollection objects, boolean notIntheBranch) throws VersionControlException, QueryException, WTException
target
- Target Classobjects
- Collection of Iterated objects for which the branch identifiers are used in the search condition.notIntheBranch
- Flag to represent NOT IN condition in the search condition.
VersionControlException
QueryException
WTException
public static boolean isNewVersionableAllowed(Versionable version, boolean viewBranch) throws WTException
WTException
protected static boolean isNewVersionableAllowed(Versionable version, boolean viewBranch, boolean throwException) throws WTException
WTException
public static boolean isReviseAllowed(Versioned version, boolean viewBranch) throws WTException
WTException
protected static boolean isReviseAllowed(Versioned version, boolean viewBranch, boolean throwException) throws WTException
WTException
public static boolean isNewOneOffVersionAllowed(OneOffVersioned version, boolean viewBranch) throws WTException
WTException
protected static boolean isNewOneOffVersionAllowed(OneOffVersioned version, boolean viewBranch, boolean throwException) throws WTException
WTException
public static boolean isNewAdHocStringVersionAllowed(AdHocStringVersioned version, boolean viewBranch) throws WTException
WTException
protected static boolean isNewAdHocStringVersionAllowed(AdHocStringVersioned version, boolean viewBranch, boolean throwException) throws WTException
WTException
public static Iterated assignIterationCreator(Iterated iteration, WTPrincipalReference creator) throws WTException, VersionControlException, WTPropertyVetoException
iteration
- creator
-
WTException
VersionControlException
WTPropertyVetoException
public static Iterated assignIterationBranch(Iterated iteration, long branchId, boolean latest) throws WTException, VersionControlException, WTPropertyVetoException
iteration
- branchId
- latest
-
WTException
VersionControlException
WTPropertyVetoException
public static boolean isNewVersionCheckedOut(Versioned version) throws WTException
WTException
public static MultilevelSeries getVersionIdentifierSeries(Versioned version) throws VersionControlException
VersionControlException
protected static MultilevelSeries getVersionIdentifierSeriesFromSeriesName(String seriesName) throws VersionControlException
getInitialVersionInfo
and getVersionIdentifierSeries
.
VersionControlException
private static String getSeedType(Versioned version, String seriesName) throws VersionControlException
VersionControlException
protected static WTKeyedMap getVersionIdentifierSeries(WTCollection versions) throws VersionControlException
VersionControlException
private static WTKeyedMap getSeedType(WTKeyedMap versionToSeriesNameMap) throws VersionControlException
VersionControlException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |