wt.vc.wip
Class WorkInProgressHelper

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

public final class WorkInProgressHelper
extends Object
implements Externalizable

Provides the Work In Progress (WIP) service's Application Programming Interface (API). This API includes static methods to checkin, checkout, undo checkout, find the predecessor and successor(s) of an iteration, find the original checked out copy of a working copy, find the working copy of an original checked out copy, get cookie information, and get search conditions to aid in a query. 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.

Note that the methods in this helper do not consider/handle "sandbox" checkouts, but rather are specific to work-in-progress checkouts. The lone exception to this is getState() which can return WorkInProgressState.CHECKED_OUT_TO_SANDBOX.

Supported API: true

Extendable: false

See Also:
Workable, WorkInProgressService, Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static WorkInProgressService service
          

Supported API: true
 
Constructor Summary
WorkInProgressHelper()
           
 
Method Summary
static WTCollection getCheckedOut(WTCollection objects)
          Tests if the workable object is checked out by the principal.
protected static WTCollection getCheckedOut(WTCollection objects, WTPrincipal worker)
          Tests if the workable object is checked out by the principal.
static SearchCondition getSearchCondition_CI(Class target)
          Determines a search condition to be appended on a query.
static SearchCondition getSearchCondition_CO(Class target)
          Determines a search condition to be appended on a query.
static SearchCondition getSearchCondition_WRK(Class target)
          Determines a search condition to be appended on a query.
static SearchCondition getSearchCondition(Class target, boolean checkedOut)
          Deprecated.  
static WorkInProgressState getState(Workable object)
          Gets the work-in-progress state of the object.
static boolean isCheckedOut(Workable object)
          Tests if the workable object is checked out.
static boolean isCheckedOut(Workable object, WTPrincipal worker)
          Tests if the workable object is checked out by the principal.
static boolean isCheckedOut(WorkInProgressState state)
          Returns true if the passed in state equals a state that indicates checked out

Supported API: false
static boolean isModifiable(Workable object)
           
static boolean isWorkingCopy(Workable object)
          Tests if the workable object is a working copy.
static boolean isWorkingCopy(WorkInProgressState state)
          Returns true if the passed in state equals a state that indicates that it is a working copy

Supported API: false
 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(WorkInProgressHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 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 WorkInProgressService 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
Constructor Detail

WorkInProgressHelper

public WorkInProgressHelper()
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(WorkInProgressHelper 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

getState

public static WorkInProgressState getState(Workable object)
                                    throws WorkInProgressException
Gets the work-in-progress state of the object. The object could be either checked in, checked out, or in work.

Supported API: true

Parameters:
object -
Returns:
WorkInProgressState
Throws:
WorkInProgressException

isCheckedOut

public static boolean isCheckedOut(Workable object)
                            throws WTException
Tests if the workable object is checked out. True is returned if the object is either the original [checked out] copy, or the working copy of the original. Otherwise, false is returned.

Supported API: true

Parameters:
object -
Returns:
boolean
Throws:
WTException

isCheckedOut

public static boolean isCheckedOut(Workable object,
                                   WTPrincipal worker)
                            throws WTException
Tests if the workable object is checked out by the principal. True is returned if the object is either the original [checked out] copy and its locker is the given principal, or the working copy of the original and its owner is the given principal. Otherwise, false is returned.

Supported API: true

Parameters:
object -
worker -
Returns:
boolean
Throws:
WTException

isCheckedOut

public static boolean isCheckedOut(WorkInProgressState state)
Returns true if the passed in state equals a state that indicates checked out

Supported API: false

Parameters:
state -
Returns:
boolean

getCheckedOut

protected static WTCollection getCheckedOut(WTCollection objects,
                                            WTPrincipal worker)
                                     throws WTException
Tests if the workable object is checked out by the principal. True is returned if the object is either the original [checked out] copy and its locker is the given principal, or the working copy of the original and its owner is the given principal. Otherwise, false is returned.

Supported API: true

Parameters:
objects -
worker -
Returns:
WTCollection
Throws:
WTException

getCheckedOut

public static WTCollection getCheckedOut(WTCollection objects)
                                  throws WTException
Tests if the workable object is checked out by the principal. True is returned if the object is either the original [checked out] copy and its locker is the given principal, or the working copy of the original and its owner is the given principal. Otherwise, false is returned.

Supported API: true

Parameters:
objects -
Returns:
WTCollection
Throws:
WTException

isWorkingCopy

public static boolean isWorkingCopy(Workable object)
Tests if the workable object is a working copy.

Supported API: true

Parameters:
object -
Returns:
boolean

isWorkingCopy

public static boolean isWorkingCopy(WorkInProgressState state)
Returns true if the passed in state equals a state that indicates that it is a working copy

Supported API: false

Parameters:
state -
Returns:
boolean

getSearchCondition

public static SearchCondition getSearchCondition(Class target,
                                                 boolean checkedOut)
                                          throws WorkInProgressException,
                                                 QueryException
Deprecated.  

Determines a search condition to be appended on a query.

Supported API: true

Parameters:
target -
checkedOut -
Returns:
SearchCondition
Throws:
WorkInProgressException
QueryException

getSearchCondition_WRK

public static SearchCondition getSearchCondition_WRK(Class target)
                                              throws WorkInProgressException,
                                                     QueryException
Determines a search condition to be appended on a query.

Supported API: true

Parameters:
target -
Returns:
SearchCondition
Throws:
WorkInProgressException
QueryException

getSearchCondition_CO

public static SearchCondition getSearchCondition_CO(Class target)
                                             throws WorkInProgressException,
                                                    QueryException
Determines a search condition to be appended on a query.

Supported API: true

Parameters:
target -
Returns:
SearchCondition
Throws:
WorkInProgressException
QueryException

getSearchCondition_CI

public static SearchCondition getSearchCondition_CI(Class target)
                                             throws WorkInProgressException,
                                                    QueryException
Determines a search condition to be appended on a query.

Supported API: true

Parameters:
target -
Returns:
SearchCondition
Throws:
WorkInProgressException
QueryException

isModifiable

public static boolean isModifiable(Workable object)
                            throws WTException
Throws:
WTException