com.ptc.windchill.cadx.prowtutil
Class FamilyUtilities

java.lang.Object
  extended bycom.ptc.windchill.cadx.prowtutil.FamilyUtilities

public class FamilyUtilities
extends Object


Field Summary
private static String BRANCH_ID
           
private static int CHUNK_SIZE
           
private static int CS
           
private static String FOLDER_ID
           
private static String FOLDER_MEMBER_ID
           
private static String GENERIC_ID
           
private static String INSTANCE_ID
           
private static String LATEST_ITERATION
           
private static String MASTER_ID
           
private static String OBJ_ID
           
private static boolean VERBOSE
           
private static int WORKSPACE
           
private static int WORKSPACE_CS
           
 
Constructor Summary
FamilyUtilities()
           
 
Method Summary
protected static void addDependence(FamilyInfo fam, EPMDocument doc, Map input)
           
protected static void getConfigSpecContent(Map mastersCS, ConfigSpec cs, int contentType, Map content)
          Builds a map of the respective EPMDocuments for the given ConfigSpec.
static ArrayList getEPMDocumentsFromFolderAndConfigSpec(Folder folder, ConfigSpec cs, boolean mergeWithLatest)
          Builds the ArrayList of the EPMDocuments from the given Folder with the given ConfigSpec.
static Map getFamilyInfo(List documents, EPMWorkspace ws, boolean allInfo)
           
static Map getFamilyInfo(List documents, EPMWorkspace ws, boolean allInfo, Folder folder)
           
static Map getFamilyInfo(List documents, EPMWorkspace ws, ConfigSpec cs, boolean allInfo)
           
static Map getFamilyInfo(List documents, EPMWorkspace ws, ConfigSpec cs, boolean allInfo, Folder folder)
           
static Map getFamilyInfo(List documents, EPMWorkspace ws, Map wsContent, ConfigSpec cs, boolean allInfo, Folder folder)
          Retrieve a family info for the given ArrayList of EPMDcouments.
protected static EPMDocument getFromContent(Map content, int contentType, List epms)
          Search the respective EPMDocument among the iterations of given content of workspace/config spec
protected static EPMDocument getFromMultipleChoice(Map mastersCS, EPMWorkspace ws, ConfigSpec cs, Map[] content, boolean[] isFirstContentCall, ArrayList iters)
          Search the respective iteration among the given iterations using the given workspace and ConfigSpec.
protected static Map getGenerics(List docs, boolean allInfo, Map inputDocs, Map wsDocs, Folder folder, Map mastersCS, boolean isPJLWorkspace)
           
static Map getGenericsFromCollection(Collection docs)
           
protected static Map getInstances(List docs, boolean allInfo, Map inputDocs, Map wsDocs, Folder folder, Map mastersCS, boolean isPJLWorkspace)
           
protected static Map getIterationsFromContainedIn(List docs, boolean isGeneric, boolean allInfo, Map inputDocs, Map wsDocs, Folder folder, Map mastersCS, boolean isPJLWorkspace)
          Builds the Map of instance/generic EPMDocuments.
static Map getIterationsFromWorkspace(EPMWorkspace ws)
          Builds the Map of EPMDocuments from given workspace.
protected static EPMDocument getLatest(ArrayList iters)
          Search the latest iteration among the given iterations.
static Map getLatestEPMDocumentsFromFolder(Folder folder)
          Builds the Map of the latest EPMDocuments from the given Folder(Cabinet or SubFolder).
private static boolean isFromProjectContainer(ObjectReference ref)
           
protected static boolean isIgnorableLink(EPMDocument a, EPMDocument b, Map wsDocs, boolean isPJLWorkspace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJ_ID

private static final String OBJ_ID
See Also:
Constant Field Values

INSTANCE_ID

private static final String INSTANCE_ID
See Also:
Constant Field Values

GENERIC_ID

private static final String GENERIC_ID
See Also:
Constant Field Values

FOLDER_ID

private static final String FOLDER_ID
See Also:
Constant Field Values

FOLDER_MEMBER_ID

private static final String FOLDER_MEMBER_ID
See Also:
Constant Field Values

BRANCH_ID

private static final String BRANCH_ID
See Also:
Constant Field Values

LATEST_ITERATION

private static final String LATEST_ITERATION
See Also:
Constant Field Values

MASTER_ID

private static final String MASTER_ID
See Also:
Constant Field Values

WORKSPACE

private static final int WORKSPACE
See Also:
Constant Field Values

WORKSPACE_CS

private static final int WORKSPACE_CS
See Also:
Constant Field Values

CS

private static final int CS
See Also:
Constant Field Values

CHUNK_SIZE

private static int CHUNK_SIZE

VERBOSE

private static boolean VERBOSE
Constructor Detail

FamilyUtilities

public FamilyUtilities()
Method Detail

getFamilyInfo

public static Map getFamilyInfo(List documents,
                                EPMWorkspace ws,
                                boolean allInfo)
                         throws WTException
Throws:
WTException

getFamilyInfo

public static Map getFamilyInfo(List documents,
                                EPMWorkspace ws,
                                ConfigSpec cs,
                                boolean allInfo)
                         throws WTException
Throws:
WTException

getFamilyInfo

public static Map getFamilyInfo(List documents,
                                EPMWorkspace ws,
                                boolean allInfo,
                                Folder folder)
                         throws WTException
Throws:
WTException

getFamilyInfo

public static Map getFamilyInfo(List documents,
                                EPMWorkspace ws,
                                ConfigSpec cs,
                                boolean allInfo,
                                Folder folder)
                         throws WTException
Throws:
WTException

getFamilyInfo

public static Map getFamilyInfo(List documents,
                                EPMWorkspace ws,
                                Map wsContent,
                                ConfigSpec cs,
                                boolean allInfo,
                                Folder folder)
                         throws WTException
Retrieve a family info for the given ArrayList of EPMDcouments.

Parameters:
allInfo -
folder -
Returns:
Map, where: key is standalone, generic or instance EPMDocument value is a respective FamilyInfo object
Throws:
WTException

addDependence

protected static void addDependence(FamilyInfo fam,
                                    EPMDocument doc,
                                    Map input)

getGenerics

protected static Map getGenerics(List docs,
                                 boolean allInfo,
                                 Map inputDocs,
                                 Map wsDocs,
                                 Folder folder,
                                 Map mastersCS,
                                 boolean isPJLWorkspace)
                          throws WTException
Throws:
WTException

getInstances

protected static Map getInstances(List docs,
                                  boolean allInfo,
                                  Map inputDocs,
                                  Map wsDocs,
                                  Folder folder,
                                  Map mastersCS,
                                  boolean isPJLWorkspace)
                           throws WTException
Throws:
WTException

getIterationsFromContainedIn

protected static Map getIterationsFromContainedIn(List docs,
                                                  boolean isGeneric,
                                                  boolean allInfo,
                                                  Map inputDocs,
                                                  Map wsDocs,
                                                  Folder folder,
                                                  Map mastersCS,
                                                  boolean isPJLWorkspace)
                                           throws WTException
Builds the Map of instance/generic EPMDocuments.

Parameters:
isGeneric -
allInfo -
Returns:
Map, where: key - generic/instance iteration ObjectIdentifier value - ArrayList with compatible instances/generics
Throws:
WTException

getIterationsFromWorkspace

public static Map getIterationsFromWorkspace(EPMWorkspace ws)
                                      throws WTException
Builds the Map of EPMDocuments from given workspace.

Returns:
Map, where keys are ObjectIdentifiers of found documents
Throws:
WTException

getFromContent

protected static EPMDocument getFromContent(Map content,
                                            int contentType,
                                            List epms)
                                     throws WTException
Search the respective EPMDocument among the iterations of given content of workspace/config spec

Parameters:
content - type
Returns:
the respective EPMDocument
Throws:
WTException

getConfigSpecContent

protected static void getConfigSpecContent(Map mastersCS,
                                           ConfigSpec cs,
                                           int contentType,
                                           Map content)
                                    throws WTException
Builds a map of the respective EPMDocuments for the given ConfigSpec.

Parameters:
content - type
Throws:
WTException

getLatest

protected static EPMDocument getLatest(ArrayList iters)
Search the latest iteration among the given iterations.

Returns:
the latest EPMDocument

getFromMultipleChoice

protected static EPMDocument getFromMultipleChoice(Map mastersCS,
                                                   EPMWorkspace ws,
                                                   ConfigSpec cs,
                                                   Map[] content,
                                                   boolean[] isFirstContentCall,
                                                   ArrayList iters)
                                            throws WTException
Search the respective iteration among the given iterations using the given workspace and ConfigSpec.

Parameters:
content - map
isFirstContentCall -
Returns:
the respective EPMDocument
Throws:
WTException

isIgnorableLink

protected static boolean isIgnorableLink(EPMDocument a,
                                         EPMDocument b,
                                         Map wsDocs,
                                         boolean isPJLWorkspace)

getLatestEPMDocumentsFromFolder

public static Map getLatestEPMDocumentsFromFolder(Folder folder)
                                           throws WTException
Builds the Map of the latest EPMDocuments from the given Folder(Cabinet or SubFolder).

Parameters:
folder -
Returns:
Map, where: key - master ObjectIdentifier value - the latest iteration
Throws:
WTException

getEPMDocumentsFromFolderAndConfigSpec

public static ArrayList getEPMDocumentsFromFolderAndConfigSpec(Folder folder,
                                                               ConfigSpec cs,
                                                               boolean mergeWithLatest)
                                                        throws WTException
Builds the ArrayList of the EPMDocuments from the given Folder with the given ConfigSpec.

Parameters:
folder -
Returns:
ArrayList
Throws:
WTException

getGenericsFromCollection

public static Map getGenericsFromCollection(Collection docs)
                                     throws WTException
Throws:
WTException

isFromProjectContainer

private static boolean isFromProjectContainer(ObjectReference ref)