com.ptc.windchill.cadx.common
Class WTPartUtilities

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.WTPartUtilities

public class WTPartUtilities
extends Object


Field Summary
private static String EPM_APP_TYPE
           
private static boolean VERBOSE
           
private static String WORKSPACE_NEWPARTFOLDERDATA
           
 
Constructor Summary
WTPartUtilities()
           
 
Method Summary
private static void addPartsToFolderData(EPMWorkspace workspace, WTPart[] parts, String[] folderOIDs)
          This method adds Part to the Vector
static WTPart createNewPart(String a_PartNumber, String a_PartName, PartType a_PartType, String a_folderOID, EPMWorkspace a_CurrentWS, WTOrganization org, WTContainer container, Source a_source, QuantityUnit a_defaultUnits)
           
static WTPart createNewPart(String a_PartNumber, String a_PartName, PartType a_PartType, String a_folderOID, EPMWorkspace a_CurrentWS, WTOrganization org, WTContainer container, Source a_source, QuantityUnit a_defaultUnits, boolean deferSaving)
           
static boolean doesPartExist(String partNumber)
           
static boolean doesPartExist(String partNumber, WTContainer cnt1)
           
static String getBaseIconImage(WTPart part)
           
static Vector getFolderData(EPMWorkspace workspace)
          This method returns objects containing the folder data from the workspace.
static String[] getFolderDataforParts(EPMWorkspace workspace, WTPart[] parts)
          This method gets Location for Parts from the Vector
static WTPart getWTPart(String number)
          This convenience method finds a part based on its unique number using the latest config spec
static WTPart getWTPart(String number, ConfigSpec configSpec)
          This method finds a part based on its unique number and the config spec.
static WTPart getWTPart(String partNumber, ConfigSpec configSpec, WTContainer container, String custClassString, EPMDocument document, boolean onlyInOrgOfDoc)
           
static WTPart getWTPartInContainers(String partNumber, ConfigSpec configSpec, WTContainerRef[] containersToSearchRefs, boolean isPDMLinkContainer, boolean isPJLContainer, String custClassString, EPMDocument document, boolean onlyInOrgOfDoc)
           
private static QueryResult reArrangeMasters(QueryResult partMasters, WTContainer container)
           
static void removePartsFromFolderData(EPMWorkspace workspace, WTPart[] parts)
          This method removes Parts from the Vector (containing objects which have been moved to itended folders) and then persists the modified Vector.
static void saveFolderData(EPMWorkspace workspace, Vector newPartFolderData)
          This method saves the new part's folder information with wokspace.
static QueryResult searchWTParts(String searchName, String searchNumber, String searchLocation, boolean onlyLatest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORKSPACE_NEWPARTFOLDERDATA

private static final String WORKSPACE_NEWPARTFOLDERDATA
See Also:
Constant Field Values

EPM_APP_TYPE

private static final String EPM_APP_TYPE
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE
See Also:
Constant Field Values
Constructor Detail

WTPartUtilities

public WTPartUtilities()
Method Detail

searchWTParts

public static QueryResult searchWTParts(String searchName,
                                        String searchNumber,
                                        String searchLocation,
                                        boolean onlyLatest)
                                 throws QueryException,
                                        WTException
Throws:
QueryException
WTException

createNewPart

public static WTPart createNewPart(String a_PartNumber,
                                   String a_PartName,
                                   PartType a_PartType,
                                   String a_folderOID,
                                   EPMWorkspace a_CurrentWS,
                                   WTOrganization org,
                                   WTContainer container,
                                   Source a_source,
                                   QuantityUnit a_defaultUnits)
                            throws WTException,
                                   WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

createNewPart

public static WTPart createNewPart(String a_PartNumber,
                                   String a_PartName,
                                   PartType a_PartType,
                                   String a_folderOID,
                                   EPMWorkspace a_CurrentWS,
                                   WTOrganization org,
                                   WTContainer container,
                                   Source a_source,
                                   QuantityUnit a_defaultUnits,
                                   boolean deferSaving)
                            throws WTException,
                                   WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

doesPartExist

public static boolean doesPartExist(String partNumber)
                             throws WTException
Throws:
WTException

doesPartExist

public static boolean doesPartExist(String partNumber,
                                    WTContainer cnt1)
                             throws WTException
Throws:
WTException

getBaseIconImage

public static String getBaseIconImage(WTPart part)

saveFolderData

public static void saveFolderData(EPMWorkspace workspace,
                                  Vector newPartFolderData)
                           throws WTPropertyVetoException,
                                  WTException
This method saves the new part's folder information with wokspace.

Throws:
WTException - ,wt.util.WTPropertyVetoException
WTPropertyVetoException

getFolderData

public static Vector getFolderData(EPMWorkspace workspace)
                            throws WTException
This method returns objects containing the folder data from the workspace.

Throws:
WTException

removePartsFromFolderData

public static void removePartsFromFolderData(EPMWorkspace workspace,
                                             WTPart[] parts)
                                      throws WTException,
                                             WTPropertyVetoException
This method removes Parts from the Vector (containing objects which have been moved to itended folders) and then persists the modified Vector.

Throws:
wt.util.WTException, - wt.util.WTPropertyVetoException
WTException
WTPropertyVetoException

addPartsToFolderData

private static void addPartsToFolderData(EPMWorkspace workspace,
                                         WTPart[] parts,
                                         String[] folderOIDs)
                                  throws WTException,
                                         WTPropertyVetoException
This method adds Part to the Vector

Throws:
WTException - ,wt.util.WTPropertyVetoException
WTPropertyVetoException

getFolderDataforParts

public static String[] getFolderDataforParts(EPMWorkspace workspace,
                                             WTPart[] parts)
This method gets Location for Parts from the Vector

Throws:
wt.util.WTException, - wt.util.WTPropertyVetoException

getWTPart

public static WTPart getWTPart(String number)
                        throws WTException
This convenience method finds a part based on its unique number using the latest config spec

Parameters:
number - The number of the part to be searched.
Returns:
WTPart
Throws:
WTException

getWTPart

public static WTPart getWTPart(String number,
                               ConfigSpec configSpec)
                        throws WTException
This method finds a part based on its unique number and the config spec.

Parameters:
number - The number of the part to be searched.
configSpec - The config spec to be used for filtering the part iterations
Returns:
WTPart
Throws:
WTException

getWTPartInContainers

public static WTPart getWTPartInContainers(String partNumber,
                                           ConfigSpec configSpec,
                                           WTContainerRef[] containersToSearchRefs,
                                           boolean isPDMLinkContainer,
                                           boolean isPJLContainer,
                                           String custClassString,
                                           EPMDocument document,
                                           boolean onlyInOrgOfDoc)
                                    throws WTException
Throws:
WTException

getWTPart

public static WTPart getWTPart(String partNumber,
                               ConfigSpec configSpec,
                               WTContainer container,
                               String custClassString,
                               EPMDocument document,
                               boolean onlyInOrgOfDoc)
                        throws WTException
Throws:
WTException

reArrangeMasters

private static QueryResult reArrangeMasters(QueryResult partMasters,
                                            WTContainer container)