wt.vc.wip
Class StandardWorkInProgressService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.vc.wip.StandardWorkInProgressService
All Implemented Interfaces:
Manager, NetFactor, Serializable, WorkInProgressService, WorkInProgressServiceSvr

public class StandardWorkInProgressService
extends StandardManager
implements WorkInProgressService, WorkInProgressServiceSvr, Serializable

Provides the standard implementation of server-side functionality as defined by the WorkInProgressService interface. This class is the one intended to be extended to enhance functionality.

As defined by the standard WIP service's access control rules, since a Workable object is asserted as being Lockable the service relies on the locking service for applicable access control. Additionally, when an object is checked out then neither the original checked out or working copies can be checked out again nor deleted.

Event-based processing is performed on business objects asserted as being Workable during database storing, [preparation for] modifications, and deletions. When a business object is being stored in the database, the WIP service listens to a dispatched event indicating that the store is about to commence and initializes the state of the object to being checked in if and only if its checkout info cookie is null. Since a Workable asserts itself as being Foldered the WIP service listens to a dispatched event indicating that a store on a cabinet has successfully completed and checks if the cabinet exists in the user domain (i.e., a personal cabinet), and if so stores a checkout folder in that cabinet. When a business object is [prepared for] being modified in the database, the WIP service listens to a dispatched event indicating that the modify is about to commence and vetoes it if:

Otherwise, the WIP service allows the modification to take place. When a business object is being deleted in the database, the WIP service listens to a dispatched event indicating that a deletion is about to commence and vetoes it if the object is checked out or a working copy of a checked out object.

If the standard implementation is not desired then a custom implementation can extend from WorkInProgressService alongside the standard implementation, and be specified as a property to be used as the default WIP service.

Use the newStandardWorkInProgressService static factory method(s), not the StandardWorkInProgressService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
StandardManager, WorkInProgressServiceEvent, wt.fc.PersistenceManagerEvent.PRE_STORE, wt.fc.PersistenceManagerEvent.POST_STORE, wt.fc.PersistenceManagerEvent.PREPARE_FOR_MODIFICATION, wt.fc.PersistenceManagerEvent.PRE_MODIFY, wt.fc.PersistenceManagerEvent.PRE_DELETE, Serialized Form

Field Summary
private static String ALL_INITIAL_ITERATIONS
           
private static String CHECKOUT_FOLDER
           
private static String CLASSNAME
           
private static boolean COPY_AD_HOC_ACLS
           
private static String RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardWorkInProgressService()
           
 
Method Summary
private  void checkAccess(WTPrincipal p, WTCollection objects, AccessPermission permission)
           
 Workable checkin(Workable object, String note)
          Checkin a workable object.
 void checkin(WTCollection objects)
          Attempts to checkin a workable object.
 WTCollection checkin(WTCollection objects, String note)
          Checkin a WTCollection of Workable objects.
 WTCollection checkin(WTCollection objects, String note, Folder folder)
          Checkin a WTCollection of Workable objects to the folder specified by the name passed.
 WTCollection checkin(WTCollection objects, String note, String folder)
          Checkin a WTCollection of Workable objects to the folder specified by the name passed.
 void checkin(WTObject object)
          Attempts to checkin a workable object.
 CheckoutLink checkout(Workable object, Folder folder, String note)
          Checkout a workable object.
 void checkout(WTCollection objects)
          Attempts to checkout a workable object.
 WTCollection checkout(WTCollection objects, Folder folder, String note)
          Checks out a WTCollection of Workable objects to the specified folder.
 void checkout(WTObject object)
          Attempts to checkout a workable object.
 WTValuedMap checkoutMap(WTCollection objects, Folder folder, String note)
          Checks out a WTCollection of Workable objects to the specified folder.
 WTValuedMap checkoutMap(WTKeyedMap objects, Folder folder)
          Checks out a WTKeyedMap of Workable objects to the specified folder, where the key is the Workable object, and the value is the note for that checkout..
private  boolean containerHasActiveWorkingCopies(WTContainer container)
           
protected  void dispatchVetoableMultiObjectEvent(String eventType, WTCollection workables)
          Dispatches a WorkInProgressServiceEvent that includes the event type and event target as a WTCollection.
protected  void dispatchVetoableMultiObjectEvent(String eventType, WTValuedMap workables)
          Dispatches a WorkInProgressServiceEvent that includes the event type and event target as a WTValuedMap.
protected  void dispatchVetoableMultiObjectEvent(String eventType, WTValuedMap workables, Folder workingFolder)
          Dispatches a WorkInProgressServiceEvent that includes the event type and event target as a WTValuedMap, and a Folder corresponding the the event targets.
private  boolean existsInTxMap(Workable object)
           
 QueryResult findCheckedOutObjects(WTContainer container)
          Find checked out objects for the container, return as a QueryResult.
 QueryResult findCheckedOutObjects(WTContainer container, WTUser name)
          Find checked out objects for the container and user, return as a QueryResult.
 QueryResult findCheckedOutObjects(WTUser name)
          Find checked out objects for the user, return as a QueryResult.
 WTValuedMap getCheckedOutToWorkingMap(WTCollection workables)
          Method that takes a WTCollection of Workable objects, determines which Workable objects from the WTCollection are in the checked out state.
 Folder getCheckoutFolder()
          Gets the folder named "Checked Out" located in the current session user's personal cabinet.
private  WTCollection getCheckoutLinks(WTCollection c, boolean returnRoleObjects)
           
 String getConceptualClassname()
          Deprecated.  
private  Folder getWorkingFolder(WTValuedMap workables)
           
 boolean hasChanged(Workable object)
          Deprecated.  
private static boolean isInTerminalState(Workable workable)
           
static StandardWorkInProgressService newStandardWorkInProgressService()
          Default factory for the class.
 Workable originalCopyOf(Workable object)
          Navigates to the original copy from a working copy via the CheckoutLink.
protected  void performStartupProcess()
          Overrides the startup process specific to the WIP service to provide custom startup for event subscription.
protected  void processDeletion(WTCollection c)
          Completes a deletion by undoing a checkout if the objects in the collection to be deleted are either checked out or a working copy.
private  void putInTXMapForValidateCheckout(WTCollection c)
           
 void registerEvents(ManagerService manager)
          Overrides the registration of all applicable WIP service events with the service manager.
private  WTCollection releaseLock(WTCollection objects)
           
private  WTKeyedMap setDomainRef(WTKeyedMap objects)
           
private  WTCollection setIterationModifier(WTCollection objects, WTPrincipalReference userRef)
           
private  WTCollection setNote(WTCollection objects, String note)
           
protected  void storeCheckoutFolder(WTCollection c)
          Stores the"Checked Out" folder for the just recently stored user's personal cabinet.
 Workable undoCheckout(Workable object)
          Undo a checkout of a workable object.
 void undoCheckouts(Enumeration enum)
          Deprecated.  
 WTCollection undoCheckouts(WTCollection objects)
          Given a WTCollection of checked out objects undo each checkout.
 void undoCheckouts(WTUser user, WTContainer container)
          Undo all checkouts by the user for objects located in the specified container.
protected  void updateStateOf(Workable object)
          Updates the state of a workable object to checked in if it has a null cookie.
protected  void validateCheckout(Workable object)
          Vetoes a database modify if the object has been checked out.
private  void validateCheckout(WTCollection c)
           
protected  void validateInWorkUsage(Workable object)
          Vetoes an operation if the given object is in a working state.
private  void validateWorkableMove(WTCollection objects)
           
 Workable workingCopyOf(Workable object)
          Navigates to the working copy of an original copy via the CheckoutLink.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

CHECKOUT_FOLDER

private static final String CHECKOUT_FOLDER
See Also:
Constant Field Values

COPY_AD_HOC_ACLS

private static boolean COPY_AD_HOC_ACLS

ALL_INITIAL_ITERATIONS

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

StandardWorkInProgressService

public StandardWorkInProgressService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

registerEvents

public void registerEvents(ManagerService manager)
Overrides the registration of all applicable WIP service events with the service manager.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
manager -

dispatchVetoableMultiObjectEvent

protected void dispatchVetoableMultiObjectEvent(String eventType,
                                                WTValuedMap workables)
                                         throws WTException,
                                                WTPropertyVetoException
Dispatches a WorkInProgressServiceEvent that includes the event type and event target as a WTValuedMap.

Supported API: false

Parameters:
eventType - The name of the PersistentManagerEvent type.
workables - The target of the persistable operation.
Throws:
WTException
WTPropertyVetoException

dispatchVetoableMultiObjectEvent

protected void dispatchVetoableMultiObjectEvent(String eventType,
                                                WTValuedMap workables,
                                                Folder workingFolder)
                                         throws WTException,
                                                WTPropertyVetoException
Dispatches a WorkInProgressServiceEvent that includes the event type and event target as a WTValuedMap, and a Folder corresponding the the event targets.

Supported API: false

Parameters:
eventType - The name of the PersistentManagerEvent type.
workables - The target of the persistable operation.
workingFolder - The folder that the workingCopy is located in,
Throws:
WTException
WTPropertyVetoException

dispatchVetoableMultiObjectEvent

protected void dispatchVetoableMultiObjectEvent(String eventType,
                                                WTCollection workables)
                                         throws WTException,
                                                WTPropertyVetoException
Dispatches a WorkInProgressServiceEvent that includes the event type and event target as a WTCollection.

Supported API: false

Parameters:
eventType - The name of the PersistentManagerEvent type.
workables - The target of the persistable operation.
Throws:
WTException
WTPropertyVetoException

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Overrides the startup process specific to the WIP service to provide custom startup for event subscription. During subscription an anonymous inner class adapter is created per subscription to handle each specific event of interest.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

validateCheckout

protected void validateCheckout(Workable object)
                         throws WTException,
                                WorkInProgressException
Vetoes a database modify if the object has been checked out. In other words, the checked out object is the locked one that is preserved and its working copy is the correct object to be working on.

Supported API: false

Parameters:
object -
Throws:
WTException
WorkInProgressException

validateInWorkUsage

protected void validateInWorkUsage(Workable object)
                            throws WorkInProgressException
Vetoes an operation if the given object is in a working state. This is typically done when a working copy is attempted to be moved to another folder, or when it is attempted to be stored after being branched or revised. In the case of a checkout it is valid to store a newly made working copy so this validation will pass on the veto if the given object is transitioning to the working state.

Supported API: false

Parameters:
object -
Throws:
WorkInProgressException

processDeletion

protected void processDeletion(WTCollection c)
                        throws WorkInProgressException
Completes a deletion by undoing a checkout if the objects in the collection to be deleted are either checked out or a working copy. In the case of it being checked out (i.e., the vaulted copy) a normal undo of a checkout is required. Otherwise, if the object being deleted is the working copy then undoing the checkout must not delete the working copy to allow normal deletion to occur without error.

Supported API: false

Parameters:
c -
Throws:
WorkInProgressException

storeCheckoutFolder

protected void storeCheckoutFolder(WTCollection c)
                            throws WTException,
                                   WorkInProgressException
Stores the"Checked Out" folder for the just recently stored user's personal cabinet.

Supported API: false

Parameters:
c -
Throws:
WTException
WorkInProgressException

updateStateOf

protected void updateStateOf(Workable object)
                      throws WorkInProgressException
Updates the state of a workable object to checked in if it has a null cookie.

Supported API: false

Parameters:
object -
Throws:
WorkInProgressException

newStandardWorkInProgressService

public static StandardWorkInProgressService newStandardWorkInProgressService()
                                                                      throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardWorkInProgressService
Throws:
WTException

checkin

public Workable checkin(Workable object,
                        String note)
                 throws WTException,
                        WorkInProgressException,
                        WTPropertyVetoException,
                        PersistenceException
Checkin a workable object. A PRE_CHECKIN WorkInProgressServiceEvent is emitted within a transaction before the object is checked in, and a POST_CHECKIN WorkInProgressServiceEvent is emitted within the same transaction after the object has been checked in.

Supported API: true

Specified by:
checkin in interface WorkInProgressService
Parameters:
object -
note -
Returns:
Workable
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

checkin

public WTCollection checkin(WTCollection objects,
                            String note)
                     throws WTException,
                            WorkInProgressException,
                            WTPropertyVetoException,
                            PersistenceException
Checkin a WTCollection of Workable objects. A multi-object PRE_CHECKIN WorkInProgressServiceEvent is emitted within a transaction before the objects are checked in, and a multi-object POST_CHECKIN WorkInProgressServiceEvent is emitted within the same transaction after the collection of objects has been checked in. The supplied note is used as the comment for the checkin of the objects.

Supported API: true

Specified by:
checkin in interface WorkInProgressService
Parameters:
objects - The WTCollection of Workable objects to be checked in.
note - The comment pertaining to the checkin of the Workable objects.
Returns:
WTCollection
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

checkin

public WTCollection checkin(WTCollection objects,
                            String note,
                            String folder)
                     throws WTException,
                            WorkInProgressException,
                            WTPropertyVetoException,
                            PersistenceException
Checkin a WTCollection of Workable objects to the folder specified by the name passed. This API is intended for first time checkin from a personal cabinet only. The supplied note is used as the comment for the checkin of the objects.

Supported API: true

Specified by:
checkin in interface WorkInProgressService
Parameters:
objects - The WTCollection of Workable objects to be checked in.
note - The comment pertaining to the checkin of the Workable objects.
folder - The name of the folder the objects are to be checked in to.
Returns:
WTCollection
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

checkin

public WTCollection checkin(WTCollection objects,
                            String note,
                            Folder folder)
                     throws WTException,
                            WorkInProgressException,
                            WTPropertyVetoException,
                            PersistenceException
Checkin a WTCollection of Workable objects to the folder specified by the name passed. This API is intended for first time checkin from a personal cabinet only. The supplied note is used as the comment for the checkin of the objects.

Supported API: true

Specified by:
checkin in interface WorkInProgressService
Parameters:
objects - The WTCollection of Workable objects to be checked in.
note - The comment pertaining to the checkin of the Workable objects.
folder - The Folder the objects are to be checked in to.
Returns:
WTCollection
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

checkout

public CheckoutLink checkout(Workable object,
                             Folder folder,
                             String note)
                      throws WTException,
                             WorkInProgressException,
                             NonLatestCheckoutException,
                             WTPropertyVetoException,
                             PersistenceException
Checkout a workable object. A PRE_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the object is checked out, and a POST_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the object has been checked out.

Supported API: true

Specified by:
checkout in interface WorkInProgressService
Parameters:
object -
folder -
note -
Returns:
CheckoutLink
Throws:
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException

checkout

public WTCollection checkout(WTCollection objects,
                             Folder folder,
                             String note)
                      throws WTException,
                             WorkInProgressException,
                             NonLatestCheckoutException,
                             WTPropertyVetoException,
                             PersistenceException
Checks out a WTCollection of Workable objects to the specified folder. A multi-object PRE_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the collection of objects is checked out, and a multi-object POST_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the objects have been checked out. The provided note is used as the comment for the checkout operation.

Supported API: true

Specified by:
checkout in interface WorkInProgressService
Parameters:
objects - The WTCollection of objects to be checked out.
folder - The Folder the objects are to be checked out to.
note - The comment for the checkout operation.
Returns:
WTCollection - The collection returned contains the set of CheckoutLink objects resulting from the operation.
Throws:
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException

undoCheckout

public Workable undoCheckout(Workable object)
                      throws WTException,
                             WorkInProgressException,
                             WTPropertyVetoException,
                             PersistenceException
Undo a checkout of a workable object. A PRE_UNDO_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the object's checkout is undone, and a POST_UNDO_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the object has had its checkout undone.

Supported API: true

Specified by:
undoCheckout in interface WorkInProgressService
Parameters:
object -
Returns:
Workable
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

undoCheckouts

public void undoCheckouts(Enumeration enum)
                   throws WTException,
                          WorkInProgressException,
                          WTPropertyVetoException,
                          PersistenceException
Deprecated.  

Given an enumeration of checked out objects, undo each checkout. A multi-object PRE_UNDO_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the checkout of the objects is undone, and a multi-object POST_UNDO_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the checkout of the collection of objects has been undone.

Supported API: false

Specified by:
undoCheckouts in interface WorkInProgressService
Parameters:
enum -
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

undoCheckouts

public void undoCheckouts(WTUser user,
                          WTContainer container)
                   throws WTException,
                          WorkInProgressException,
                          WTPropertyVetoException,
                          PersistenceException
Undo all checkouts by the user for objects located in the specified container.

Supported API: true

Specified by:
undoCheckouts in interface WorkInProgressService
Parameters:
user -
container -
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

undoCheckouts

public WTCollection undoCheckouts(WTCollection objects)
                           throws WTException,
                                  WorkInProgressException,
                                  WTPropertyVetoException,
                                  PersistenceException
Given a WTCollection of checked out objects undo each checkout. A multi-object PRE_UNDO_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the checkout of the objects is undone, and a multi-object POST_UNDO_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the checkout of the collection of objects has been undone.

Supported API: true

Specified by:
undoCheckouts in interface WorkInProgressService
Parameters:
objects - The WTCollection of checked out objects.
Returns:
WTCollection
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

originalCopyOf

public Workable originalCopyOf(Workable object)
                        throws WTException,
                               WorkInProgressException
Navigates to the original copy from a working copy via the CheckoutLink.

Supported API: true

Specified by:
originalCopyOf in interface WorkInProgressService
Parameters:
object -
Returns:
Workable
Throws:
WTException
WorkInProgressException

workingCopyOf

public Workable workingCopyOf(Workable object)
                       throws WTException,
                              WorkInProgressException
Navigates to the working copy of an original copy via the CheckoutLink.

Supported API: true

Specified by:
workingCopyOf in interface WorkInProgressService
Parameters:
object -
Returns:
Workable
Throws:
WTException
WorkInProgressException

hasChanged

public boolean hasChanged(Workable object)
                   throws WTException
Deprecated.  

Checks if the given object has changed since it was checked out. The object can be either the working or original copy. If the original copy is passed in then the working copy will be retreived from the database.

Currently this method always returns true. The goal is to be able to detect if any attributes and associations from the object have been modified, and if not return false.

Supported API: false

Specified by:
hasChanged in interface WorkInProgressService
Parameters:
object - The object to to test. If it is not a working copy then the working copy associated with the original copy will be retreived from the database and used.
Returns:
true
Throws:
WTException

getCheckoutFolder

public Folder getCheckoutFolder()
                         throws WTException
Gets the folder named "Checked Out" located in the current session user's personal cabinet.

Supported API: true

Specified by:
getCheckoutFolder in interface WorkInProgressService
Returns:
Folder
Throws:
WTException

findCheckedOutObjects

public QueryResult findCheckedOutObjects(WTContainer container)
                                  throws WTException
Find checked out objects for the container, return as a QueryResult.

Supported API: true

Specified by:
findCheckedOutObjects in interface WorkInProgressService
Parameters:
container -
Returns:
QueryResult
Throws:
WTException

findCheckedOutObjects

public QueryResult findCheckedOutObjects(WTContainer container,
                                         WTUser name)
                                  throws WTException
Find checked out objects for the container and user, return as a QueryResult.

Supported API: true

Specified by:
findCheckedOutObjects in interface WorkInProgressService
Parameters:
container -
name -
Returns:
QueryResult
Throws:
WTException

findCheckedOutObjects

public QueryResult findCheckedOutObjects(WTUser name)
                                  throws WTException
Find checked out objects for the user, return as a QueryResult.

Supported API: true

Specified by:
findCheckedOutObjects in interface WorkInProgressService
Parameters:
name -
Returns:
QueryResult
Throws:
WTException

getCheckedOutToWorkingMap

public WTValuedMap getCheckedOutToWorkingMap(WTCollection workables)
                                      throws WorkInProgressException,
                                             WTException
Method that takes a WTCollection of Workable objects, determines which Workable objects from the WTCollection are in the checked out state. For the Workable objects that are checked out, a WTValuedMap is created where the key is the checked out object, and the value is the working copy. This method is to be used as the multi-object replacement for workingCopyOf and originalCopyOf.

Supported API: false

Specified by:
getCheckedOutToWorkingMap in interface WorkInProgressService
Parameters:
workables -
Returns:
WTValuedMap
Throws:
WorkInProgressException
WTException
See Also:
workingCopyOf(wt.vc.wip.Workable), originalCopyOf(wt.vc.wip.Workable)

checkoutMap

public WTValuedMap checkoutMap(WTCollection objects,
                               Folder folder,
                               String note)
                        throws WTException,
                               WorkInProgressException,
                               NonLatestCheckoutException,
                               WTPropertyVetoException,
                               PersistenceException,
                               ObjectsAlreadyCheckedOutException
Checks out a WTCollection of Workable objects to the specified folder. A multi-object PRE_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the collection of objects is checked out, and a multi-object POST_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the objects have been checked out. The provided note is used as the comment for the checkout operation.

Supported API: true

Specified by:
checkoutMap in interface WorkInProgressService
Parameters:
objects - The WTCollection of objects to be checked out.
folder - The Folder the objects are to be checked out to.
note - The comment for the checkout operation.
Returns:
WTValuedMap - The WTValuedMap returned contains the checked out Workable object as the key and the resulting CheckoutLink object as the value.
Throws:
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException
ObjectsAlreadyCheckedOutException

checkoutMap

public WTValuedMap checkoutMap(WTKeyedMap objects,
                               Folder folder)
                        throws WTException,
                               WorkInProgressException,
                               NonLatestCheckoutException,
                               WTPropertyVetoException,
                               PersistenceException,
                               ObjectsAlreadyCheckedOutException
Checks out a WTKeyedMap of Workable objects to the specified folder, where the key is the Workable object, and the value is the note for that checkout.. A multi-object PRE_CHECKOUT WorkInProgressServiceEvent is emitted within a transaction before the collection of objects is checked out, and a multi-object POST_CHECKOUT WorkInProgressServiceEvent is emitted within the same transaction after the objects have been checked out. The provided note is used as the comment for the checkout operation.

Supported API: true

Specified by:
checkoutMap in interface WorkInProgressService
Parameters:
objects - The WTCollection of objects to be checked out.
folder - The Folder the objects are to be checked out to.
Returns:
WTValuedMap - The WTValuedMap returned contains the checked out Workable object as the key and the resulting CheckoutLink object as the value.
Throws:
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException
ObjectsAlreadyCheckedOutException

checkin

public void checkin(WTObject object)
             throws WTException,
                    WorkInProgressException,
                    WTPropertyVetoException,
                    PersistenceException
Attempts to checkin a workable object.

Supported API: false

Specified by:
checkin in interface WorkInProgressServiceSvr
Parameters:
object -
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

checkin

public void checkin(WTCollection objects)
             throws WTException,
                    WorkInProgressException,
                    WTPropertyVetoException,
                    PersistenceException
Attempts to checkin a workable object.

Supported API: false

Specified by:
checkin in interface WorkInProgressServiceSvr
Parameters:
objects -
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

checkout

public void checkout(WTObject object)
              throws WTException,
                     WorkInProgressException,
                     WTPropertyVetoException,
                     PersistenceException
Attempts to checkout a workable object.

Supported API: false

Specified by:
checkout in interface WorkInProgressServiceSvr
Parameters:
object -
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

checkout

public void checkout(WTCollection objects)
              throws WTException,
                     WorkInProgressException,
                     WTPropertyVetoException,
                     PersistenceException
Attempts to checkout a workable object.

Supported API: false

Specified by:
checkout in interface WorkInProgressServiceSvr
Parameters:
objects -
Throws:
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException

isInTerminalState

private static boolean isInTerminalState(Workable workable)

getCheckoutLinks

private WTCollection getCheckoutLinks(WTCollection c,
                                      boolean returnRoleObjects)
                               throws WTException
Throws:
WTException

checkAccess

private void checkAccess(WTPrincipal p,
                         WTCollection objects,
                         AccessPermission permission)
                  throws WorkInProgressException,
                         WTException
Throws:
WorkInProgressException
WTException

getWorkingFolder

private Folder getWorkingFolder(WTValuedMap workables)
                         throws WorkInProgressException,
                                WTException
Throws:
WorkInProgressException
WTException

setDomainRef

private WTKeyedMap setDomainRef(WTKeyedMap objects)
                         throws WTException
Throws:
WTException

releaseLock

private WTCollection releaseLock(WTCollection objects)
                          throws WTException,
                                 WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

setIterationModifier

private WTCollection setIterationModifier(WTCollection objects,
                                          WTPrincipalReference userRef)
                                   throws WTException,
                                          WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

setNote

private WTCollection setNote(WTCollection objects,
                             String note)
                      throws WTException,
                             WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

validateWorkableMove

private void validateWorkableMove(WTCollection objects)
                           throws WTException
Throws:
WTException

putInTXMapForValidateCheckout

private void putInTXMapForValidateCheckout(WTCollection c)
                                    throws WTException
Throws:
WTException

existsInTxMap

private boolean existsInTxMap(Workable object)
                       throws WTException
Throws:
WTException

validateCheckout

private void validateCheckout(WTCollection c)
                       throws WTException,
                              NonLatestCheckoutException,
                              ObjectsAlreadyCheckedOutException
Throws:
WTException
NonLatestCheckoutException
ObjectsAlreadyCheckedOutException

containerHasActiveWorkingCopies

private boolean containerHasActiveWorkingCopies(WTContainer container)
                                         throws WTException
Throws:
WTException