com.ptc.windchill.cadx.common
Class EPMDocumentUtilities

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

public class EPMDocumentUtilities
extends Object


Field Summary
static String ACAD_AUTHORING_APPLICATION
           
private static String autoAssocSetRevisionRule
           
static String CADDS5_AUTHORING_APPLICATION
           
static String CATIA_AUTHORING_APPLICATION
           
static String CATIAV5_AUTHORING_APPLICATION
           
private static int DOC_NAME_MAX_LIMIT
           
private static HashMap docFamilyMap
           
static String FAMILYTABLE
           
private static EPMDocSubType[] forbiddenDocSubTypes
           
private static EPMDocumentType[] forbiddenDocTypes
           
static int GENERIC_EPM_DOC
           
static String IDEAS_AUTHORING_APPLICATION
           
static int INSTANCE_EPM_DOC
           
static String INVENTOR_AUTHORING_APPLICATION
           
static String J01_ND
           
static String J03_ND
           
private static int MODEL_NAME_MAX_LIMIT
           
static String NEWDOCUMENT_FOLDERDATA
           
static String PROE_AUTHORING_APPLICATION
           
static int REGULAR_EPM_DOC
           
private static String setRevisionRule
           
static String SOLIDWORKS_AUTHORING_APPLICATION
           
static String UG_AUTHORING_APPLICATION
           
private static boolean VERBOSE
           
 
Constructor Summary
EPMDocumentUtilities()
           
 
Method Summary
private static boolean checkChangeStatus(EPMDocumentMaster target)
           
static boolean compareExtensions(String newstr, String oldstr)
           
static boolean docHasContents(EPMDocument doc)
           
static boolean doesEPMDocumentExist(String number)
           
static boolean doesEPMDocumentMasterExist(String number)
          This method checks whether an EPMDocumentMaster with given number exists.
static boolean doesModelNameContainValidCharacters(String modelName)
           
static String getAuthoringApplication(EPMDocument doc)
           
static boolean getAutoAssociateSetRevisionRule()
           
private static String getBaseIconImage(EPMDocument doc)
           
static Object[] getCompatibleGenericForInstance(EPMDocument instanceDoc, ConfigSpec docConfigSpec, ConfigSpec partConfigSpec, boolean isPartCentric)
           
static Object[] getCompatibleGenericForInstance(EPMDocument instanceDoc, ConfigSpec docConfigSpec, ConfigSpec partConfigSpec, boolean isPartCentric, WTContainer container)
          This method returns the appropriate version of generic document for the input instance document If any compatible iteration of generic which config spec qualifies is returned If config spec doesnot qualify any iteration then the latest compatible is returned.
static int getDocumentType(EPMDocument a_Document)
          This method will return if a particular document is a 'Generic document' or an 'Instance document' or just a regular document NOTE : SIMILAR API PROVIDED BY EPM SERVER IS NOT USED FOR PERFORMANCE REASON.
static EPMDocument getEPMDocument(String number)
           
static EPMDocument getEPMDocument(String number, ConfigSpec configSpec)
          This method finds a document based on its unique number and the config spec.
static EPMFamily getEPMFamily(EPMDocument epmDoc, boolean refresh)
          This method gets the Family information ie EPMFamily object for document.
static HashMap getFamilyTable(EPMDocument genericDocument)
          This method returns family table for document.
static String getFolderData(EPMDocument document)
          This method gets folder information of Newly created doc If document doesn't have folder information then , null will be returned.
static String getGenericDocumentNumber(EPMDocument epmDoc)
          This method gets the number of the generic document.
static EPMDocument getGenericForInstance(EPMDocument instanceDoc, ConfigSpec configSpec)
          This method returns the appropriate version of generic document for the input instance document (if any) by applying the input config specs.
static EPMDocument getGenericForInstance(EPMDocument instanceDoc, ConfigSpec docConfigSpec, ConfigSpec partConfigSpec, boolean isPartCentric)
           
static Vector getInstanceCADNames(EPMDocument epmDoc)
           
static EPMDocument getLatestCompatibleGeneric(EPMDocument inst)
           
static String getPDMObjType(EPMDocument doc)
           
static boolean getReviseSetRevisionRule()
           
static EPMDocument getTemplateEPMDocument(String number, WTContainer container)
          This method finds a template document based on its unique number using the latest config spec.
static EPMDocumentMaster getTemplateEPMDocumentMaster(String number, WTContainer container)
          For the specified CAD Doc number, find out the document master.
static boolean hasRefCheckedOut(EPMDocument target)
           
static boolean isDocNameSizeValid(String docName)
           
static boolean isDocNumberSizeValid(String docNumber)
           
static boolean isDocumentGeneric(EPMDocument epmDoc)
          This method test the document for generic The Information will be cached at client
static boolean isDocumentInstance(EPMDocument epmDoc)
          This method test the document for instance The Information will be cached at client
static boolean isDocumentSubTypeForbidden(EPMDocument a_Document)
           
static boolean isDocumentTypeForbidden(EPMDocument a_Document)
           
static boolean isICubedAuthApp(String authAppName)
           
static boolean isInFamily(String CADName, EPMDocument epmDoc)
           
static boolean isModelNameSizeValid(String modelName)
           
static boolean isNewIcubedDocument(Object object)
           
static boolean isPopulated(EPMDocument obj)
           
static String MapDocumentTypeToPDMObjType(EPMDocument doc, int docType, ConfigSpec configSpec)
           
static boolean saveFamilyTable(EPMDocument genericDocument, HashMap familyTable)
          This method saves the documents family table information as supporting data.
static void saveFolderData(EPMDocument document, String location)
          This method saves folder information specidifed during document creation .
static QueryResult searchEPMDocuments(String searchName, String searchNumber, String searchCadModelName, String searchLocation, boolean onlyLatest)
           
static QueryResult searchEPMDocuments(String searchName, String searchNumber, String searchCadModelName, String searchLocation, boolean onlyLatest, WTContainer containedIn)
           
static EPMDocument setDescription(EPMDocument doc, String docDescription)
          This method sets the description of the EPMDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROE_AUTHORING_APPLICATION

public static final String PROE_AUTHORING_APPLICATION
See Also:
Constant Field Values

CADDS5_AUTHORING_APPLICATION

public static final String CADDS5_AUTHORING_APPLICATION
See Also:
Constant Field Values

CATIA_AUTHORING_APPLICATION

public static final String CATIA_AUTHORING_APPLICATION
See Also:
Constant Field Values

CATIAV5_AUTHORING_APPLICATION

public static final String CATIAV5_AUTHORING_APPLICATION
See Also:
Constant Field Values

ACAD_AUTHORING_APPLICATION

public static final String ACAD_AUTHORING_APPLICATION
See Also:
Constant Field Values

IDEAS_AUTHORING_APPLICATION

public static final String IDEAS_AUTHORING_APPLICATION
See Also:
Constant Field Values

UG_AUTHORING_APPLICATION

public static final String UG_AUTHORING_APPLICATION
See Also:
Constant Field Values

SOLIDWORKS_AUTHORING_APPLICATION

public static final String SOLIDWORKS_AUTHORING_APPLICATION
See Also:
Constant Field Values

INVENTOR_AUTHORING_APPLICATION

public static final String INVENTOR_AUTHORING_APPLICATION
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

DOC_NAME_MAX_LIMIT

private static final int DOC_NAME_MAX_LIMIT
See Also:
Constant Field Values

MODEL_NAME_MAX_LIMIT

private static final int MODEL_NAME_MAX_LIMIT
See Also:
Constant Field Values

FAMILYTABLE

public static final String FAMILYTABLE
See Also:
Constant Field Values

REGULAR_EPM_DOC

public static final int REGULAR_EPM_DOC
See Also:
Constant Field Values

GENERIC_EPM_DOC

public static final int GENERIC_EPM_DOC
See Also:
Constant Field Values

INSTANCE_EPM_DOC

public static final int INSTANCE_EPM_DOC
See Also:
Constant Field Values

setRevisionRule

private static String setRevisionRule

autoAssocSetRevisionRule

private static String autoAssocSetRevisionRule

J01_ND

public static final String J01_ND
See Also:
Constant Field Values

J03_ND

public static final String J03_ND
See Also:
Constant Field Values

forbiddenDocTypes

private static EPMDocumentType[] forbiddenDocTypes

forbiddenDocSubTypes

private static EPMDocSubType[] forbiddenDocSubTypes

docFamilyMap

private static HashMap docFamilyMap

NEWDOCUMENT_FOLDERDATA

public static final String NEWDOCUMENT_FOLDERDATA
See Also:
Constant Field Values
Constructor Detail

EPMDocumentUtilities

public EPMDocumentUtilities()
Method Detail

getReviseSetRevisionRule

public static boolean getReviseSetRevisionRule()

getAutoAssociateSetRevisionRule

public static boolean getAutoAssociateSetRevisionRule()

searchEPMDocuments

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

searchEPMDocuments

public static QueryResult searchEPMDocuments(String searchName,
                                             String searchNumber,
                                             String searchCadModelName,
                                             String searchLocation,
                                             boolean onlyLatest,
                                             WTContainer containedIn)
                                      throws QueryException,
                                             WTException
Throws:
QueryException
WTException

doesEPMDocumentMasterExist

public static boolean doesEPMDocumentMasterExist(String number)
                                          throws WTException
This method checks whether an EPMDocumentMaster with given number exists.

Parameters:
number - The number of the master to be searched.
Returns:
boolean
Throws:
WTException

doesEPMDocumentExist

public static boolean doesEPMDocumentExist(String number)
                                    throws WTException
Throws:
WTException

getAuthoringApplication

public static String getAuthoringApplication(EPMDocument doc)

isPopulated

public static boolean isPopulated(EPMDocument obj)
                           throws WTException
Throws:
WTException

hasRefCheckedOut

public static boolean hasRefCheckedOut(EPMDocument target)
                                throws WTException
Throws:
WTException

checkChangeStatus

private static boolean checkChangeStatus(EPMDocumentMaster target)
                                  throws WTException
Throws:
WTException

isDocNumberSizeValid

public static boolean isDocNumberSizeValid(String docNumber)

isDocNameSizeValid

public static boolean isDocNameSizeValid(String docName)

isModelNameSizeValid

public static boolean isModelNameSizeValid(String modelName)

doesModelNameContainValidCharacters

public static boolean doesModelNameContainValidCharacters(String modelName)

compareExtensions

public static boolean compareExtensions(String newstr,
                                        String oldstr)

getEPMDocument

public static EPMDocument getEPMDocument(String number)
                                  throws WTException
Throws:
WTException

getEPMDocument

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

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

saveFolderData

public static void saveFolderData(EPMDocument document,
                                  String location)
                           throws WTPropertyVetoException,
                                  WTException
This method saves folder information specidifed during document creation .

Throws:
WTException - ,wt.util.WTPropertyVetoException
WTPropertyVetoException

getFolderData

public static String getFolderData(EPMDocument document)
                            throws WTException
This method gets folder information of Newly created doc If document doesn't have folder information then , null will be returned.

Throws:
WTException - ,wt.util.WTPropertyVetoException

setDescription

public static EPMDocument setDescription(EPMDocument doc,
                                         String docDescription)
                                  throws WTException,
                                         WTPropertyVetoException
This method sets the description of the EPMDocument

Parameters:
doc - The EPMDocument to be checked out.
docDescription - The new Description of the doc (EPMDocument)
Returns:
EPMDocument
Throws:
WTException - , WTPropertyVetoException
WTPropertyVetoException

getBaseIconImage

private static String getBaseIconImage(EPMDocument doc)

getGenericForInstance

public static EPMDocument getGenericForInstance(EPMDocument instanceDoc,
                                                ConfigSpec configSpec)
This method returns the appropriate version of generic document for the input instance document (if any) by applying the input config specs.

Parameters:
instanceDoc - The instance document for which the generic document is to be found.
configSpec - The config spec to be applied to filter out the proper version of generic
Returns:
EPMDocument
Throws:
WTException

getGenericForInstance

public static EPMDocument getGenericForInstance(EPMDocument instanceDoc,
                                                ConfigSpec docConfigSpec,
                                                ConfigSpec partConfigSpec,
                                                boolean isPartCentric)

getCompatibleGenericForInstance

public static Object[] getCompatibleGenericForInstance(EPMDocument instanceDoc,
                                                       ConfigSpec docConfigSpec,
                                                       ConfigSpec partConfigSpec,
                                                       boolean isPartCentric,
                                                       WTContainer container)
This method returns the appropriate version of generic document for the input instance document If any compatible iteration of generic which config spec qualifies is returned If config spec doesnot qualify any iteration then the latest compatible is returned.

Parameters:
instanceDoc - The instance document for which the generic document is to be found.
Returns:
EPMDocument
Throws:
WTException

getEPMFamily

public static EPMFamily getEPMFamily(EPMDocument epmDoc,
                                     boolean refresh)
This method gets the Family information ie EPMFamily object for document. The Information will be cached at client

Returns:
EPMFamily - Family object containing generic and all instances.

isDocumentGeneric

public static boolean isDocumentGeneric(EPMDocument epmDoc)
This method test the document for generic The Information will be cached at client

Returns:
boolean - true if generic

getGenericDocumentNumber

public static String getGenericDocumentNumber(EPMDocument epmDoc)
This method gets the number of the generic document. If doc doesn't belong to family null is returned. The Information will be cached at client

Returns:
String - generic name

isDocumentInstance

public static boolean isDocumentInstance(EPMDocument epmDoc)
This method test the document for instance The Information will be cached at client

Returns:
boolean - true if instance

isInFamily

public static boolean isInFamily(String CADName,
                                 EPMDocument epmDoc)

getInstanceCADNames

public static Vector getInstanceCADNames(EPMDocument epmDoc)

saveFamilyTable

public static boolean saveFamilyTable(EPMDocument genericDocument,
                                      HashMap familyTable)
This method saves the documents family table information as supporting data.

Returns:
boolean true of saved.

getFamilyTable

public static HashMap getFamilyTable(EPMDocument genericDocument)
This method returns family table for document.


getDocumentType

public static int getDocumentType(EPMDocument a_Document)
                           throws WTException
This method will return if a particular document is a 'Generic document' or an 'Instance document' or just a regular document NOTE : SIMILAR API PROVIDED BY EPM SERVER IS NOT USED FOR PERFORMANCE REASON. QUERY HERE IS CUSTOMIZED TO SUIT THE SPECIFIC REQUIREMENT.

Throws:
WTException

docHasContents

public static boolean docHasContents(EPMDocument doc)

MapDocumentTypeToPDMObjType

public static String MapDocumentTypeToPDMObjType(EPMDocument doc,
                                                 int docType,
                                                 ConfigSpec configSpec)

getPDMObjType

public static String getPDMObjType(EPMDocument doc)

getLatestCompatibleGeneric

public static EPMDocument getLatestCompatibleGeneric(EPMDocument inst)

isDocumentTypeForbidden

public static boolean isDocumentTypeForbidden(EPMDocument a_Document)

isDocumentSubTypeForbidden

public static boolean isDocumentSubTypeForbidden(EPMDocument a_Document)

getTemplateEPMDocument

public static EPMDocument getTemplateEPMDocument(String number,
                                                 WTContainer container)
                                          throws WTException
This method finds a template document based on its unique number using the latest config spec.

Parameters:
number - The number of the document to be searched.
Returns:
EPMDocument
Throws:
WTException

getTemplateEPMDocumentMaster

public static EPMDocumentMaster getTemplateEPMDocumentMaster(String number,
                                                             WTContainer container)
                                                      throws WTException
For the specified CAD Doc number, find out the document master. Start looking from the specified container and keep looking up the container hierarchy until a match is found. Return back once 1st match is found.

Throws:
WTException

getCompatibleGenericForInstance

public static Object[] getCompatibleGenericForInstance(EPMDocument instanceDoc,
                                                       ConfigSpec docConfigSpec,
                                                       ConfigSpec partConfigSpec,
                                                       boolean isPartCentric)

isNewIcubedDocument

public static boolean isNewIcubedDocument(Object object)

isICubedAuthApp

public static boolean isICubedAuthApp(String authAppName)