|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.services.StandardManager
wt.vc.wip.StandardWorkInProgressService
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:
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
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 FormField 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static final String CHECKOUT_FOLDER
private static boolean COPY_AD_HOC_ACLS
private static final String ALL_INITIAL_ITERATIONS
Constructor Detail |
public StandardWorkInProgressService()
Method Detail |
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
getConceptualClassname
in class StandardManager
public void registerEvents(ManagerService manager)
registerEvents
in interface Manager
registerEvents
in class StandardManager
manager
- protected void dispatchVetoableMultiObjectEvent(String eventType, WTValuedMap workables) throws WTException, WTPropertyVetoException
eventType
- The name of the PersistentManagerEvent type.workables
- The target of the persistable operation.
WTException
WTPropertyVetoException
protected void dispatchVetoableMultiObjectEvent(String eventType, WTValuedMap workables, Folder workingFolder) throws WTException, WTPropertyVetoException
eventType
- The name of the PersistentManagerEvent type.workables
- The target of the persistable operation.workingFolder
- The folder that the workingCopy is located in,
WTException
WTPropertyVetoException
protected void dispatchVetoableMultiObjectEvent(String eventType, WTCollection workables) throws WTException, WTPropertyVetoException
eventType
- The name of the PersistentManagerEvent type.workables
- The target of the persistable operation.
WTException
WTPropertyVetoException
protected void performStartupProcess() throws ManagerException
performStartupProcess
in class StandardManager
ManagerException
protected void validateCheckout(Workable object) throws WTException, WorkInProgressException
object
-
WTException
WorkInProgressException
protected void validateInWorkUsage(Workable object) throws WorkInProgressException
object
-
WorkInProgressException
protected void processDeletion(WTCollection c) throws WorkInProgressException
c
-
WorkInProgressException
protected void storeCheckoutFolder(WTCollection c) throws WTException, WorkInProgressException
c
-
WTException
WorkInProgressException
protected void updateStateOf(Workable object) throws WorkInProgressException
object
-
WorkInProgressException
public static StandardWorkInProgressService newStandardWorkInProgressService() throws WTException
WTException
public Workable checkin(Workable object, String note) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkin
in interface WorkInProgressService
object
- note
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public WTCollection checkin(WTCollection objects, String note) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkin
in interface WorkInProgressService
objects
- The WTCollection of Workable objects to be checked in.note
- The comment pertaining to the checkin of the Workable objects.
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public WTCollection checkin(WTCollection objects, String note, String folder) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkin
in interface WorkInProgressService
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.
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public WTCollection checkin(WTCollection objects, String note, Folder folder) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkin
in interface WorkInProgressService
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.
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public CheckoutLink checkout(Workable object, Folder folder, String note) throws WTException, WorkInProgressException, NonLatestCheckoutException, WTPropertyVetoException, PersistenceException
checkout
in interface WorkInProgressService
object
- folder
- note
-
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException
public WTCollection checkout(WTCollection objects, Folder folder, String note) throws WTException, WorkInProgressException, NonLatestCheckoutException, WTPropertyVetoException, PersistenceException
checkout
in interface WorkInProgressService
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.
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException
public Workable undoCheckout(Workable object) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
undoCheckout
in interface WorkInProgressService
object
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public void undoCheckouts(Enumeration enum) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
undoCheckouts
in interface WorkInProgressService
enum
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public void undoCheckouts(WTUser user, WTContainer container) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
undoCheckouts
in interface WorkInProgressService
user
- container
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public WTCollection undoCheckouts(WTCollection objects) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
undoCheckouts
in interface WorkInProgressService
objects
- The WTCollection of checked out objects.
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public Workable originalCopyOf(Workable object) throws WTException, WorkInProgressException
originalCopyOf
in interface WorkInProgressService
object
-
WTException
WorkInProgressException
public Workable workingCopyOf(Workable object) throws WTException, WorkInProgressException
workingCopyOf
in interface WorkInProgressService
object
-
WTException
WorkInProgressException
public boolean hasChanged(Workable object) throws WTException
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
hasChanged
in interface WorkInProgressService
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.
WTException
public Folder getCheckoutFolder() throws WTException
getCheckoutFolder
in interface WorkInProgressService
WTException
public QueryResult findCheckedOutObjects(WTContainer container) throws WTException
findCheckedOutObjects
in interface WorkInProgressService
container
-
WTException
public QueryResult findCheckedOutObjects(WTContainer container, WTUser name) throws WTException
findCheckedOutObjects
in interface WorkInProgressService
container
- name
-
WTException
public QueryResult findCheckedOutObjects(WTUser name) throws WTException
findCheckedOutObjects
in interface WorkInProgressService
name
-
WTException
public WTValuedMap getCheckedOutToWorkingMap(WTCollection workables) throws WorkInProgressException, WTException
getCheckedOutToWorkingMap
in interface WorkInProgressService
workables
-
WorkInProgressException
WTException
workingCopyOf(wt.vc.wip.Workable)
,
originalCopyOf(wt.vc.wip.Workable)
public WTValuedMap checkoutMap(WTCollection objects, Folder folder, String note) throws WTException, WorkInProgressException, NonLatestCheckoutException, WTPropertyVetoException, PersistenceException, ObjectsAlreadyCheckedOutException
checkoutMap
in interface WorkInProgressService
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.
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException
ObjectsAlreadyCheckedOutException
public WTValuedMap checkoutMap(WTKeyedMap objects, Folder folder) throws WTException, WorkInProgressException, NonLatestCheckoutException, WTPropertyVetoException, PersistenceException, ObjectsAlreadyCheckedOutException
checkoutMap
in interface WorkInProgressService
objects
- The WTCollection of objects to be checked out.folder
- The Folder the objects are to be checked out to.
WTException
WorkInProgressException
NonLatestCheckoutException
WTPropertyVetoException
PersistenceException
ObjectsAlreadyCheckedOutException
public void checkin(WTObject object) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkin
in interface WorkInProgressServiceSvr
object
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public void checkin(WTCollection objects) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkin
in interface WorkInProgressServiceSvr
objects
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public void checkout(WTObject object) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkout
in interface WorkInProgressServiceSvr
object
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
public void checkout(WTCollection objects) throws WTException, WorkInProgressException, WTPropertyVetoException, PersistenceException
checkout
in interface WorkInProgressServiceSvr
objects
-
WTException
WorkInProgressException
WTPropertyVetoException
PersistenceException
private static boolean isInTerminalState(Workable workable)
private WTCollection getCheckoutLinks(WTCollection c, boolean returnRoleObjects) throws WTException
WTException
private void checkAccess(WTPrincipal p, WTCollection objects, AccessPermission permission) throws WorkInProgressException, WTException
WorkInProgressException
WTException
private Folder getWorkingFolder(WTValuedMap workables) throws WorkInProgressException, WTException
WorkInProgressException
WTException
private WTKeyedMap setDomainRef(WTKeyedMap objects) throws WTException
WTException
private WTCollection releaseLock(WTCollection objects) throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
private WTCollection setIterationModifier(WTCollection objects, WTPrincipalReference userRef) throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
private WTCollection setNote(WTCollection objects, String note) throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
private void validateWorkableMove(WTCollection objects) throws WTException
WTException
private void putInTXMapForValidateCheckout(WTCollection c) throws WTException
WTException
private boolean existsInTxMap(Workable object) throws WTException
WTException
private void validateCheckout(WTCollection c) throws WTException, NonLatestCheckoutException, ObjectsAlreadyCheckedOutException
WTException
NonLatestCheckoutException
ObjectsAlreadyCheckedOutException
private boolean containerHasActiveWorkingCopies(WTContainer container) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |