wt.sandbox
Class StandardSandboxService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.sandbox.StandardSandboxService
All Implemented Interfaces:
Manager, NetFactor, SandboxService, Serializable

public class StandardSandboxService
extends StandardManager
implements SandboxService, Serializable

Standard implementation of SandboxService interface.

Use the newStandardSandboxService static factory method(s), not the StandardSandboxService 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: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
private  class StandardSandboxService.DeletedCheckinImplicitUndoer
          Works in conjunction with processPreDeletionOfCheckedInCopies().
private static class StandardSandboxService.MethodContextCleaner
           
 
Field Summary
private static String CLASSNAME
           
private static String INITIAL_SANDBOX_WORKING_COPY_ONE_OFF_VER_LABEL
          Though a constant is used for this value it really must be "0" for reasons detailed in zeroOutOneOffVersionLabels().
private static StandardSandboxService.MethodContextCleaner METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_CLEANER
          Transaction listener to clean up METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_KEY at end of transaction.
private static Object METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_KEY
          Method context key for WTContainerRef to SandboxBaseline map.
private static Object METHOD_CONTEXT_CR_TO_SB_BL_CLEANER_INSTALLED_KEY
          Key for use in map in method context at key METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_KEY for flag indicating whether METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_CLEANER has been installed.
private static Object METHOD_CONTEXT_KNOWN_TERMINAL_ITERATIONS_TO_DELETE
          Method context key to tell us to ignore ourselves when we delete terminal predecessor iterations.
private static Class[] REQUIRED_SANDBOX_WORKABLE_INTERFACES
          Array of interfaces which a class must implement in order for it to be "sandbox" checked-in and out by this service.
private static Class[] REQUIRED_SANDBOX_WORKABLE_INTERFACES_PLUS_BASELINEABLE
          Same as REQUIRED_SANDBOX_WORKABLE_INTERFACES but with Baselineable tacked on as well.
private static String RESOURCE
           
private static Object SANDBOX_COPIES_WITH_CHECKIN_COPIES_BEING_DELETED_KEY
          Transaction map key storing set of sandbox copies whose checkins are being deleted.
static Object SANDBOX_REMOVE_OBJECTS_KEY
          Transaction map key containing all the elements to be processed in removeObjects.
private  TransactionCommitListener UNDO_CHECKIN_HANDLER
          Works in conjunction with processPreDeletionOfCheckedInCopies().
private static Object UNDO_CHECKIN_HANDLER_INSTALLED_KEY
          Transaction map key storing whether UNDO_CHECKIN_HANDLER has been installed in transaction.
 
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
StandardSandboxService()
           
 
Method Summary
private static void addOriginalCopyShareRefs(WTCollection sandboxWorkingCopyRefs, WTCollection originalCopyShareRefs, boolean bypassAccessControl)
          Returns a set of references to all version shares which exist for original copies of sandbox working copies referenced by 'sandboxWorkingCopyRefs'.
private  void addToSandboxBaseline(Map sandboxToOtherVersionRefMap, Map contRefToSandboxVersionRefCollMap)
           
 SandboxBaseline addToSandboxBaseline(WTCollection wtCollOfBaselineables, WTContainerRef sandboxContainer)
          Add a collection of baselinables to the SandboxBaseline associated with the given sandbox container.
 SandboxBaseline addToSandboxBaseline(WTCollection wtCollOfBaselineables, WTContainerRef sandboxContainer, boolean replaceEntriesFromSameMasters)
          Add a collection of baselinables to the SandboxBaseline associated with the given sandbox container.
private  void addWorkableFolderChildren(WTSet outputSet, Collection inputCollection)
           
private  void addWorkableFolderChildren(WTSet outputSet, Folder folder)
           
private static void applyInitialCheckinData(WTKeyedMap initialCheckinWorkingCopyToDataMap, WTValuedMap workingCopyToInitialCheckinMap, InitialCheckinDataApplicator applicator)
           
 void checkin(WTKeyedMap inputRefToInitialCheckinDataMap, String note)
          Check-in a group of versioned objects from a sandbox container to the larger enterprise.
 Map checkin(WTKeyedMap inputRefToInitialCheckinDataMap, String note, InitialCheckinDataApplicator applicator, boolean returnCheckedinVersions)
          Check-in a group of versioned objects from a sandbox container to the larger enterprise.
 void checkout(WTCollection wtOrigCopiesSet, WTContainerRef targetContainerRef, Folder targetFolder, String note)
          Check-out a group of versioned objects from the larger enterprise to a sandbox container.
 Map checkout(WTCollection wtOrigCopiesSet, WTContainerRef targetContainerRef, Folder targetFolder, String note, boolean returnCheckedoutVersions)
          Check-out a group of versioned objects from the larger enterprise to a sandbox container.
private static void correctVersionSeries(WTValuedMap workingCopyToInitialCheckinMap)
          Fixes the version series on the initial send to PDM.
private static boolean couldBeSandboxWorkable(Object obj)
           
private static boolean couldBeSandboxWorkingCopy(Persistable version, boolean doInstanceOfChecks, boolean requireLatestActiveIter)
          Determines if a given persistable could be a sandbox working copy without hitting the database
private static WTSet deleteObjects(WTSet objectsToDelete, boolean validateAndRefreshRefs)
           
private static Set getBaselinedSubset(Collection wtColl, long baselineId, boolean restrictToSameBranch)
          Get subset of references in 'wcColl' which have an iteration with the same master (when 'restrictToSameBranch' is false) or same branch id (when 'restrictToSameBranch' is true) as an iteration in the specified baseline.
 Versioned getCheckedinCopyOf(Versioned version)
          Given a sandbox iteration that has been checked in returns the resulting checked-in iteration -- otherwise returns null.
 Map getCheckedInCopyToSandboxCopyRefMap(Collection wtCollOfCheckedinCopies)
          Gets map from any sandbox check ins in the input collection to sandbox copies.
private  Map getCheckedInCopyToSandboxCopyRefMapNoAcl(Collection wtCollOfCheckedInCopies)
           
 Map getCheckinsToSandboxesMap(Collection wtColl)
          Gets map from any sandbox check ins from input collection to sandboxes containers from which they were checked in.
 String getConceptualClassname()
          Deprecated.  
private static WTKeyedMap getContainerRefToContainedObjRefMap(Collection refColl)
          Gets map from container refs to collections of version references which are contained by them and refer to objects which are both contained and baselineable.
private static WTSet getContainersWithActiveWorkingCopies(WTCollection wtContainerRefColl)
           
private static Collection getCorrespondingBaselineEntries(Collection wtColl, long baselineId, boolean restrictToSameBranch)
          Get references to baseline entries which either have the same master (when 'restrictToSameBranch' is false) or same branch id (when 'restrictToSameBranch' is true) as an iteration or master in wtColl.
private static Collection getCorrespondingBaselineEntries(Collection wtColl, long baselineId, boolean restrictToSameBranch, boolean bypassAccessControl)
          Access control by-pass for getCorrespondingBaselineEntries(Collection,long,boolean).
private static Map getIterRefToSandboxRefMap(QueryResult results, Map idsToReferences, int keyMask, int valueMask)
           
private static Map getMapToBaselineEntries(Collection wtColl, long baselineId, boolean restrictToSameBranch)
           
private static Map getMapToBaselineEntries(Collection wtColl, long baselineId, boolean restrictToSameBranch, boolean useDummyEntries)
          Get map from masters or iteration/versions in wtColl to corresponding entries in baseline (if any).
 Map getMapToSandboxBaselineIterations(Collection wtCollOfBaselineables, WTContainerRef containerRef, boolean restrictToSameBranch)
          Gets map from any master, iteration, or version in the input collection to the corresponding iteration in the sandbox baseline.
private static WTSet getMastersWithMultiItersInColl(WTCollection iterColl)
           
private static WTSet getObjsWithoutPriv(WTCollection objsToCheck, AccessPermission permission)
          Essentially a multi-object hasAccess() except that inaccessibility audit entries are produced where necessary.
private  SandboxBaseline getOrCreateSandboxBaseline(WTContainerRef sandboxContainerRef)
           
private static WTSet getOriginalCopiesUserCannotUnlock(WTValuedMap workingToOriginalRefMap, Map sandboxContRefToWorkingCopyRefsMap)
           
 Versioned getOriginalCopyOf(Versioned version)
          Similar to method of the same name in WorkInProgressService.
 Map getOriginalCopyToWorkingCopyRefMap(Collection wtColl)
          Get map from any sandbox original copies in the input collection to corresopnding working copies.
 Map getOriginalCopyToWorkingCopyRefMap(Collection wtColl, boolean allowWorkingCopyInputs)
          Get map from any sandbox original copies in the input collection to corresopnding working copies.
private static Map getOriginalCopyToWorkingCopyRefMap(Collection wtColl, boolean lockDatabaseRows, boolean allowWorkingCopyInputs)
           
 Map getOriginalsToSandboxesMap(Collection wtColl)
          Gets map from any sandbox check out original copies in the input collection to sandboxes containers to which they have been checked out.
 Map getRefreshCandidates(WTContainerRef sandboxRef, EPMDocConfigSpec docConfigSpec, WTPartConfigSpec partConfigSpec, boolean isDocCentric)
          For all objects shared from PDM to Sandbox, returns newer iterations available in PDM.
private static WTValuedMap getRefreshedLockedWorkingToOrigCopyWTMap(WTCollection inputRefs, boolean forceObjRefsForOrigCopies)
          produce map from working to original copies, locking both in the process
 WTContainerRef getRelatedSandboxRef(Versioned originalCopy, boolean previous)
          Given an iteration, returns a reference to the "related" sandbox container.
 SandboxBaseline getSandboxBaseline(WTContainerRef sandboxContainer)
          Returns the given sandbox container's baseline.
 Baselineable getSandboxBaselineIteration(Baselineable baselineable, WTContainerRef containerRef)
          Returns the iteration found in the sandbox baseline for the given object and containerRef.
private  ObjectReference getSandboxBaselineRef(WTContainerRef containerRef)
          Simple wrapper for getSandboxToBaselineRefMap().
private static WTSet getSandboxCheckoutlinks(WTValuedMap workingToOriginalRefMap)
           
private static Collection getSandboxCopyCheckedInCopyPairs(Collection wtColl, boolean inputsAreSandboxCopies)
           
 Versioned getSandboxCopyOf(Versioned version)
          Given an iteration which resulted from a sandbox check-in, returns the original sandbox iteration -- otherwise returns null.
private  Versioned getSandboxCopyOf(Versioned version, boolean bypassAccessControl)
          Access control by-pass for getSandboxCopyOf(Versioned).
 Map getSandboxCopyToCheckedInCopyRefMap(Collection wtCollOfSandboxCopies)
          Get map from any sandbox (inactive working) copies in input collection to corresponding checked-in copies.
 WTValuedMap getSandboxToBaselineRefMap(Collection wtCollOfSandboxRefs, boolean inflateBaselineRefs)
          Gets map from any sandbox containers in the input collection to the corresponding sandbox baselines.
private static Map getSandboxToBaselineRefMapIgnoreLocalCache(Collection wtCollOfSandboxRefs, boolean inflateBaselineRefs)
           
 Set getSandboxWorkingCopySubset(Collection wtColl, boolean excludeTerminalCopies)
          Returns those objects from the input collection that are sandbox working copies.
 Set getSubsetCheckedOutToSandbox(Collection wtColl, WTContainerRef containerRef)
          Returns those objects from the input collection that are checked out to the given sandbox.
private static Set getSubsetWithSuccessorIterations(WTCollection iteratedObjColl)
           
private static Set getSubsetWithWorkingCopyInSandbox(Collection wtColl, WTContainerRef sandboxContainer)
           
 WTSet getWorkingCopies(WTPrincipalReference principal, boolean includePersonalCheckouts)
          Get set of sandbox working copies checked out by a given individual.
 Versioned getWorkingCopyOf(Versioned version)
          Similar to method of the same name in WorkInProgressService.
private  Versioned getWorkingCopyOf(Versioned version, boolean bypassAccessControl)
          Access control by-pass for getWorkingCopyOf(Versioned).
private static Collection getWorkingCopyOriginalCopyPairs(Collection wtColl, boolean lockDatabaseRows, boolean allowWorkingCopyInputs, boolean allowOrigCopyInputs, boolean allowWorkingCopyOutputAsVerRefs)
           
 Map getWorkingCopyToOriginalCopyRefMap(Collection wtColl)
          Get map from any sandbox working copies in the input collection to corresopnding original copies.
 Map getWorkingCopyToOriginalCopyRefMap(Collection wtColl, boolean allowOrigCopyInputs)
          Get map from any sandbox working copies in the input collection to corresopnding original copies.
private static Map getWorkingCopyToOriginalCopyRefMap(Collection wtColl, boolean lockDatabaseRows, boolean allowOrigCopyInputs)
           
private  Map getWorkingCopyToOriginalCopyRefMapNoAcl(Collection wtCollOfWorkingCopies)
           
 boolean isCheckedOutToSandbox(Versioned version, WTContainerRef containerRef)
          Returns whether the given version is checked out to the given sandbox container.
private static boolean isSandboxWorkableClass(Class cls)
           
 boolean isWorkingCopy(Versioned version)
          Returns true if the given version branch was the direct result of a sandbox check-out, i.e.
private static boolean isWorkingCopyBranchId(long versionBranchId)
          Returns true if and only if 'versionBranchId' is the identifier of a sandbox working copy branch.
private static void modifyMastersOf(WTCollection wtColl)
           
static StandardSandboxService newStandardSandboxService()
          Default factory for the class.
private static void nullOutOneOffVersionLabels(WTCollection versions)
           
protected  void performStartupProcess()
          Perform necessary startup processing includoing creating and adding service event listeners to monitor other services' activities where necessary.
 void preCheckinValidate(Map versionRefToInitialCheckinDataMap)
          Attempts to validate InitialCheckinData items within versionRefToInitialCheckinDataMap against each other and existing masters for uniqueness, etc.
 void preCheckinValidate(Map versionRefToInitialCheckinDataMap, InitialCheckinDataApplicator applicator)
          Attempts to validate InitialCheckinData items within versionRefToInitialCheckinDataMap against each other and existing masters for uniqueness, etc.
private  void processMultiPreDeletionEvent(PersistenceManagerEvent preDeleteEvent)
          Since this is called upon pre-deletion, possibly from a flat-line (i.e.
private  void processPreDeletionOfCheckedInCopies(WTCollection interestingObjectsBeingDeleted)
          In concert with UNDO_CHECKIN_HANDLER, when deleting checked-in iterations and not deleting sandbox copy in same transaction and either working copy has no original or original copy is latest, implicitly undo the checkin.
private  void processPreDeletionOfObjectsWithTerminalDescendents(WTCollection sandboxObjectsBeingDeleted)
          If the iterations being deleted have sandbox-terminal iterations associated with them (that is, are superseded by iterations in the sandbox via PDM checkout that have sub- sequently been sent back to PDM and made terminal), we want to delete those terminal iterations associated with them.
private static void processSandboxBaselineableWorkablesAndMasters(Collection wtColl, Utilities.PerClassCollectionProcessorMastersSeparate processor)
           
private static void processSandboxWorkables(Collection wtColl, Utilities.PerClassProcessor processor)
           
private static void processSandboxWorkablesAndMasters(Collection wtColl, Utilities.PerClassCollectionProcessorMastersSeparate processor)
           
 void registerEvents(ManagerService managerService)
          Register events fired/dispatched by this service with the given ManagerService.
private  void removeAllIterationsFromBaseline(Collection baselineableRefColl, WTContainerRef sandboxContainerRef, boolean byVersion, SandboxBaseline inSandboxBaseline)
          For each iteration or master referenced by an element of input collection, remove all iterations with the same master from the sandbox baseline.
 void removeObjects(WTCollection objectsToRemove)
          Remove the given set of objects from the project.
private  void removeObsoleteSharesFromSandboxBaselines(WTCollection shareMapsColl)
           
private static WTSet removeShares(WTSet sharesToRemove, boolean validateAndRefreshRefs)
           
private  void resetControlBranchUntrustedBusinessFields(WTSet set)
          Resets the oneOffVersionId on the ControlBranch to avoid conflicts.
private static void sharePDMCopiesToSandbox(WTValuedMap sandboxCopyToPDMCopyMap, Map sandboxContRefToSandboxCopyRefsMap)
           
private static void swapOneOffVersionLabels(WTValuedMap verToVerMap)
           
 void undoCheckout(WTCollection inputRefs)
          Undo check-out of a set of versioned objects from the sandbox container.
 Set undoCheckout(WTCollection inputRefs, boolean returnOriginalCopies)
          Undo check-out of a set of versioned objects from the sandbox container.
private  Set undoCheckout(WTCollection inputRefs, boolean returnOriginalCopies, boolean shareOriginalToSandbox, boolean skipInitialRefreshAndLock)
           
private  WTSet undoSBCheckouts(WTSet sandboxWorkingCopyRefs, boolean validateAndRefreshRefs)
          Undo the sandbox checkouts indicated by references in 'sandboxWorkingCopyRefs'.
private static WTSet undoWipCheckouts(WTSet wipCheckouts, boolean validateAndRefreshRefs)
           
private static void validateCheckinInputs(WTSet workingCopies, WTKeyedMap initialCheckinToDataMap, WTValuedMap workingToOriginalRefMap, WTKeyedMap sandboxContRefToWorkingCopyRefsMap, WTSet initialCheckinsWithoutData)
           
private  void validateCheckoutInputs(WTCollection wtOrigCopiesSet, WTContainerRef targetContainerRef)
           
private static void validateUndoCheckoutInputs(WTCollection inputRefs, WTValuedMap workingToOriginalRefMap, Map sandboxContRefToWorkingCopyRefsMap)
           
private  void vetoDeletionOfActiveWorkingCopies(WTCollection interestingObjectsBeingDeleted)
           
private  void vetoDeletionOfUnresolvedSandboxBaselineMembers(WTCollection interestingObjectsBeingDeleted)
          Throw a conflict exception if there are non-latest iterations called out in a sandbox baseline.
private static void zeroOutOneOffVersionLabels(WTCollection versions)
           
private static void zeroOutOneOffVersionLabels(WTCollection versions, boolean nullOutRatherThanZeroOut)
          StandardVersionControlService.assignOneOffSeries(), or rather the stored procedure it uses, does not notice one-off-versions unless they are child versions of the main version (e.g.
 
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

INITIAL_SANDBOX_WORKING_COPY_ONE_OFF_VER_LABEL

private static final String INITIAL_SANDBOX_WORKING_COPY_ONE_OFF_VER_LABEL
Though a constant is used for this value it really must be "0" for reasons detailed in zeroOutOneOffVersionLabels().

See Also:
Constant Field Values

METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_KEY

private static final Object METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_KEY
Method context key for WTContainerRef to SandboxBaseline map.


METHOD_CONTEXT_CR_TO_SB_BL_CLEANER_INSTALLED_KEY

private static final Object METHOD_CONTEXT_CR_TO_SB_BL_CLEANER_INSTALLED_KEY
Key for use in map in method context at key METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_KEY for flag indicating whether METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_CLEANER has been installed.


METHOD_CONTEXT_KNOWN_TERMINAL_ITERATIONS_TO_DELETE

private static final Object METHOD_CONTEXT_KNOWN_TERMINAL_ITERATIONS_TO_DELETE
Method context key to tell us to ignore ourselves when we delete terminal predecessor iterations.


METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_CLEANER

private static final StandardSandboxService.MethodContextCleaner METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_CLEANER
Transaction listener to clean up METHOD_CONTEXT_CONT_REF_TO_SB_BASELINE_MAP_KEY at end of transaction.


SANDBOX_COPIES_WITH_CHECKIN_COPIES_BEING_DELETED_KEY

private static final Object SANDBOX_COPIES_WITH_CHECKIN_COPIES_BEING_DELETED_KEY
Transaction map key storing set of sandbox copies whose checkins are being deleted.


UNDO_CHECKIN_HANDLER_INSTALLED_KEY

private static final Object UNDO_CHECKIN_HANDLER_INSTALLED_KEY
Transaction map key storing whether UNDO_CHECKIN_HANDLER has been installed in transaction.


SANDBOX_REMOVE_OBJECTS_KEY

public static final Object SANDBOX_REMOVE_OBJECTS_KEY
Transaction map key containing all the elements to be processed in removeObjects.


UNDO_CHECKIN_HANDLER

private final TransactionCommitListener UNDO_CHECKIN_HANDLER
Works in conjunction with processPreDeletionOfCheckedInCopies(). See comments there.


REQUIRED_SANDBOX_WORKABLE_INTERFACES

private static final Class[] REQUIRED_SANDBOX_WORKABLE_INTERFACES
Array of interfaces which a class must implement in order for it to be "sandbox" checked-in and out by this service.


REQUIRED_SANDBOX_WORKABLE_INTERFACES_PLUS_BASELINEABLE

private static final Class[] REQUIRED_SANDBOX_WORKABLE_INTERFACES_PLUS_BASELINEABLE
Same as REQUIRED_SANDBOX_WORKABLE_INTERFACES but with Baselineable tacked on as well.

Constructor Detail

StandardSandboxService

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

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Perform necessary startup processing includoing creating and adding service event listeners to monitor other services' activities where necessary.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerEvents

public void registerEvents(ManagerService managerService)
Register events fired/dispatched by this service with the given ManagerService.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
managerService - the ManagerService with which to register events.

newStandardSandboxService

public static StandardSandboxService newStandardSandboxService()
                                                        throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardSandboxService
Throws:
WTException

isWorkingCopy

public boolean isWorkingCopy(Versioned version)
                      throws WTException
Returns true if the given version branch was the direct result of a sandbox check-out, i.e. that it is a working copy branch.

See getSandboxWorkingCopySubset() for a multi-object equivalent of this routine.

Supported API: false

Specified by:
isWorkingCopy in interface SandboxService
Parameters:
version - sandbox version to make determination for
Returns:
boolean
Throws:
WTException

getSandboxWorkingCopySubset

public Set getSandboxWorkingCopySubset(Collection wtColl,
                                       boolean excludeTerminalCopies)
                                throws WTException
Returns those objects from the input collection that are sandbox working copies.

When the input Collection is a WTCollection, the actual method result will be a WTSet.

Supported API: false

Specified by:
getSandboxWorkingCopySubset in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
excludeTerminalCopies - Whether TERMINAL (inactive/checked-in) working copies should be excluded.
Returns:
Set
Throws:
WTException

isCheckedOutToSandbox

public boolean isCheckedOutToSandbox(Versioned version,
                                     WTContainerRef containerRef)
                              throws WTException
Returns whether the given version is checked out to the given sandbox container.

See getSubsetCheckedOutToSandbox() for a multi-object equivalent of this routine.

Supported API: false

Specified by:
isCheckedOutToSandbox in interface SandboxService
Parameters:
version - sandbox version to make determination for
containerRef - reference to sandbox container
Returns:
boolean
Throws:
WTException

getSubsetCheckedOutToSandbox

public Set getSubsetCheckedOutToSandbox(Collection wtColl,
                                        WTContainerRef containerRef)
                                 throws WTException
Returns those objects from the input collection that are checked out to the given sandbox.

When the input Collection is a WTCollection, the actual method result will be a WTSet.

Supported API: false

Specified by:
getSubsetCheckedOutToSandbox in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
containerRef - reference to sandbox container
Returns:
Set
Throws:
WTException

getRelatedSandboxRef

public WTContainerRef getRelatedSandboxRef(Versioned originalCopy,
                                           boolean previous)
                                    throws WTException
Given an iteration, returns a reference to the "related" sandbox container. This sandbox is either that to which the iteration has been checked out (if previous is false) or the sandbox from which this iteration was created via a sandbox check-in (if previous is true). Note that this routine does not require read access to either the working copy or sandbox container. This is not really breaking access control as all that is returned is a reference.

See getOriginalsToSandboxesMap() and getCheckinsToSandboxesMap() for multi-object equivalents of this routine.

Supported API: false

Specified by:
getRelatedSandboxRef in interface SandboxService
Parameters:
originalCopy - sandbox checked out to find sandbox for
previous - whether to return the "previous" sandbox (that from which this iteration was formed via a sandbox check-in) or the sandbox to which this iteration has been checked out to
Returns:
WTContainerRef
Throws:
WTException

getOriginalsToSandboxesMap

public Map getOriginalsToSandboxesMap(Collection wtColl)
                               throws WTException
Gets map from any sandbox check out original copies in the input collection to sandboxes containers to which they have been checked out.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input Collection is a WTCollection, the output will be a WTValuedMap.

Supported API: false

Specified by:
getOriginalsToSandboxesMap in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
Returns:
Map
Throws:
WTException

getCheckinsToSandboxesMap

public Map getCheckinsToSandboxesMap(Collection wtColl)
                              throws WTException
Gets map from any sandbox check ins from input collection to sandboxes containers from which they were checked in.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input Collection is a WTCollection, the output will be a WTValuedMap.

Supported API: false

Specified by:
getCheckinsToSandboxesMap in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
Returns:
Map
Throws:
WTException

getOriginalCopyOf

public Versioned getOriginalCopyOf(Versioned version)
                            throws WTException
Similar to method of the same name in WorkInProgressService. Given an iteration on a sandbox checkout branch, this routine returns the original iteration which was checked out to form this branch (i.e. the where this object should be checked back into). Returns null if the given version was created in the sandbox container and has not yet been checked in to an enterprise/PDM container.

See getWorkingCopyToOriginalCopyRefMap() methods for multi-object equivalents of this method.

Supported API: false

Specified by:
getOriginalCopyOf in interface SandboxService
Parameters:
version - sandbox version object
Returns:
Versioned
Throws:
WTException

getWorkingCopyToOriginalCopyRefMap

public Map getWorkingCopyToOriginalCopyRefMap(Collection wtColl)
                                       throws WTException
Get map from any sandbox working copies in the input collection to corresopnding original copies.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input Collection is a WTCollection, the output will be a WTValuedMap.

Supported API: false

Specified by:
getWorkingCopyToOriginalCopyRefMap in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
Returns:
Map
Throws:
WTException

getWorkingCopyToOriginalCopyRefMap

public Map getWorkingCopyToOriginalCopyRefMap(Collection wtColl,
                                              boolean allowOrigCopyInputs)
                                       throws WTException
Get map from any sandbox working copies in the input collection to corresopnding original copies.

This method can optionally navigate for any sandbox original copies as well as working copies in its inputs (and thus including the correspoding working/original copy pair in the results), but in either case the returned map is always strictly from working copies to originals.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input is a WTCollection and 'allowOrigCopyInputs' is false, the output will be a WTValuedMap.

Supported API: false

Specified by:
getWorkingCopyToOriginalCopyRefMap in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
allowOrigCopyInputs - whether method should navigate from original copies in the inputs as well
Returns:
Map
Throws:
WTException

getWorkingCopyOf

public Versioned getWorkingCopyOf(Versioned version)
                           throws WTException
Similar to method of the same name in WorkInProgressService. Given an iteration that has been checked out to a sandbox, this routine will return the working copy iteration in the sandbox (assuming the current user has read access to it).

See getOriginalCopyToWorkingCopyRefMap() methods for multi-object equivalents of this method.

Supported API: false

Specified by:
getWorkingCopyOf in interface SandboxService
Parameters:
version - sandbox version object
Returns:
Versioned
Throws:
WTException

getOriginalCopyToWorkingCopyRefMap

public Map getOriginalCopyToWorkingCopyRefMap(Collection wtColl)
                                       throws WTException
Get map from any sandbox original copies in the input collection to corresopnding working copies.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input Collection is a WTCollection, the output will be a WTValuedMap.

Supported API: false

Specified by:
getOriginalCopyToWorkingCopyRefMap in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
Returns:
Map
Throws:
WTException

getOriginalCopyToWorkingCopyRefMap

public Map getOriginalCopyToWorkingCopyRefMap(Collection wtColl,
                                              boolean allowWorkingCopyInputs)
                                       throws WTException
Get map from any sandbox original copies in the input collection to corresopnding working copies.

This method can optionally navigate from sandbox working copies as well as original copies in its inputs (and thus including the correspoding working/original copy pair in the results), but in either case the returned map is always strictly from working copies to originals.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while resuing the input reference objects. When the input is a WTCollection and 'allowWorkingCopyInputs' is false, the output will be a WTValuedMap.

Supported API: false

Specified by:
getOriginalCopyToWorkingCopyRefMap in interface SandboxService
Parameters:
wtColl - accepts a Collection of WTReferences or a WTCollection
allowWorkingCopyInputs - whether method should navigate from working copies in the inputs as well
Returns:
Map
Throws:
WTException

getSandboxCopyOf

public Versioned getSandboxCopyOf(Versioned version)
                           throws WTException
Given an iteration which resulted from a sandbox check-in, returns the original sandbox iteration -- otherwise returns null.

See getCheckedInCopyToSandboxCopyRefMap() for a multi-object equivalent to this method.

Supported API: false

Specified by:
getSandboxCopyOf in interface SandboxService
Parameters:
version - sandbox version object
Returns:
Versioned
Throws:
WTException

getCheckedInCopyToSandboxCopyRefMap

public Map getCheckedInCopyToSandboxCopyRefMap(Collection wtCollOfCheckedinCopies)
                                        throws WTException
Gets map from any sandbox check ins in the input collection to sandbox copies.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input Collection is a WTCollection, the output will be a WTValuedMap.

Supported API: false

Specified by:
getCheckedInCopyToSandboxCopyRefMap in interface SandboxService
Parameters:
wtCollOfCheckedinCopies - accepts a Collection of WTReferences or a WTCollection
Returns:
Map
Throws:
WTException

getCheckedinCopyOf

public Versioned getCheckedinCopyOf(Versioned version)
                             throws WTException
Given a sandbox iteration that has been checked in returns the resulting checked-in iteration -- otherwise returns null.

See getSandboxCopyToCheckedInCopyRefMap() for a multi-object equivalent to this method.

Supported API: false

Specified by:
getCheckedinCopyOf in interface SandboxService
Parameters:
version - sandbox version object
Returns:
Versioned
Throws:
WTException

getSandboxCopyToCheckedInCopyRefMap

public Map getSandboxCopyToCheckedInCopyRefMap(Collection wtCollOfSandboxCopies)
                                        throws WTException
Get map from any sandbox (inactive working) copies in input collection to corresponding checked-in copies.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input Collection is a WTCollection, the output will be a WTValuedMap.

Supported API: false

Specified by:
getSandboxCopyToCheckedInCopyRefMap in interface SandboxService
Parameters:
wtCollOfSandboxCopies - accepts a Collection of WTReferences or a WTCollection
Returns:
Map
Throws:
WTException

getSandboxBaseline

public SandboxBaseline getSandboxBaseline(WTContainerRef sandboxContainer)
                                   throws WTException
Returns the given sandbox container's baseline.

Note that a given sandbox container may not have an associated baseline and thus the result may be null. Also, note that any additions to the baseline should be made via addToSandboxBaseline() rather than by using the result of this method in a normal baseline addition operation.

See getSandboxToBaselineRefMap() for a multi-object equivalent of this routine.

Supported API: false

Specified by:
getSandboxBaseline in interface SandboxService
Parameters:
sandboxContainer - reference to sandbox container
Returns:
SandboxBaseline
Throws:
WTException

getSandboxToBaselineRefMap

public WTValuedMap getSandboxToBaselineRefMap(Collection wtCollOfSandboxRefs,
                                              boolean inflateBaselineRefs)
                                       throws WTException
Gets map from any sandbox containers in the input collection to the corresponding sandbox baselines.

Supported API: false

Specified by:
getSandboxToBaselineRefMap in interface SandboxService
Parameters:
wtCollOfSandboxRefs - accepts a Collection of WTReferences or a WTCollection
inflateBaselineRefs - whether the resulting sandbox baseline references should be inflated or not
Returns:
WTValuedMap
Throws:
WTException

getSandboxBaselineIteration

public Baselineable getSandboxBaselineIteration(Baselineable baselineable,
                                                WTContainerRef containerRef)
                                         throws WTException
Returns the iteration found in the sandbox baseline for the given object and containerRef.

The sandbox baseline associated to the passed in containerRef is consulted to determine which iteration of the passed in object is in the baseline. If an iteration is found in the baseline it is returned, otherwise the latest iteration of the object is returned.

See getMapToSandboxBaselineIterations() for a multi-object equivalent to this method.

Supported API: false

Specified by:
getSandboxBaselineIteration in interface SandboxService
Parameters:
baselineable - The object for which the sandbox baseline iteration is desired to be found.
containerRef - reference to sandbox container
Returns:
Baselineable
Throws:
WTException

getMapToSandboxBaselineIterations

public Map getMapToSandboxBaselineIterations(Collection wtCollOfBaselineables,
                                             WTContainerRef containerRef,
                                             boolean restrictToSameBranch)
                                      throws WTException
Gets map from any master, iteration, or version in the input collection to the corresponding iteration in the sandbox baseline.

In general, the actual result of this method will be a WTKeyedMap or WTValuedMap where possible while reusing the input reference objects. When the input Collection is a WTCollection, the output will be a WTValuedMap.

Supported API: false

Specified by:
getMapToSandboxBaselineIterations in interface SandboxService
Parameters:
wtCollOfBaselineables - accepts a Collection of WTReferences or a WTCollection
containerRef - reference to sandbox container
restrictToSameBranch - when true only iterations from the same branch as the inputs will be returned
Returns:
Map
Throws:
WTException

getWorkingCopies

public WTSet getWorkingCopies(WTPrincipalReference principal,
                              boolean includePersonalCheckouts)
                       throws WTException
Get set of sandbox working copies checked out by a given individual.

Supported API: false

Specified by:
getWorkingCopies in interface SandboxService
Parameters:
principal - individual in question
includePersonalCheckouts - whether sandbox working copies that are also checked out to the same individual via WIP should be included in the results
Returns:
WTSet
Throws:
WTException

getRefreshCandidates

public Map getRefreshCandidates(WTContainerRef sandboxRef,
                                EPMDocConfigSpec docConfigSpec,
                                WTPartConfigSpec partConfigSpec,
                                boolean isDocCentric)
                         throws WTException
For all objects shared from PDM to Sandbox, returns newer iterations available in PDM.

Returns Map of ObjectReference of shared Iteration in Sandbox as key and new iteration as value.

This method works in two modes, docCentric and partCentric. In docCentric mode, EPMDocuments are refreshed first and latest compatible WTParts are added to refresh Map. Then for any left over WTParts (that are not associated with any EPMDocuments), WTParts are refreshed and added to refresh Map.

In partCentric mode, WTParts are refreshed first and latest compatible EPMDocuments are added to refresh Map. Then for any leftover EPMDocuments (that are not associated with any WTParts), WTParts are refreshed and added to refresh Map.



Supported API: false

Specified by:
getRefreshCandidates in interface SandboxService
Parameters:
sandboxRef - reference to sandbox container
docConfigSpec - EPM document config spec
partConfigSpec - WTPart config spec
isDocCentric - whether navigation should be document or part centric
Returns:
Map
Throws:
WTException

checkout

public void checkout(WTCollection wtOrigCopiesSet,
                     WTContainerRef targetContainerRef,
                     Folder targetFolder,
                     String note)
              throws WTException,
                     WTPropertyVetoException,
                     SandboxValidationException
Check-out a group of versioned objects from the larger enterprise to a sandbox container. Note this differs radically from a wt.vc.wip check-out and is best considered a separate "sandbox" type of check out.

Supported API: false

Specified by:
checkout in interface SandboxService
Parameters:
wtOrigCopiesSet - a collection of objects to be checked out
targetContainerRef - a reference to the container that the versionRefSet will be checked out to
targetFolder - the target folder within the reference container to check out to
note - the note/comment to be provided on checkout
Throws:
WTException
WTPropertyVetoException
SandboxValidationException

checkout

public Map checkout(WTCollection wtOrigCopiesSet,
                    WTContainerRef targetContainerRef,
                    Folder targetFolder,
                    String note,
                    boolean returnCheckedoutVersions)
             throws WTException,
                    WTPropertyVetoException,
                    SandboxValidationException
Check-out a group of versioned objects from the larger enterprise to a sandbox container. Note this differs radically from a wt.vc.wip check-out and is best considered a separate "sandbox" type of check out.

This version of this routine can return a map containing newly checked out and original versions upon request.

Supported API: false

Specified by:
checkout in interface SandboxService
Parameters:
wtOrigCopiesSet - a collection of objects to be checked out
targetContainerRef - a reference to the container that the versionRefSet will be checked out to
targetFolder - the target folder within the reference container to check out to
note - the note/comment to be provided on checkout
returnCheckedoutVersions - whether the routine should return a map with keys of WTReferences to original enterprise versions and values of WTReferences to newly checked-out versions or null (for sake of reduced data transfer between processes)
Returns:
Map
Throws:
WTException
WTPropertyVetoException
SandboxValidationException

undoCheckout

public void undoCheckout(WTCollection inputRefs)
                  throws WTException,
                         WTPropertyVetoException,
                         SandboxValidationException
Undo check-out of a set of versioned objects from the sandbox container. Note this differs radically from a wt.vc.wip undo check-out and is best considered a separate "sandbox" type of undo check out.

Supported API: false

Specified by:
undoCheckout in interface SandboxService
Parameters:
inputRefs - collection of objects to undo the sandbox check out of
Throws:
WTException
WTPropertyVetoException
SandboxValidationException

undoCheckout

public Set undoCheckout(WTCollection inputRefs,
                        boolean returnOriginalCopies)
                 throws WTException,
                        WTPropertyVetoException,
                        SandboxValidationException
Undo check-out of a set of versioned objects from the sandbox container. Note this differs radically from a wt.vc.wip undo check-out and is best considered a separate "sandbox" type of undo check out.

This method can return a set of references to the resulting original copies on request.

Supported API: false

Specified by:
undoCheckout in interface SandboxService
Parameters:
inputRefs - collection of objects to undo the sandbox check out of
returnOriginalCopies - whether to return a set of WTReferences to the original copies or null (to reduce remote data marshalling)
Returns:
Set
Throws:
WTException
WTPropertyVetoException
SandboxValidationException

preCheckinValidate

public void preCheckinValidate(Map versionRefToInitialCheckinDataMap)
                        throws WTException,
                               CheckinUniquenessException
Attempts to validate InitialCheckinData items within versionRefToInitialCheckinDataMap against each other and existing masters for uniqueness, etc. Throws a SandboxException containing further detailed data if issues are found. For instance, for uniqueness violations a CheckinUniquenessException is thrown.

Supported API: false

Specified by:
preCheckinValidate in interface SandboxService
Parameters:
versionRefToInitialCheckinDataMap - a Map (or WTKeyedMap) whose keys are WTReferences to versions to be checked in and whose values are InitialCheckinData objects, for objects created in the sandbox and being newly exposed to the enterprise, or null, for objects being merged back to an existing enterprise version
Throws:
WTException
CheckinUniquenessException

preCheckinValidate

public void preCheckinValidate(Map versionRefToInitialCheckinDataMap,
                               InitialCheckinDataApplicator applicator)
                        throws WTException,
                               CheckinUniquenessException
Attempts to validate InitialCheckinData items within versionRefToInitialCheckinDataMap against each other and existing masters for uniqueness, etc. Throws a SandboxException containing further detailed data if issues are found. For instance, for uniqueness violations a CheckinUniquenessException is thrown.

Supported API: false

Specified by:
preCheckinValidate in interface SandboxService
Parameters:
versionRefToInitialCheckinDataMap - a Map (or WTKeyedMap) whose keys are WTReferences to versions to be checked in and whose values are InitialCheckinData objects, for objects created in the sandbox and being newly exposed to the enterprise, or null, for objects being merged back to an existing enterprise version
applicator - applicator object for InitialCheckinData instances
Throws:
WTException
CheckinUniquenessException

checkin

public void checkin(WTKeyedMap inputRefToInitialCheckinDataMap,
                    String note)
             throws WTException,
                    WTPropertyVetoException,
                    SandboxValidationException
Check-in a group of versioned objects from a sandbox container to the larger enterprise. Note this differs radically from a wt.vc.wip check-in and is best considered a separate "sandbox" type of check in.

Supported API: false

Specified by:
checkin in interface SandboxService
Parameters:
inputRefToInitialCheckinDataMap - a map whose keys are objects to be checked in and whose values are InitialCheckinData objects, for objects created in the sandbox and being newly exposed to the enterprise, or null, for objects being merged back to an existing enterprise version
note - the note/comment to be provided on all new iterations created
Throws:
WTException
WTPropertyVetoException
SandboxValidationException

checkin

public Map checkin(WTKeyedMap inputRefToInitialCheckinDataMap,
                   String note,
                   InitialCheckinDataApplicator applicator,
                   boolean returnCheckedinVersions)
            throws WTException,
                   WTPropertyVetoException,
                   SandboxValidationException
Check-in a group of versioned objects from a sandbox container to the larger enterprise. Note this differs radically from a wt.vc.wip check-in and is best considered a separate "sandbox" type of check in.

This version of this routine allows specification of a custom InitialCheckinData applicator instance and can return a map containing newly checked in and original versions upon request.

Supported API: false

Specified by:
checkin in interface SandboxService
Parameters:
inputRefToInitialCheckinDataMap - a map whose keys are objects to be checked in and whose values are InitialCheckinData objects, for objects created in the sandbox and being newly exposed to the enterprise, or null, for objects being merged back to an existing enterprise version
note - the note/comment to be provided on all new iterations created
applicator - an instance of a sub-class of IntiialCheckinDataApplicator or null; intended to allow custom application of InitialCheckinData including specification of handling of custom subclasses thereof; pass null to obtain default handling of InitialCheckinData
returnCheckedinVersions - whether the routine should return a map with keys of WTReferences to original sandbox versions and values of WTReferences to newly checked-in versions or null (for sake of reduced data transfer between processes)
Returns:
Map
Throws:
WTException
WTPropertyVetoException
SandboxValidationException

addToSandboxBaseline

public SandboxBaseline addToSandboxBaseline(WTCollection wtCollOfBaselineables,
                                            WTContainerRef sandboxContainer)
                                     throws WTException,
                                            SandboxValidationException
Add a collection of baselinables to the SandboxBaseline associated with the given sandbox container.

Note that any iterations passed for which another iteration from the same master is a latest, non-terminal sandbox working iteration will be silently ignored as such iterations should never be added to the sandbox baseline.

Same as calling other version of addToSandboxBaseline() and passing a value of 'true' for the last, i.e. 'replaceEntriesFromSameMasters', argument.

Supported API: false

Specified by:
addToSandboxBaseline in interface SandboxService
Parameters:
wtCollOfBaselineables - collection of baselinable objects to be added to the specified sandbox container's baseline
sandboxContainer - reference to sandbox container
Returns:
SandboxBaseline
Throws:
WTException
SandboxValidationException

addToSandboxBaseline

public SandboxBaseline addToSandboxBaseline(WTCollection wtCollOfBaselineables,
                                            WTContainerRef sandboxContainer,
                                            boolean replaceEntriesFromSameMasters)
                                     throws WTException,
                                            SandboxValidationException
Add a collection of baselinables to the SandboxBaseline associated with the given sandbox container.

Note that any iterations passed for which another iteration from the same master is a latest, non-terminal sandbox working iteration will be silently ignored as such iterations should never be added to the sandbox baseline.

Supported API: false

Specified by:
addToSandboxBaseline in interface SandboxService
Parameters:
wtCollOfBaselineables - collection of baselinable objects to be added to the specified sandbox container's baseline
sandboxContainer - reference to sandbox container
replaceEntriesFromSameMasters - whether entries already in the baseline should be replaced when 'baselineables' contains other iterations from masters with iterations already in 'sandboxContainer's' baseline; if 'false', such entries will be ignored
Returns:
SandboxBaseline
Throws:
WTException
SandboxValidationException

removeObjects

public void removeObjects(WTCollection objectsToRemove)
                   throws WTException,
                          WTPropertyVetoException
Remove the given set of objects from the project. The "remove" operation includes deletion, undo checkout (both WIP and sandbox), and share removal as needed to accomplish the logical effect.

Supported API: false

Specified by:
removeObjects in interface SandboxService
Parameters:
objectsToRemove - set of objects to remove from sandbox
Throws:
WTException
WTPropertyVetoException

getSandboxBaselineRef

private ObjectReference getSandboxBaselineRef(WTContainerRef containerRef)
                                       throws WTException
Simple wrapper for getSandboxToBaselineRefMap().

Throws:
WTException

isWorkingCopyBranchId

private static boolean isWorkingCopyBranchId(long versionBranchId)
                                      throws WTException
Returns true if and only if 'versionBranchId' is the identifier of a sandbox working copy branch.

Throws:
WTException

getIterRefToSandboxRefMap

private static Map getIterRefToSandboxRefMap(QueryResult results,
                                             Map idsToReferences,
                                             int keyMask,
                                             int valueMask)
                                      throws WTException
Throws:
WTException

getWorkingCopyToOriginalCopyRefMap

private static Map getWorkingCopyToOriginalCopyRefMap(Collection wtColl,
                                                      boolean lockDatabaseRows,
                                                      boolean allowOrigCopyInputs)
                                               throws WTException
Throws:
WTException

getOriginalCopyToWorkingCopyRefMap

private static Map getOriginalCopyToWorkingCopyRefMap(Collection wtColl,
                                                      boolean lockDatabaseRows,
                                                      boolean allowWorkingCopyInputs)
                                               throws WTException
Throws:
WTException

getWorkingCopyOriginalCopyPairs

private static Collection getWorkingCopyOriginalCopyPairs(Collection wtColl,
                                                          boolean lockDatabaseRows,
                                                          boolean allowWorkingCopyInputs,
                                                          boolean allowOrigCopyInputs,
                                                          boolean allowWorkingCopyOutputAsVerRefs)
                                                   throws WTException
Throws:
WTException

getSandboxCopyCheckedInCopyPairs

private static Collection getSandboxCopyCheckedInCopyPairs(Collection wtColl,
                                                           boolean inputsAreSandboxCopies)
                                                    throws WTException
Throws:
WTException

getSandboxToBaselineRefMapIgnoreLocalCache

private static Map getSandboxToBaselineRefMapIgnoreLocalCache(Collection wtCollOfSandboxRefs,
                                                              boolean inflateBaselineRefs)
                                                       throws WTException
Throws:
WTException

getMapToBaselineEntries

private static Map getMapToBaselineEntries(Collection wtColl,
                                           long baselineId,
                                           boolean restrictToSameBranch)
                                    throws WTException
Throws:
WTException

getMapToBaselineEntries

private static Map getMapToBaselineEntries(Collection wtColl,
                                           long baselineId,
                                           boolean restrictToSameBranch,
                                           boolean useDummyEntries)
                                    throws WTException
Get map from masters or iteration/versions in wtColl to corresponding entries in baseline (if any). If restrictToSameBranch is true, then for any non-masters in wtColl only corresponding baseline entries in the same branch will be returned.

Throws:
WTException

getOrCreateSandboxBaseline

private SandboxBaseline getOrCreateSandboxBaseline(WTContainerRef sandboxContainerRef)
                                            throws WTException
Throws:
WTException

getSubsetWithWorkingCopyInSandbox

private static Set getSubsetWithWorkingCopyInSandbox(Collection wtColl,
                                                     WTContainerRef sandboxContainer)
                                              throws WTException
Throws:
WTException

getBaselinedSubset

private static Set getBaselinedSubset(Collection wtColl,
                                      long baselineId,
                                      boolean restrictToSameBranch)
                               throws WTException
Get subset of references in 'wcColl' which have an iteration with the same master (when 'restrictToSameBranch' is false) or same branch id (when 'restrictToSameBranch' is true) as an iteration in the specified baseline.

Throws:
WTException

removeObsoleteSharesFromSandboxBaselines

private void removeObsoleteSharesFromSandboxBaselines(WTCollection shareMapsColl)
                                               throws WTException
Throws:
WTException

removeAllIterationsFromBaseline

private void removeAllIterationsFromBaseline(Collection baselineableRefColl,
                                             WTContainerRef sandboxContainerRef,
                                             boolean byVersion,
                                             SandboxBaseline inSandboxBaseline)
                                      throws WTException
For each iteration or master referenced by an element of input collection, remove all iterations with the same master from the sandbox baseline. If 'byVersion' is true, then all iterations from the indicated versions are removed instead for elements of baselineableRefColl which are not references to masters.

If inSandboxBaseline is non-null it will be used under the assumption that it is the sandbox baseline for sandboxContainerRef.

Throws:
WTException

getCorrespondingBaselineEntries

private static Collection getCorrespondingBaselineEntries(Collection wtColl,
                                                          long baselineId,
                                                          boolean restrictToSameBranch)
                                                   throws WTException
Get references to baseline entries which either have the same master (when 'restrictToSameBranch' is false) or same branch id (when 'restrictToSameBranch' is true) as an iteration or master in wtColl. [For masters in wtColl the branch restriction is ignored.]

Throws:
WTException

getContainersWithActiveWorkingCopies

private static WTSet getContainersWithActiveWorkingCopies(WTCollection wtContainerRefColl)
                                                   throws WTException
Throws:
WTException

validateCheckoutInputs

private void validateCheckoutInputs(WTCollection wtOrigCopiesSet,
                                    WTContainerRef targetContainerRef)
                             throws WTException
Throws:
WTException

getObjsWithoutPriv

private static WTSet getObjsWithoutPriv(WTCollection objsToCheck,
                                        AccessPermission permission)
                                 throws WTException
Essentially a multi-object hasAccess() except that inaccessibility audit entries are produced where necessary.

Throws:
WTException

getMastersWithMultiItersInColl

private static WTSet getMastersWithMultiItersInColl(WTCollection iterColl)
                                             throws WTException
Throws:
WTException

undoCheckout

private Set undoCheckout(WTCollection inputRefs,
                         boolean returnOriginalCopies,
                         boolean shareOriginalToSandbox,
                         boolean skipInitialRefreshAndLock)
                  throws WTException,
                         WTPropertyVetoException,
                         SandboxValidationException
Throws:
WTException
WTPropertyVetoException
SandboxValidationException

validateUndoCheckoutInputs

private static void validateUndoCheckoutInputs(WTCollection inputRefs,
                                               WTValuedMap workingToOriginalRefMap,
                                               Map sandboxContRefToWorkingCopyRefsMap)
                                        throws WTException
Throws:
WTException

sharePDMCopiesToSandbox

private static void sharePDMCopiesToSandbox(WTValuedMap sandboxCopyToPDMCopyMap,
                                            Map sandboxContRefToSandboxCopyRefsMap)
                                     throws WTException
Throws:
WTException

addToSandboxBaseline

private void addToSandboxBaseline(Map sandboxToOtherVersionRefMap,
                                  Map contRefToSandboxVersionRefCollMap)
                           throws WTException
Throws:
WTException

getRefreshedLockedWorkingToOrigCopyWTMap

private static WTValuedMap getRefreshedLockedWorkingToOrigCopyWTMap(WTCollection inputRefs,
                                                                    boolean forceObjRefsForOrigCopies)
                                                             throws WTException
produce map from working to original copies, locking both in the process

Throws:
WTException

getOriginalCopiesUserCannotUnlock

private static WTSet getOriginalCopiesUserCannotUnlock(WTValuedMap workingToOriginalRefMap,
                                                       Map sandboxContRefToWorkingCopyRefsMap)
                                                throws WTException
Throws:
WTException

getContainerRefToContainedObjRefMap

private static WTKeyedMap getContainerRefToContainedObjRefMap(Collection refColl)
                                                       throws WTException
Gets map from container refs to collections of version references which are contained by them and refer to objects which are both contained and baselineable.

Throws:
WTException

getSandboxCheckoutlinks

private static WTSet getSandboxCheckoutlinks(WTValuedMap workingToOriginalRefMap)
                                      throws WTException
Throws:
WTException

validateCheckinInputs

private static void validateCheckinInputs(WTSet workingCopies,
                                          WTKeyedMap initialCheckinToDataMap,
                                          WTValuedMap workingToOriginalRefMap,
                                          WTKeyedMap sandboxContRefToWorkingCopyRefsMap,
                                          WTSet initialCheckinsWithoutData)
                                   throws WTException
Throws:
WTException

correctVersionSeries

private static void correctVersionSeries(WTValuedMap workingCopyToInitialCheckinMap)
                                  throws WTException,
                                         WTPropertyVetoException
Fixes the version series on the initial send to PDM. There's something horribly wrong in this method... We're trying to set the new PDM version's series to match that used by the container (the one the project uses may not be correct. BUT, this is all happening outside of the event mechanism, and the normal process is highly dependent on the inner workings of the highly interdependent event mechanism. Specific issues: o To appropriately set the series, we need more than the rule: we need to know the lifecycle o Getting the lifecycle requires more than simply letting the rule set it, the StandardLifeCycleService also must set the state, as part of the PRE_STORE o Oops, we're not in a PRE_STORE, but to there are no public methods to do this using lifecycle APIs

Throws:
WTException
WTPropertyVetoException

applyInitialCheckinData

private static void applyInitialCheckinData(WTKeyedMap initialCheckinWorkingCopyToDataMap,
                                            WTValuedMap workingCopyToInitialCheckinMap,
                                            InitialCheckinDataApplicator applicator)
                                     throws WTException,
                                            WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

modifyMastersOf

private static void modifyMastersOf(WTCollection wtColl)
                             throws WTException
Throws:
WTException

swapOneOffVersionLabels

private static void swapOneOffVersionLabels(WTValuedMap verToVerMap)
                                     throws WTException,
                                            WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

zeroOutOneOffVersionLabels

private static void zeroOutOneOffVersionLabels(WTCollection versions)
                                        throws WTException,
                                               WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

nullOutOneOffVersionLabels

private static void nullOutOneOffVersionLabels(WTCollection versions)
                                        throws WTException,
                                               WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

zeroOutOneOffVersionLabels

private static void zeroOutOneOffVersionLabels(WTCollection versions,
                                               boolean nullOutRatherThanZeroOut)
                                        throws WTException,
                                               WTPropertyVetoException
StandardVersionControlService.assignOneOffSeries(), or rather the stored procedure it uses, does not notice one-off-versions unless they are child versions of the main version (e.g. "A") when looking for existing one-off-version labels to avoid conflicting with, whereas when all is said and done in our use case, 'oneOffVer' will actually be the parent version of newVer. The composite uniqueness constraint in the database and human comprehension both require that the combination of one-off-version label and primary version label be uniquely applied to one branch per master. Given this state of affairs and the narrow use case of a sandbox *project* wherein one-off-versioning is not supported, the best short term approach appears to be to use "0" (via private constant INITIAL_SANDBOX_WORKING_COPY_ONE_OFF_VER_LABEL) as the one-off-version label in all cases. This will have to be revisited if/when one-off-versioning within the sandbox itself is allowed.

Throws:
WTException
WTPropertyVetoException

addWorkableFolderChildren

private void addWorkableFolderChildren(WTSet outputSet,
                                       Collection inputCollection)
                                throws WTException
Throws:
WTException

addWorkableFolderChildren

private void addWorkableFolderChildren(WTSet outputSet,
                                       Folder folder)
                                throws WTException
Throws:
WTException

addOriginalCopyShareRefs

private static void addOriginalCopyShareRefs(WTCollection sandboxWorkingCopyRefs,
                                             WTCollection originalCopyShareRefs,
                                             boolean bypassAccessControl)
                                      throws WTException
Returns a set of references to all version shares which exist for original copies of sandbox working copies referenced by 'sandboxWorkingCopyRefs'.

Throws:
WTException

undoWipCheckouts

private static WTSet undoWipCheckouts(WTSet wipCheckouts,
                                      boolean validateAndRefreshRefs)
                               throws WTException,
                                      WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

undoSBCheckouts

private WTSet undoSBCheckouts(WTSet sandboxWorkingCopyRefs,
                              boolean validateAndRefreshRefs)
                       throws WTException,
                              WTPropertyVetoException
Undo the sandbox checkouts indicated by references in 'sandboxWorkingCopyRefs'. Note this causes undoCheckout() to skip its initial refresh and lock and thus this routine should only be used from removeObjects() [or possibly in other circumstances where one is guaranteed that all objects have already been locked.

Throws:
WTException
WTPropertyVetoException

deleteObjects

private static WTSet deleteObjects(WTSet objectsToDelete,
                                   boolean validateAndRefreshRefs)
                            throws WTException,
                                   WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

removeShares

private static WTSet removeShares(WTSet sharesToRemove,
                                  boolean validateAndRefreshRefs)
                           throws WTException,
                                  WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

processMultiPreDeletionEvent

private void processMultiPreDeletionEvent(PersistenceManagerEvent preDeleteEvent)
                                   throws WTException
Since this is called upon pre-deletion, possibly from a flat-line (i.e. fully single-object operation) within a larger transaction, we must make every effort to return quickly without hitting the database or doing other time consuming operations unless/until we've determined that this is truly necessary.

Throws:
WTException

processPreDeletionOfObjectsWithTerminalDescendents

private void processPreDeletionOfObjectsWithTerminalDescendents(WTCollection sandboxObjectsBeingDeleted)
                                                         throws WTException
If the iterations being deleted have sandbox-terminal iterations associated with them (that is, are superseded by iterations in the sandbox via PDM checkout that have sub- sequently been sent back to PDM and made terminal), we want to delete those terminal iterations associated with them. NOTE: since sending back to PDM will result in a share link, the StandardDataSharingService will (already) have vetoed if the user hasn't already overridden the conflict. BTW: this method does nothing for _masters_ the user may want to delete. Deleting a master causes the StandardVersionControlService to get its latest iterations, which it then deletes, which -- in a second pass through PRE_DELETE -- causes it to find all the non-latest iterations to also delete. This method, therefore, can't itself delete the terminal iteration's branches because the StandardVersionControlService will get around to doing it itself and will get a StaleObjectException in the process. Unfor- tunately, the StandardVersionControlService applies access and will fail if the user does not have access to the terminal iterations. So, currently, this magic happens only when a user requests the deletion of a version. If this is unacceptable, the StandardVersionControlService is going to have to get cozy with terminal iterations; not a pretty/desirable thing.

Throws:
WTException

vetoDeletionOfUnresolvedSandboxBaselineMembers

private void vetoDeletionOfUnresolvedSandboxBaselineMembers(WTCollection interestingObjectsBeingDeleted)
                                                     throws WTException
Throw a conflict exception if there are non-latest iterations called out in a sandbox baseline. wt.inf.sharing provides the fundamental mechanism for sharing versions of objects to the sandbox, which the sandbox embellishes be recording the specific iteration being shared. Thus, the conflict exception thrown by this method is really a finer-grained variant of the sharing service's conflict and should only be thrown if the sharing service has not already vetoed.

Throws:
WTException

vetoDeletionOfActiveWorkingCopies

private void vetoDeletionOfActiveWorkingCopies(WTCollection interestingObjectsBeingDeleted)
                                        throws WTException
Throws:
WTException

processPreDeletionOfCheckedInCopies

private void processPreDeletionOfCheckedInCopies(WTCollection interestingObjectsBeingDeleted)
                                          throws WTException
In concert with UNDO_CHECKIN_HANDLER, when deleting checked-in iterations and not deleting sandbox copy in same transaction and either working copy has no original or original copy is latest, implicitly undo the checkin.

This should possibly be moved later in the deletion process to avoid repeated queries upon flat-lined single-object deletion calls.

Throws:
WTException

getSubsetWithSuccessorIterations

private static Set getSubsetWithSuccessorIterations(WTCollection iteratedObjColl)
                                             throws WTException
Throws:
WTException

couldBeSandboxWorkingCopy

private static boolean couldBeSandboxWorkingCopy(Persistable version,
                                                 boolean doInstanceOfChecks,
                                                 boolean requireLatestActiveIter)
Determines if a given persistable could be a sandbox working copy without hitting the database


couldBeSandboxWorkable

private static boolean couldBeSandboxWorkable(Object obj)

isSandboxWorkableClass

private static boolean isSandboxWorkableClass(Class cls)

processSandboxWorkables

private static void processSandboxWorkables(Collection wtColl,
                                            Utilities.PerClassProcessor processor)
                                     throws WTException
Throws:
WTException

processSandboxWorkablesAndMasters

private static void processSandboxWorkablesAndMasters(Collection wtColl,
                                                      Utilities.PerClassCollectionProcessorMastersSeparate processor)
                                               throws WTException
Throws:
WTException

processSandboxBaselineableWorkablesAndMasters

private static void processSandboxBaselineableWorkablesAndMasters(Collection wtColl,
                                                                  Utilities.PerClassCollectionProcessorMastersSeparate processor)
                                                           throws WTException
Throws:
WTException

getSandboxCopyOf

private Versioned getSandboxCopyOf(Versioned version,
                                   boolean bypassAccessControl)
                            throws WTException
Access control by-pass for getSandboxCopyOf(Versioned).

Throws:
WTException

getWorkingCopyOf

private Versioned getWorkingCopyOf(Versioned version,
                                   boolean bypassAccessControl)
                            throws WTException
Access control by-pass for getWorkingCopyOf(Versioned).

Throws:
WTException

getCorrespondingBaselineEntries

private static Collection getCorrespondingBaselineEntries(Collection wtColl,
                                                          long baselineId,
                                                          boolean restrictToSameBranch,
                                                          boolean bypassAccessControl)
                                                   throws WTException
Access control by-pass for getCorrespondingBaselineEntries(Collection,long,boolean).

Throws:
WTException

getCheckedInCopyToSandboxCopyRefMapNoAcl

private Map getCheckedInCopyToSandboxCopyRefMapNoAcl(Collection wtCollOfCheckedInCopies)
                                              throws WTException
Throws:
WTException

getWorkingCopyToOriginalCopyRefMapNoAcl

private Map getWorkingCopyToOriginalCopyRefMapNoAcl(Collection wtCollOfWorkingCopies)
                                             throws WTException
Throws:
WTException

resetControlBranchUntrustedBusinessFields

private void resetControlBranchUntrustedBusinessFields(WTSet set)
                                                throws WTException
Resets the oneOffVersionId on the ControlBranch to avoid conflicts.

Throws:
WTException