wt.epm.workspaces
Class InitialCheckinDataManager

java.lang.Object
  extended bywt.epm.workspaces.InitialCheckinDataManager

class InitialCheckinDataManager
extends Object

InitialCheckinDataManager is a class that handles all database functions for EPMInitialCheckinData class.

Supported API: false

Extendable: false


Field Summary
private static String EPMRESOURCE
           
 
Constructor Summary
(package private) InitialCheckinDataManager()
           
 
Method Summary
protected static void create(WTCollection newWorkspaceObjects)
          Creates EPMInitialCheckinData for the given list of EPMDocument and WTPart.
protected static void delete(WTCollection baselineables)
          Deletes EPMInitialCheckinData whose new objects are the given baselineables.
protected static WTSet extractNewObjects(WTCollection initialCheckinData)
          Returns the new object role of the given EPMInitialCheckinData objects.
protected static Folder getDefaultFolder(EPMWorkspace workspace, WTContainerRef containerRef, Class object)
          Returns the default folder to where a new object of the given class in the given workspace and container will be checked in.
private static List getFolder(WTCollection objects)
           
protected static Folder getFolderByRule(WTContainerRef containerRef, Class object)
          Given a contained object, gets its default folder.id via the rule service.
private static List getFolderPath(WTCollection cabinetBasedObjects)
           
protected static WTSet getInitialCheckinData(EPMWorkspace workspace)
           
protected static WTSet getInitialCheckinData(WTCollection docsAndParts)
           
protected static WTKeyedMap getNewObjectsTargetLocation(WTKeyedMap targetFolders, EPMWorkspace workspace, WTCollection docsAndParts, boolean returnFolderPath)
          Given a collection of docs and parts, finds the target folder for all new objects.
private static WTCollection getPredecessor(WTCollection iteratedObjects)
           
protected static WTKeyedMap getTargetFolder(WTCollection docsAndParts, boolean returnFolderPath)
          Given a collection of EPMDocument and WTPart, returns a map whose values are the given collection objects, and whose values are their target folders.
private static List getTargetFolderOids(WTCollection initCheckinData)
           
protected static WTKeyedMap getTargetLocation(EPMWorkspace workspace, WTCollection docsAndParts, boolean returnFolderPath)
          Given a list of EPMDocument or WTPart, returns the default target folder location for new objects, the folder to where the objects will be checked in for checked out objects, and the current folder location for any other objects.
private static WTCollection getWorkingCopies(WTCollection workables)
          Given a WTCollection of workable objects, returns a list of working copies.
private static Map indexByNewObject(WTCollection initialCheckinData)
          Sorts the given EPMInitialCheckinData by the new object's key.
private static WTKeyedMap putAll(WTKeyedMap retval, Collection keys, Collection values)
           
protected static void setTargetFolder(WTKeyedMap targetFolders)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPMRESOURCE

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

InitialCheckinDataManager

InitialCheckinDataManager()
Method Detail

create

protected static void create(WTCollection newWorkspaceObjects)
                      throws WTException
Creates EPMInitialCheckinData for the given list of EPMDocument and WTPart.

Throws:
WTException

setTargetFolder

protected static void setTargetFolder(WTKeyedMap targetFolders)
                               throws WTException
Throws:
WTException

getInitialCheckinData

protected static WTSet getInitialCheckinData(WTCollection docsAndParts)
                                      throws WTException
Throws:
WTException

getInitialCheckinData

protected static WTSet getInitialCheckinData(EPMWorkspace workspace)
                                      throws WTException
Throws:
WTException

getTargetFolder

protected static WTKeyedMap getTargetFolder(WTCollection docsAndParts,
                                            boolean returnFolderPath)
                                     throws WTException
Given a collection of EPMDocument and WTPart, returns a map whose values are the given collection objects, and whose values are their target folders. Exception is thrown if one or more of the given objects is not new.

Parameters:
docsAndParts - A collection of objects.
returnFolderPath - returns the folder path if true; returns folder object otherwise.
Returns:
WTKeyedMap Includes all objects in the given collection. If the object passed as argument is not a new object, Null is returned. If the new object does not have a target folder, an ObjectReference whose object is null is returned.
Throws:
WTException

delete

protected static void delete(WTCollection baselineables)
                      throws WTException
Deletes EPMInitialCheckinData whose new objects are the given baselineables.

Throws:
WTException

getTargetFolderOids

private static List getTargetFolderOids(WTCollection initCheckinData)
                                 throws WTException
Throws:
WTException

putAll

private static WTKeyedMap putAll(WTKeyedMap retval,
                                 Collection keys,
                                 Collection values)
                          throws WTException
Throws:
WTException

getNewObjectsTargetLocation

protected static WTKeyedMap getNewObjectsTargetLocation(WTKeyedMap targetFolders,
                                                        EPMWorkspace workspace,
                                                        WTCollection docsAndParts,
                                                        boolean returnFolderPath)
                                                 throws WTException
Given a collection of docs and parts, finds the target folder for all new objects. If the target folder is not specified, finds the default target folder using the same logic of check in from a workspace. Returns the new objects and their target folder in the given map. If returnFolderPath is true, the return value is folder path. Otherwise, it's the Folder object.

Throws:
WTException

getTargetLocation

protected static WTKeyedMap getTargetLocation(EPMWorkspace workspace,
                                              WTCollection docsAndParts,
                                              boolean returnFolderPath)
                                       throws WTException
Given a list of EPMDocument or WTPart, returns the default target folder location for new objects, the folder to where the objects will be checked in for checked out objects, and the current folder location for any other objects. If returnFolderPath is true, the keys of the returned map are the objects and the values are the folder paths. The folder path is a String or an Exception object if the corresponding folder cannot be retrieved, or its path cannot be determined. If returnFolderPath is false, the keys of the returned map are the objects and the values are Folder objects.

Throws:
WTException

getWorkingCopies

private static WTCollection getWorkingCopies(WTCollection workables)
                                      throws WTException
Given a WTCollection of workable objects, returns a list of working copies.

Throws:
WTException

getFolderPath

private static List getFolderPath(WTCollection cabinetBasedObjects)
                           throws WTException
Throws:
WTException

getPredecessor

private static WTCollection getPredecessor(WTCollection iteratedObjects)
                                    throws WTException
Throws:
WTException

getFolder

private static List getFolder(WTCollection objects)
                       throws WTException
Throws:
WTException

getFolderByRule

protected static Folder getFolderByRule(WTContainerRef containerRef,
                                        Class object)
                                 throws WTException
Given a contained object, gets its default folder.id via the rule service.

Returns:
Folder the default folder determined by the rule service based on the container and the class of the contained object.
Throws:
WTException

indexByNewObject

private static Map indexByNewObject(WTCollection initialCheckinData)
                             throws WTException
Sorts the given EPMInitialCheckinData by the new object's key.

Parameters:
initialCheckinData - a collection of EPMInitialCheckinData
Returns:
Map a map indexed by EPMInitialCheckinData's New Object's key.
Throws:
WTException

getDefaultFolder

protected static Folder getDefaultFolder(EPMWorkspace workspace,
                                         WTContainerRef containerRef,
                                         Class object)
                                  throws WTException
Returns the default folder to where a new object of the given class in the given workspace and container will be checked in. If the object class is a WTPart, the default folder is partfolder in workspace. Otherwise, it's the docFolder. If the workspace doc or part folder is null, the default folder is determined via the rule service. The rule service should always return a default folder.

Parameters:
workspace - EPMWorkspace
containerRef - Container
Returns:
Folder The default folder for the given object's class and container in given workspace.
Throws:
WTException

extractNewObjects

protected static WTSet extractNewObjects(WTCollection initialCheckinData)
                                  throws WTException
Returns the new object role of the given EPMInitialCheckinData objects.

Parameters:
initialCheckinData - the list of EPMInitialCheckinData
Returns:
WTSet a set of new object references in the given EPMInitialCheckinData objects.
Throws:
WTException