wt.epm.familytable
Class EPMNewIterationDataContainer

java.lang.Object
  extended bywt.epm.familytable.EPMNewIterationDataContainer
Direct Known Subclasses:
EPMSandboxUndoCheckoutDataContainer

public class EPMNewIterationDataContainer
extends Object


Nested Class Summary
 class EPMNewIterationDataContainer.icCheckoutOperationAdapter
           
 class EPMNewIterationDataContainer.icDefaultOperationAdapter
           
 class EPMNewIterationDataContainer.icOperationAdapter
           
 class EPMNewIterationDataContainer.icSandboxCheckinOperationAdapter
           
 class EPMNewIterationDataContainer.icSandboxCheckoutOperationAdapter
           
 
Field Summary
private static String EPMRESOURCE
           
(package private)  Collection m_allDocs
           
private  WTContainerRef m_containerRef
           
(package private)  Collection m_familyTables
           
(package private)  Collection m_familyTablesNotToCopy
           
(package private)  WTValuedMap m_latestNonLatestMap
           
private  EPMNewIterationDataContainer.icOperationAdapter m_operationAdapter
           
(package private)  HashMap m_originalIdToTargetDoc
           
(package private)  HashMap m_originalIdToTargetFT
           
(package private)  ArrayList m_originalWithoutTargetDocIds
           
(package private)  ArrayList m_orphanDocIds
           
private  EPMWorkspace m_workspace
           
static int MODE_CHECKOUT
           
static int MODE_SANDBOX_CHECKIN
           
static int MODE_SANDBOX_CHECKOUT
           
static int MODE_UNKNOWN
           
private  boolean possibleUnregisteredFTFlag
           
 
Constructor Summary
EPMNewIterationDataContainer(Collection workables, Collection initFamilyTables)
           
EPMNewIterationDataContainer(Collection workables, Collection initFamilyTables, int mode)
           
EPMNewIterationDataContainer(EPMWorkspace workspace, Collection workables, Collection initFamilyTablesToCheckout)
           
EPMNewIterationDataContainer(EPMWorkspace workspace, Collection workables, Collection initFamilyTables, int mode)
           
EPMNewIterationDataContainer(EPMWorkspace workspace, Collection workables, Collection initFamilyTables, WTValuedMap latestNonLatestMap, int mode)
           
EPMNewIterationDataContainer(WTContainerRef containerRef, Collection workables, Collection initFamilyTables, int mode)
           
 
Method Summary
 void addDocument(EPMDocument workable)
           
 void addDocuments(Collection workables)
           
private  void cleanupOrphanDocs(Collection orphanDocIds, Collection famTables)
           
private  void copyFamilyTables()
           
 void copyFamilyTablesWithVariantLinks()
           
 void copyOrphanedVariantLinks()
          It is possible that EPMDocument has VariantLinks but does not belong to any FT (eCad data model for example) It is not good, but let's support this situation
private static WTCollection getCompatibleFTCollection(EPMWorkspace workspace, Collection documents)
          Returns compatible family tables for given documents.
 EPMNonoverridableConflicts getConflicts()
           
 WTContainerRef getContainerRef()
           
 Collection getDocs()
           
 Collection getFamilyTables()
           
private static Collection getFTFromWorkspace(EPMWorkspace ws, Collection memberIds, boolean addLatestCompatibleIfNothingInWS)
           
private static WTCollection getLatestIterations(Collection familyTables, WTValuedMap latestToCompatibleFT)
           
 int getMode()
           
 EPMNewIterationDataContainer.icOperationAdapter getOperationAdapter()
           
 HashMap getOriginalIdToTargetFTMap()
           
 ObjectIdentifier getOriginalObjectIdConsideringNonlatests(EPMDocument target)
          Usually this method just returns predecessor’s ObjectId, but in case of nonlatest checkout it also checks for nonlatest iteration of given document and returns its ObjectId if found.
 EPMWorkspace getWorkspace()
           
private  void initCleanupOrphanDocListAndAddFT(ArrayList orphanDocIds)
           
private  void initCollections(Collection workables, Collection initFamilyTables)
           
 boolean isFamilyTableConflicts()
           
private  boolean isNeedToCopyFamilyTables()
           
 boolean isNeedToCopyFamilyTablesOrVariantLinks()
           
private  boolean isNeedToCopyVariantLinks()
           
private  boolean isNonlatestCompatible()
          This method is doing compatibility check during nonlatest checkout.
 boolean isReadyToCopyFamilyTables()
           
 void moveFTLinks()
          Sometimes (for example for checked out family tables) instead of copying entire Family Table we must just move link from existing FT to new iteration of EPMDocument
 void registerMoreFamilyTables(Collection orphanDocIds)
           
 void registerMoreFamilyTables(Collection orphanDocIds, boolean checkExisting)
           
private  void registerMoreFamilyTablesIfNeeded()
           
private  void setLatestNonlatestMap(WTValuedMap latestNonLatestMap)
           
 void setMode(int mode)
           
protected  void setOperationAdapter(EPMNewIterationDataContainer.icOperationAdapter adapter)
           
 void setTargetDocument(EPMDocument original, EPMDocument target)
           
 void setWorkspace(EPMWorkspace ws)
           
 
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

MODE_UNKNOWN

public static final int MODE_UNKNOWN
See Also:
Constant Field Values

MODE_CHECKOUT

public static final int MODE_CHECKOUT
See Also:
Constant Field Values

MODE_SANDBOX_CHECKOUT

public static final int MODE_SANDBOX_CHECKOUT
See Also:
Constant Field Values

MODE_SANDBOX_CHECKIN

public static final int MODE_SANDBOX_CHECKIN
See Also:
Constant Field Values

m_operationAdapter

private EPMNewIterationDataContainer.icOperationAdapter m_operationAdapter

possibleUnregisteredFTFlag

private boolean possibleUnregisteredFTFlag

m_workspace

private EPMWorkspace m_workspace

m_containerRef

private WTContainerRef m_containerRef

m_familyTables

Collection m_familyTables

m_familyTablesNotToCopy

Collection m_familyTablesNotToCopy

m_originalIdToTargetFT

HashMap m_originalIdToTargetFT

m_allDocs

Collection m_allDocs

m_orphanDocIds

ArrayList m_orphanDocIds

m_originalIdToTargetDoc

HashMap m_originalIdToTargetDoc

m_originalWithoutTargetDocIds

ArrayList m_originalWithoutTargetDocIds

m_latestNonLatestMap

WTValuedMap m_latestNonLatestMap
Constructor Detail

EPMNewIterationDataContainer

public EPMNewIterationDataContainer(Collection workables,
                                    Collection initFamilyTables)
                             throws WTException

EPMNewIterationDataContainer

public EPMNewIterationDataContainer(Collection workables,
                                    Collection initFamilyTables,
                                    int mode)
                             throws WTException

EPMNewIterationDataContainer

public EPMNewIterationDataContainer(EPMWorkspace workspace,
                                    Collection workables,
                                    Collection initFamilyTablesToCheckout)
                             throws WTException

EPMNewIterationDataContainer

public EPMNewIterationDataContainer(EPMWorkspace workspace,
                                    Collection workables,
                                    Collection initFamilyTables,
                                    int mode)
                             throws WTException

EPMNewIterationDataContainer

public EPMNewIterationDataContainer(EPMWorkspace workspace,
                                    Collection workables,
                                    Collection initFamilyTables,
                                    WTValuedMap latestNonLatestMap,
                                    int mode)
                             throws WTException

EPMNewIterationDataContainer

public EPMNewIterationDataContainer(WTContainerRef containerRef,
                                    Collection workables,
                                    Collection initFamilyTables,
                                    int mode)
                             throws WTException
Method Detail

initCollections

private void initCollections(Collection workables,
                             Collection initFamilyTables)
                      throws WTException
Throws:
WTException

setLatestNonlatestMap

private void setLatestNonlatestMap(WTValuedMap latestNonLatestMap)

getLatestIterations

private static WTCollection getLatestIterations(Collection familyTables,
                                                WTValuedMap latestToCompatibleFT)
                                         throws WTException
Throws:
WTException

addDocuments

public void addDocuments(Collection workables)
                  throws WTException
Throws:
WTException

addDocument

public void addDocument(EPMDocument workable)
                 throws WTException
Throws:
WTException

setTargetDocument

public void setTargetDocument(EPMDocument original,
                              EPMDocument target)
                       throws WTException
Throws:
WTException

getOriginalObjectIdConsideringNonlatests

public ObjectIdentifier getOriginalObjectIdConsideringNonlatests(EPMDocument target)
                                                          throws WTException
Usually this method just returns predecessor’s ObjectId, but in case of nonlatest checkout it also checks for nonlatest iteration of given document and returns its ObjectId if found.

Parameters:
target - -EPMDocument
Returns:
ObjectIdentifier
Throws:
WTException

isReadyToCopyFamilyTables

public boolean isReadyToCopyFamilyTables()

isNeedToCopyFamilyTablesOrVariantLinks

public boolean isNeedToCopyFamilyTablesOrVariantLinks()
                                               throws WTException
Throws:
WTException

isNeedToCopyFamilyTables

private boolean isNeedToCopyFamilyTables()
                                  throws WTException
Throws:
WTException

isNeedToCopyVariantLinks

private boolean isNeedToCopyVariantLinks()
                                  throws WTException
Throws:
WTException

copyFamilyTablesWithVariantLinks

public void copyFamilyTablesWithVariantLinks()
                                      throws WTException
Throws:
WTException

copyFamilyTables

private void copyFamilyTables()
                       throws WTException
Throws:
WTException

moveFTLinks

public void moveFTLinks()
                 throws WTException
Sometimes (for example for checked out family tables) instead of copying entire Family Table we must just move link from existing FT to new iteration of EPMDocument

Throws:
WTException

copyOrphanedVariantLinks

public void copyOrphanedVariantLinks()
                              throws WTException
It is possible that EPMDocument has VariantLinks but does not belong to any FT (eCad data model for example) It is not good, but let's support this situation

Throws:
WTException

isFamilyTableConflicts

public boolean isFamilyTableConflicts()
                               throws WTException
Throws:
WTException

getConflicts

public EPMNonoverridableConflicts getConflicts()

getDocs

public Collection getDocs()

getFamilyTables

public Collection getFamilyTables()

getOriginalIdToTargetFTMap

public HashMap getOriginalIdToTargetFTMap()

getWorkspace

public EPMWorkspace getWorkspace()

getContainerRef

public WTContainerRef getContainerRef()

setWorkspace

public void setWorkspace(EPMWorkspace ws)

registerMoreFamilyTables

public void registerMoreFamilyTables(Collection orphanDocIds)
                              throws WTException
Throws:
WTException

registerMoreFamilyTables

public void registerMoreFamilyTables(Collection orphanDocIds,
                                     boolean checkExisting)
                              throws WTException
Throws:
WTException

setMode

public void setMode(int mode)
             throws WTException
Throws:
WTException

getMode

public int getMode()
            throws WTException
Throws:
WTException

getOperationAdapter

public EPMNewIterationDataContainer.icOperationAdapter getOperationAdapter()
                                                                    throws WTException
Throws:
WTException

setOperationAdapter

protected void setOperationAdapter(EPMNewIterationDataContainer.icOperationAdapter adapter)
                            throws WTException
Throws:
WTException

initCleanupOrphanDocListAndAddFT

private void initCleanupOrphanDocListAndAddFT(ArrayList orphanDocIds)
                                       throws WTException
Throws:
WTException

cleanupOrphanDocs

private void cleanupOrphanDocs(Collection orphanDocIds,
                               Collection famTables)
                        throws WTException
Throws:
WTException

registerMoreFamilyTablesIfNeeded

private void registerMoreFamilyTablesIfNeeded()
                                       throws WTException
Throws:
WTException

getFTFromWorkspace

private static Collection getFTFromWorkspace(EPMWorkspace ws,
                                             Collection memberIds,
                                             boolean addLatestCompatibleIfNothingInWS)
                                      throws WTException
Throws:
WTException

isNonlatestCompatible

private boolean isNonlatestCompatible()
                               throws WTException
This method is doing compatibility check during nonlatest checkout.

Returns:
boolean
Throws:
WTException

getCompatibleFTCollection

private static WTCollection getCompatibleFTCollection(EPMWorkspace workspace,
                                                      Collection documents)
                                               throws WTException
Returns compatible family tables for given documents. If there are more than one compatible family tables, prefers family tables in workspace.

Parameters:
workspace - EPMWorkspace
documents - WTCollection
Returns:
WTCollection of compatible family tables
Throws:
WTException