wt.vc
Class VersionControlHelper

java.lang.Object
  extended bywt.vc.VersionControlHelper
All Implemented Interfaces:
Externalizable, Serializable

public final class VersionControlHelper
extends Object
implements Externalizable

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

See Also:
Mastered, Iterated, Versioned, VersionControlService, Serialized Form

Field 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

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

service

public static final VersionControlService service


Supported API: true


serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

DEBUG

private static boolean DEBUG

FILE_BASED_SERIES

private static final String FILE_BASED_SERIES
See Also:
Constant Field Values

DEFAULT_SERIES_NAME

private static String DEFAULT_SERIES_NAME

RULE_CONSTANT_FOR_VERSIONING

private static final String RULE_CONSTANT_FOR_VERSIONING
See Also:
Constant Field Values
Constructor Detail

VersionControlHelper

public VersionControlHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(VersionControlHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getLatestIteration

public static Iterated getLatestIteration(Iterated iteration,
                                          boolean includeMarkedForDelete)
                                   throws WTException,
                                          VersionControlException
Gets the "latest" iteration in the same branch as the given one. A check to see if the given iteration is the latest one is not made since it could be stale. Passing true for includeMarkedForDelete will attempt getting the latest iteratation even if marked for delete.

Supported API: true

Parameters:
iteration -
includeMarkedForDelete -
Returns:
Iterated
Throws:
WTException
VersionControlException

setVersionIdentifier

public static void setVersionIdentifier(Versioned version,
                                        VersionIdentifier identifier)
                                 throws WTException,
                                        VersionControlException,
                                        WTPropertyVetoException,
                                        SeriesIncrementInvalidException
Sets the series value of the version.

Supported API: true

Parameters:
version -
identifier -
Throws:
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException

getVersionIdentifier

public static VersionIdentifier getVersionIdentifier(Versioned version)
                                              throws VersionControlException
Gets the series value of the version.

Supported API: true

Parameters:
version -
Returns:
VersionIdentifier
Throws:
VersionControlException

incrementVersionId

public static final void incrementVersionId(Versioned version)
                                     throws WTException,
                                            VersionControlException,
                                            WTPropertyVetoException,
                                            SeriesIncrementInvalidException
For the given Iteration, Increment the VersionIdentifier of the Iteration. This will set the VersionIdentifier with the new value.

Supported API: true

Parameters:
version -
Throws:
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
See Also:
nextVersion

nextVersionId

public static final VersionIdentifier nextVersionId(Versioned version)
                                             throws WTException,
                                                    VersionControlException,
                                                    WTPropertyVetoException,
                                                    SeriesIncrementInvalidException
For the given Iteration, answer the next VersionIdentifier in the series

Supported API: true

Parameters:
version -
Returns:
VersionIdentifier
Throws:
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException

newBranchVersionId

public static final VersionIdentifier newBranchVersionId(Versioned version)
                                                  throws WTException,
                                                         VersionControlException,
                                                         WTPropertyVetoException


Supported API: true

Parameters:
version -
Returns:
VersionIdentifier
Throws:
WTException
VersionControlException
WTPropertyVetoException

setIterationIdentifier

public static void setIterationIdentifier(Iterated iteration,
                                          IterationIdentifier identifier)
                                   throws WTException,
                                          VersionControlException,
                                          WTPropertyVetoException,
                                          SeriesIncrementInvalidException
Sets the series value of the iteration.

Supported API: true

Parameters:
iteration -
identifier -
Throws:
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException

firstIterationId

public static final IterationIdentifier firstIterationId(Iterated iteration)
                                                  throws WTException,
                                                         VersionControlException,
                                                         WTPropertyVetoException
For the given Iterated object, return the First IterationIdentifier for the series

Supported API: true

Parameters:
iteration -
Returns:
IterationIdentifier
Throws:
WTException
VersionControlException
WTPropertyVetoException

getIterationIdentifier

public static IterationIdentifier getIterationIdentifier(Iterated iteration)
                                                  throws VersionControlException
Gets the series value of the iteration.

Supported API: true

Parameters:
iteration -
Returns:
IterationIdentifier
Throws:
VersionControlException

incrementIterationId

public static final void incrementIterationId(Iterated iteration)
                                       throws WTException,
                                              VersionControlException,
                                              WTPropertyVetoException,
                                              SeriesIncrementInvalidException
For the given Iteration, Increment the IterationIdentifier of the Iteration. This will set the IterationIdentifier with the new value.

Supported API: true

Parameters:
iteration -
Throws:
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException
See Also:
nextIteration

nextIterationId

public static final IterationIdentifier nextIterationId(Iterated iteration)
                                                 throws WTException,
                                                        VersionControlException,
                                                        WTPropertyVetoException,
                                                        SeriesIncrementInvalidException
For the given Iteration, answer the next IterationIdentifier in the series

Supported API: true

Parameters:
iteration -
Returns:
IterationIdentifier
Throws:
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException

getBranchIdentifier

public static long getBranchIdentifier(Iterated iteration)
                                throws VersionControlException
Gets the value of the iteration's branch id typed as it is returned from the POM's OID pool.

Supported API: true

Parameters:
iteration -
Returns:
long
Throws:
VersionControlException

setIterationModifier

public static void setIterationModifier(Iterated iteration,
                                        WTPrincipalReference creator)
                                 throws WTException,
                                        VersionControlException,
                                        WTPropertyVetoException
Sets the creator/updater of the iteration.

Supported API: true

Parameters:
iteration -
creator -
Throws:
WTException
VersionControlException
WTPropertyVetoException

getIterationModifier

public static WTPrincipalReference getIterationModifier(Iterated iteration)
                                                 throws VersionControlException,
                                                        WTException
Gets the creator/updater (reference) of the iteration.

Supported API: true

Parameters:
iteration -
Returns:
WTPrincipalReference
Throws:
VersionControlException
WTException

getVersionCreator

public static WTPrincipalReference getVersionCreator(Iterated iteration)
                                              throws VersionControlException,
                                                     WTException
Gets the creator (reference) of the version. This is the creator/updater of the very first iteration in the branch. This will query the database if the given iteration is not the first one in a branch.

Supported API: true

Parameters:
iteration -
Returns:
WTPrincipalReference
Throws:
VersionControlException
WTException

setNote

public static void setNote(Iterated iteration,
                           String note)
                    throws WTException,
                           VersionControlException,
                           WTPropertyVetoException
Sets the note explaining why the iteration was created.

Supported API: true

Parameters:
iteration -
note -
Throws:
WTException
VersionControlException
WTPropertyVetoException

getNote

public static String getNote(Iterated iteration)
                      throws VersionControlException
Gets the note explaining why the iteration was created.

Supported API: true

Parameters:
iteration -
Returns:
String
Throws:
VersionControlException

getSearchCondition

public static SearchCondition getSearchCondition(Class target,
                                                 Mastered master)
                                          throws VersionControlException,
                                                 QueryException
Gets a SearchCondition to be appended to a query to find object(s) of the target class that belong to the same master.

Supported API: true

Parameters:
target -
master -
Returns:
SearchCondition
Throws:
VersionControlException
QueryException

getSearchCondition

public static SearchCondition getSearchCondition(Class target,
                                                 long branchId)
                                          throws VersionControlException,
                                                 QueryException
Gets a SearchCondition to be appended to a query to find object(s) of the target class that are in a branch. Since the branch identifier is guaranteed to be unique within the system this criteria effectively will find all objects in the branch.

Supported API: true

Parameters:
target -
branchId -
Returns:
SearchCondition
Throws:
VersionControlException
QueryException

getSearchCondition

public static SearchCondition getSearchCondition(Class target,
                                                 boolean latest)
                                          throws VersionControlException,
                                                 QueryException
Gets a SearchCondition to be appended to a query to find object(s) of the target class that are the "latest" iteration(s).

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.



Supported API: true

Parameters:
target -
latest -
Returns:
SearchCondition
Throws:
VersionControlException
QueryException

getInlinedVersionsFrom

public static Enumeration getInlinedVersionsFrom(Versioned version,
                                                 QueryResult versions)
                                          throws VersionControlException
Gets all of the inlined (non-branched) versions from the given version within the given list containing all the found versions. The result is an ordered list of versions from the given one to the first one created.

Supported API: false

Parameters:
version -
versions -
Returns:
Enumeration
Throws:
VersionControlException

getBranchedVersionsFrom

public static Enumeration getBranchedVersionsFrom(Versioned version,
                                                  QueryResult versions)
                                           throws VersionControlException
Gets all of the branched versions from the given version within the given list containing all the found versions. The result is an ordered list of versions from the given one to the first one created.

Supported API: false

Parameters:
version -
versions -
Returns:
Enumeration
Throws:
VersionControlException

getThreadedVersionsFrom

public static Enumeration getThreadedVersionsFrom(Versioned version,
                                                  QueryResult versions)
                                           throws VersionControlException
Gets all of the threaded (inlined and branched) versions from the given version within the given list containing all the found versions. The result is an ordered list of versions from the given one to the first one created.

Supported API: false

Parameters:
version -
versions -
Returns:
Enumeration
Throws:
VersionControlException

getLatestIteration

public static Iterated getLatestIteration(Iterated iteration)
                                   throws WTException,
                                          VersionControlException
Deprecated.  

Gets the "latest" iteration in the same branch as the given one. A check to see if the given iteration is the latest one is not made since it could be stale.

Supported API: false

Parameters:
iteration -
Returns:
Iterated
Throws:
WTException
VersionControlException

hasPredecessor

public static boolean hasPredecessor(Iterated iteration)
Tests if the given iteration has a predecessor.

Supported API: true

Parameters:
iteration -
Returns:
boolean

isLatestIteration

public static boolean isLatestIteration(Iterated iteration)
Tests if the given iteration is the latest, or last one in the version branch.

Supported API: true

Parameters:
iteration -
Returns:
boolean

inSameBranch

public static boolean inSameBranch(Iterated iterationA,
                                   Iterated iterationB)
                            throws VersionControlException
Tests if two iterations are in the same version branch.

Supported API: false

Parameters:
iterationA -
iterationB -
Returns:
boolean
Throws:
VersionControlException

setOneOffVersionIdentifier

public static void setOneOffVersionIdentifier(OneOffVersioned version,
                                              OneOffVersionIdentifier identifier)
                                       throws WTException,
                                              VersionControlException,
                                              WTPropertyVetoException,
                                              SeriesIncrementInvalidException
Sets the one-off identifier. Note: this API should (almost) never be called. You should not be calling it. Please consult the package owner before using this API in any of your code.

Supported API: false

Parameters:
version -
identifier -
Throws:
WTException
VersionControlException
WTPropertyVetoException
SeriesIncrementInvalidException

isAOneOff

public static boolean isAOneOff(OneOffVersioned version)
Returns true if the given version is a one-off version.

Supported API: true

Parameters:
version -
Returns:
boolean

getOneOffVersionIdentifier

public static OneOffVersionIdentifier getOneOffVersionIdentifier(OneOffVersioned version)
                                                          throws VersionControlException
Gets the series value of the version.

Supported API: true

Parameters:
version -
Returns:
OneOffVersionIdentifier
Throws:
VersionControlException

newMasterFor

public static Mastered newMasterFor(Iterated iteration)
                             throws WTException
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.

Supported API: true

Parameters:
iteration -
Returns:
Mastered
Throws:
WTException

getSearchCondition

public static SearchCondition getSearchCondition(Class target,
                                                 WTCollection objects,
                                                 boolean notIntheBranch)
                                          throws VersionControlException,
                                                 QueryException,
                                                 WTException
Gets a SearchCondition to be appended to a query to find object(s) of the target class that are in a branch. Since the branch identifier is guaranteed to be unique within the system this criteria effectively will find all objects in the branch.

Supported API: true

Parameters:
target - Target Class
objects - 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.
Returns:
SearchCondition
Throws:
VersionControlException
QueryException
WTException

isNewVersionableAllowed

public static boolean isNewVersionableAllowed(Versionable version,
                                              boolean viewBranch)
                                       throws WTException
Returns true if version is not in work or a session iteration. Does not validate that the version is not a one-off.

Throws:
WTException

isNewVersionableAllowed

protected static boolean isNewVersionableAllowed(Versionable version,
                                                 boolean viewBranch,
                                                 boolean throwException)
                                          throws WTException
Throws:
WTException

isReviseAllowed

public static boolean isReviseAllowed(Versioned version,
                                      boolean viewBranch)
                               throws WTException
This method decides if a wt.vc.Versioned object can be revised.

Supported API: true

Returns:
boolean that indicates if the object is available to be revised
Throws:
WTException

isReviseAllowed

protected static boolean isReviseAllowed(Versioned version,
                                         boolean viewBranch,
                                         boolean throwException)
                                  throws WTException
Throws:
WTException

isNewOneOffVersionAllowed

public static boolean isNewOneOffVersionAllowed(OneOffVersioned version,
                                                boolean viewBranch)
                                         throws WTException
Returns true if version is not a one-off, in work, or a session iteration.

Throws:
WTException

isNewOneOffVersionAllowed

protected static boolean isNewOneOffVersionAllowed(OneOffVersioned version,
                                                   boolean viewBranch,
                                                   boolean throwException)
                                            throws WTException
Throws:
WTException

isNewAdHocStringVersionAllowed

public static boolean isNewAdHocStringVersionAllowed(AdHocStringVersioned version,
                                                     boolean viewBranch)
                                              throws WTException
Returns true if version is not in work or a session iteration.

Throws:
WTException

isNewAdHocStringVersionAllowed

protected static boolean isNewAdHocStringVersionAllowed(AdHocStringVersioned version,
                                                        boolean viewBranch,
                                                        boolean throwException)
                                                 throws WTException
Throws:
WTException

assignIterationCreator

public static Iterated assignIterationCreator(Iterated iteration,
                                              WTPrincipalReference creator)
                                       throws WTException,
                                              VersionControlException,
                                              WTPropertyVetoException
Assigns a creator on the given iterated object to the given principal. If the principal is null the current session principal is used. This method is only intended to be used when loading information into the iterated object before it is persisted. Otherwise, if it is already persistent an exception will occur.

Supported API: true

Parameters:
iteration -
creator -
Returns:
Iterated
Throws:
WTException
VersionControlException
WTPropertyVetoException

assignIterationBranch

public static Iterated assignIterationBranch(Iterated iteration,
                                             long branchId,
                                             boolean latest)
                                      throws WTException,
                                             VersionControlException,
                                             WTPropertyVetoException
Assigns a branch id and latest flag on the given iterated object to the given branch id and latest flag. This method is only intended to be used when loading information into the iterated object before it is persisted. Otherwise, if it is already persistent an exception will occur.

Supported API: true

Parameters:
iteration -
branchId -
latest -
Returns:
Iterated
Throws:
WTException
VersionControlException
WTPropertyVetoException

isNewVersionCheckedOut

public static boolean isNewVersionCheckedOut(Versioned version)
                                      throws WTException
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.
This method now throws an exception: this API did not work as intended, and has been replaced by a database-managed constraint.

Supported API: false
@deprecated

Returns:
boolean that indicates if the object has alread been revised but checked out
Throws:
WTException

getVersionIdentifierSeries

public static MultilevelSeries getVersionIdentifierSeries(Versioned version)
                                                   throws VersionControlException
Internal API used to get the correct series type (using the rules service) when revising a version.

Supported API: false

Throws:
VersionControlException

getVersionIdentifierSeriesFromSeriesName

protected static MultilevelSeries getVersionIdentifierSeriesFromSeriesName(String seriesName)
                                                                    throws VersionControlException
Convenience API for getInitialVersionInfo and getVersionIdentifierSeries.

Throws:
VersionControlException

getSeedType

private static String getSeedType(Versioned version,
                                  String seriesName)
                           throws VersionControlException
Throws:
VersionControlException

getVersionIdentifierSeries

protected static WTKeyedMap getVersionIdentifierSeries(WTCollection versions)
                                                throws VersionControlException
Throws:
VersionControlException

getSeedType

private static WTKeyedMap getSeedType(WTKeyedMap versionToSeriesNameMap)
                               throws VersionControlException
Throws:
VersionControlException