wt.epm.workspaces
Class WorkspaceCheckoutManager

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

class WorkspaceCheckoutManager
extends Object

WorkspaceCheckoutManager provides functionality to checkout EPMDocument, WTPart to EPMWorkspace. WorkspaceCheckout uses WorkInProgressService.checkout but in addition it support checkout of non latest iterations of EPMDocuments and checkout of family tables.

Supported API: false

Extendable: false


Field Summary
static boolean logTime
           
 
Constructor Summary
(package private) WorkspaceCheckoutManager()
           
 
Method Summary
(package private) static WTValuedMap checkout(EPMWorkspace workspace, WTCollection toCheckout, String comment)
          Checks out the given collection of EPMDocuments and WTParts to the specified workspace.
private static void copyContentItems(WTValuedMap prevToWorkingMap)
          Copies content Items from non Latest original to current working copy.
private static void copyEPMData(EPMWorkspace workspace, WTValuedMap prevToWorkingMap, WTCollection selectedFTS)
          Copys EPM data from previous iterations to Working copies EPM Data includes - IBA, EPM ND Data and contents
private static WTValuedMap getCheckedOutFamilyTables(WTCollection documents)
           
private static WTValuedMap getCompatibleFTMap(EPMWorkspace workspace, WTCollection documents, WTCollection selectedFTS)
          Returns compatible family tables for given documents.
private static void getFamilyTableCheckOutResult(EPMNewIterationDataContainer container, Map result, WTCollection familytables)
          Returns family table checkout result map
private static WTValuedMap getLatestIterations(WTCollection iterations)
          Returns latest iterations having same branchid as the given Iteration
private static void groupOriginals(WTCollection originals, WTCollection latestWorkables, WTCollection nonLatestDocuments, WTCollection familyTables)
          Seperates originals into four groups.
private static void isNonLatestConflictOverridden(EPMWorkspace workspace, WTCollection documents)
          Verify if user has specified to override NONLATEST_ITERATION_CHECKOUT conflict
private static EPMNewIterationDataContainer putFTCheckoutInfo(EPMWorkspace workspace, WTCollection latestWorkables, WTCollection latestFamilytables, WTValuedMap latestNonlatestMap)
          Puts objects that are getting checked out in Method context
private static WTCollection readContents(WTCollection holders)
           
private static void setTypeDefinitionForNonLatest(WTValuedMap prevToWorkingMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logTime

public static boolean logTime
Constructor Detail

WorkspaceCheckoutManager

WorkspaceCheckoutManager()
Method Detail

checkout

static WTValuedMap checkout(EPMWorkspace workspace,
                            WTCollection toCheckout,
                            String comment)
                     throws WTException,
                            ConflictException
Checks out the given collection of EPMDocuments and WTParts to the specified workspace. Collection may include non Latest EPMDocuments.

ConflictException of type EPMConflictType.NONLATEST_ITERATION_CHECKOUT is thrown for non latest iteration of EPMDocuments. This conflict can be overriden by specifying EPMResolutionType#ALLOW_NONLATEST_ITERATION_CHECKOUT resolution type.

Supported API: false

Parameters:
workspace -
toCheckout - A collection of objects and familyTables to be checked out.
comment - Checkout comment
Returns:
WTValuedMap where key is checked out object and value is working copy.
Throws:
ConflictException - of type EPMConflictType.NONLATEST_ITERATION_CHECKOUT.
WTException

isNonLatestConflictOverridden

private static void isNonLatestConflictOverridden(EPMWorkspace workspace,
                                                  WTCollection documents)
                                           throws ConflictException,
                                                  WTException
Verify if user has specified to override NONLATEST_ITERATION_CHECKOUT conflict

Parameters:
documents - WTCollection
Throws:
ConflictException - if one or more documents do not have resolution specified
WTException

copyEPMData

private static void copyEPMData(EPMWorkspace workspace,
                                WTValuedMap prevToWorkingMap,
                                WTCollection selectedFTS)
                         throws WTException
Copys EPM data from previous iterations to Working copies EPM Data includes - IBA, EPM ND Data and contents

Throws:
WTException

setTypeDefinitionForNonLatest

private static void setTypeDefinitionForNonLatest(WTValuedMap prevToWorkingMap)
                                           throws WTException
Throws:
WTException

getCheckedOutFamilyTables

private static WTValuedMap getCheckedOutFamilyTables(WTCollection documents)
                                              throws WTException
Throws:
WTException

getCompatibleFTMap

private static WTValuedMap getCompatibleFTMap(EPMWorkspace workspace,
                                              WTCollection documents,
                                              WTCollection selectedFTS)
                                       throws WTException
Returns compatible family tables for given documents. If there are more than one compatible family tables, prefers family tables in selectedFTs or workspace.

Parameters:
workspace - EPMWorkspace
documents - WTCollection
selectedFTS - WTCollection
Returns:
WTValuedMap where master is key and family table in value
Throws:
WTException

copyContentItems

private static void copyContentItems(WTValuedMap prevToWorkingMap)
                              throws WTException
Copies content Items from non Latest original to current working copy. Only Content holders which are specified nonLatestOriginals are

Throws:
WTException

readContents

private static WTCollection readContents(WTCollection holders)
                                  throws WTException,
                                         PropertyVetoException
Throws:
WTException
PropertyVetoException

getLatestIterations

private static WTValuedMap getLatestIterations(WTCollection iterations)
                                        throws WTException
Returns latest iterations having same branchid as the given Iteration

Returns:
WTValuedMap key is latest Iteration and value is input iteration
Throws:
WTException

groupOriginals

private static void groupOriginals(WTCollection originals,
                                   WTCollection latestWorkables,
                                   WTCollection nonLatestDocuments,
                                   WTCollection familyTables)
                            throws WTException
Seperates originals into four groups.

Parameters:
originals - [IN] Original documents
latestWorkables - [OUT] latest documents and parts
nonLatestDocuments - [OUT] non latest EPMDocuments
familyTables - [OUT]
Throws:
WTException

putFTCheckoutInfo

private static EPMNewIterationDataContainer putFTCheckoutInfo(EPMWorkspace workspace,
                                                              WTCollection latestWorkables,
                                                              WTCollection latestFamilytables,
                                                              WTValuedMap latestNonlatestMap)
                                                       throws WTException
Puts objects that are getting checked out in Method context

Parameters:
workspace - EPMWorkspace
latestWorkables - WTCollection
latestFamilytables - WTCollection
Returns:
boolean - is cleanup needed?
Throws:
WTException

getFamilyTableCheckOutResult

private static void getFamilyTableCheckOutResult(EPMNewIterationDataContainer container,
                                                 Map result,
                                                 WTCollection familytables)
                                          throws WTException
Returns family table checkout result map

Throws:
WTException