com.ptc.windchill.cadx.common.util
Class GenericUtilities

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.util.GenericUtilities

public class GenericUtilities
extends Object



Supported API: false

Extendable: false


Field Summary
private static String CLASSNAME
           
private static HashMap docFamilyMap
           
private static boolean ORGANIZATION_DISPLAY_FLAG
           
private static String RESOURCE
           
private static String RULE_CONSTANT_FOR_VERSIONING
           
static String WORKSPACE_VIEW
          

Supported API: false
 
Constructor Summary
GenericUtilities()
           
 
Method Summary
static WTPart assignView(WTPart a_Part, EPMWorkspace a_Workspace)
          Assign view to the specified part as found from the view property of the workspace.
static boolean compare(Persistable first, Persistable second)
          This method checks whether two persistable objects are identical in Windchill

Supported API: false
static BuildRule createBuildRule(Object obj1, Object obj2)
          

Supported API: false
private static BuildRule createBuildRule(WTPart part, EPMDocument doc)
           
static EPMDescribeLink createEPMDescribeLink(Object obj1, Object obj2, boolean built)
          

Supported API: false
private static EPMDescribeLink createEPMDescribeLink(WTPart part, EPMDocument doc, boolean built)
           
static BinaryLink deleteLink(Object link)
          deletes the link

Supported API: false
static boolean deleteLinks(Object[] links)
           
static boolean disassociate(Object sourceObject, Object targetObject)
          disassociate sourceobject and target object.
static boolean doesBelongToSameSeriesType(WTContained containedObj1, WTContained containedObj2)
           
private static BinaryLink findBuildRule(WTPart part, EPMDocument document)
          search for BuildRule between part and document
private static BinaryLink[] findBuildRules(WTPart part, EPMDocument doc)
           
private static BinaryLink findEPMDescribeLink(WTPart part, EPMDocument doc)
          Searches for Describes link between part and document
static BinaryLink findLink(Object source, Object target)
          

Supported API: false
static BinaryLink[] findLinks(Object source, Object target)
          This method will return the links (active/passive) between the source and target object Either source or target is of type WTPart and other is supposed to be of type EPMDocument
static QueryResult getAllIterationsOfobject(Object obj)
           
static Vector getAllWorkspacesForIteratedObject(WTObject obj)
           
private static BinaryLink[] getAssociated(EPMDocument doc)
          returns the BinaryLinks for EPMDocument.
static Object[] getAssociated(Object object)
          returns the BinaryLinks for object

Supported API: false
private static BinaryLink[] getAssociated(WTPart part)
          returns the associated BinaryLinks for WTPart
static EPMDocument[] getAssociatedDocuments(WTPart target)
          This method gives all EPMDocument objects associated with a WTPart object
private static BinaryLink[] getBuildRules(EPMDocument doc)
          return active links for a given document
static BinaryLink[] getBuildRules(Object object)
          returns the active links for object

Supported API: false
private static BinaryLink[] getBuildRules(WTPart part)
          returns active link for a give part
static EPMFamily getEPMFamily(EPMDocument doc, boolean refresh)
          This method gets the Family information ie EPMFamily object for document.
static String getErrorMessage(Exception ex, Locale locale)
           
static String getGenericDocumentNumber(EPMDocument doc)
          This method gets the number of the generic document.
static String getGhostIgnoreOption()
           
static String getIBAValue(Object obj, String ibaValue)
          spatanka: Added this utility method to get IBA values for searchPart attribute required for AutoAssociate Functionality preference settings.
static String getInstance(EPMDocument epmDoc)
          This method test the document for generic The Information will be cached at client

Supported API: false
static Iterated getIteration(Iterated anyIteration, ConfigSpec configSpec)
          This method obtains the correct iteration of an iterated object based on the input config spec.
static String getKey(Object obj)
           
static String getLinkId(Object link)
          returns link id

Supported API: false
static boolean getLinkStatus(Object link)
          return true if link is active

Supported API: false
static Object getOtherObject(Object object, Object link)
          get the other side object of the link for given object

Supported API: false
static WTOrganization getOwningOrganizationOfWSContextContainer(EPMWorkspace ws)
           
private static QueryResult getQueryResultForPart(WTPart target)
           
static Object getSeriesKey(WTContained containedObj)
           
static Vector getUsedByDocumentsByLink(QueryResult theEPMMemberLinks)
          For the specified QueryResult of the EPMMemberLink objects, return a vector of EPM documents.
static Vector getUsedByEPMDucuments(EPMDocument epmDoc)
          For the specified EPMDocument, get a Vector of the documents for the 'usedBy' association
static View getView(EPMWorkspace workspace)
          This method returns View for the given workspace.
private static boolean isAssociationExists(EPMDocument doc)
          returns true if associate object exists for given document
static boolean isAssociationExists(Object object)
          returns true if associate object exists for given object

Supported API: false
private static boolean isAssociationExists(WTPart part)
          returns true if associate object exists for given part.
static boolean isAutoNumberingEnabled(WTContainer container, Class objectClass)
           
static boolean isAutoNumberingEnabled(WTContainer container, String objectClassName)
           
static boolean isDocumentGeneric(EPMDocument epmDoc)
          This method test the document for generic The Information will be cached at client

Supported API: false
static boolean isDocumentInstance(EPMDocument epmDoc)
          This method test the document for generic The Information will be cached at client

Supported API: false
static boolean isOrganizationEditable(HTTPState state)
           
static boolean isOrganizationExposed()
           
static boolean isValidDocLifeCycle(String docLifeCycle)
          

Supported API: false
static boolean isValidPartLifeCycle(String partLifeCycle)
          

Supported API: false
static boolean isValidTeamTemplate(String teamTemplate)
          

Supported API: false
static boolean isValidView(String view)
          

Supported API: false
static boolean isValueChanged(Persistable newPersistable, Persistable currentPersistable)
          Return true if the value has changed for the specified new & current (old) persistables.
static void removeContainedInLinks(EPMDocument instance)
          

Supported API: false
static Iterated rollupAndSetFirst(Iterated docorpart, boolean isinstance)
          

Supported API: false
static Vector rollupAndSetFirst(Vector docandparts, boolean instances)
          

Supported API: false
static EPMDescribeLink setDescribeLink(Object link, boolean builtFlag)
          

Supported API: false
static Versioned setVersionIdentifierForObject(Versioned vcObj, String versionlabel)
           
static Versioned setVersionIdentifierForObject(Versioned vcObj, String versionlabel, boolean isNew)
           
static void setView(EPMWorkspace workspace, View view)
          

Supported API: false
static BinaryLink toggleLink(Object obj1, Object obj2)
          

Supported API: false
private static BinaryLink toggleLink(WTPart part, EPMDocument doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

WORKSPACE_VIEW

public static final String WORKSPACE_VIEW


Supported API: false

See Also:
Constant Field Values

docFamilyMap

private static HashMap docFamilyMap

ORGANIZATION_DISPLAY_FLAG

private static boolean ORGANIZATION_DISPLAY_FLAG

RULE_CONSTANT_FOR_VERSIONING

private static final String RULE_CONSTANT_FOR_VERSIONING
See Also:
Constant Field Values
Constructor Detail

GenericUtilities

public GenericUtilities()
Method Detail

setView

public static void setView(EPMWorkspace workspace,
                           View view)


Supported API: false

Parameters:
workspace -
view -

isValidDocLifeCycle

public static boolean isValidDocLifeCycle(String docLifeCycle)


Supported API: false

Parameters:
docLifeCycle -
Returns:
boolean

isValidPartLifeCycle

public static boolean isValidPartLifeCycle(String partLifeCycle)


Supported API: false

Parameters:
partLifeCycle -
Returns:
boolean

isValidView

public static boolean isValidView(String view)


Supported API: false

Parameters:
view -
Returns:
boolean

isValidTeamTemplate

public static boolean isValidTeamTemplate(String teamTemplate)


Supported API: false

Parameters:
teamTemplate -
Returns:
boolean

getAssociated

public static Object[] getAssociated(Object object)
returns the BinaryLinks for object

Supported API: false

Parameters:
object -
Returns:
Object[]

getAssociated

private static BinaryLink[] getAssociated(WTPart part)
returns the associated BinaryLinks for WTPart

Parameters:
part -
Returns:
BinaryLink[]

getAssociated

private static BinaryLink[] getAssociated(EPMDocument doc)
returns the BinaryLinks for EPMDocument.

Parameters:
doc -
Returns:
BinaryLink[]

isAssociationExists

public static boolean isAssociationExists(Object object)
returns true if associate object exists for given object

Supported API: false

Parameters:
object -
Returns:
boolean

disassociate

public static boolean disassociate(Object sourceObject,
                                   Object targetObject)
disassociate sourceobject and target object.

Supported API: false

Parameters:
sourceObject -
targetObject -
Returns:
boolean

deleteLink

public static BinaryLink deleteLink(Object link)
deletes the link

Supported API: false

Parameters:
link -
Returns:
BinaryLink

isAssociationExists

private static boolean isAssociationExists(WTPart part)
returns true if associate object exists for given part.

Parameters:
part -
Returns:
boolean

isAssociationExists

private static boolean isAssociationExists(EPMDocument doc)
returns true if associate object exists for given document

Parameters:
doc -
Returns:
boolean

getOtherObject

public static Object getOtherObject(Object object,
                                    Object link)
get the other side object of the link for given object

Supported API: false

Parameters:
object -
link -
Returns:
Object

getLinkStatus

public static boolean getLinkStatus(Object link)
return true if link is active

Supported API: false

Parameters:
link -
Returns:
boolean

getLinkId

public static String getLinkId(Object link)
returns link id

Supported API: false

Parameters:
link -
Returns:
String

createEPMDescribeLink

public static EPMDescribeLink createEPMDescribeLink(Object obj1,
                                                    Object obj2,
                                                    boolean built)


Supported API: false

Parameters:
obj1 -
obj2 -
built -
Returns:
EPMDescribeLink

createEPMDescribeLink

private static EPMDescribeLink createEPMDescribeLink(WTPart part,
                                                     EPMDocument doc,
                                                     boolean built)
Parameters:
part -
doc -
built -
Returns:
EPMDescribeLink

findBuildRule

private static BinaryLink findBuildRule(WTPart part,
                                        EPMDocument document)
search for BuildRule between part and document

Parameters:
part -
document -
Returns:
BinaryLink

findEPMDescribeLink

private static BinaryLink findEPMDescribeLink(WTPart part,
                                              EPMDocument doc)
Searches for Describes link between part and document

Parameters:
part -
doc -
Returns:
BinaryLink

findLink

public static BinaryLink findLink(Object source,
                                  Object target)


Supported API: false

Parameters:
source -
target -
Returns:
BinaryLink

createBuildRule

public static BuildRule createBuildRule(Object obj1,
                                        Object obj2)


Supported API: false

Parameters:
obj1 -
obj2 -
Returns:
BuildRule

createBuildRule

private static BuildRule createBuildRule(WTPart part,
                                         EPMDocument doc)
Parameters:
part -
doc -
Returns:
BuildRule

setDescribeLink

public static EPMDescribeLink setDescribeLink(Object link,
                                              boolean builtFlag)


Supported API: false

Parameters:
link -
builtFlag -
Returns:
EPMDescribeLink

toggleLink

public static BinaryLink toggleLink(Object obj1,
                                    Object obj2)


Supported API: false

Parameters:
obj1 -
obj2 -
Returns:
BinaryLink

toggleLink

private static BinaryLink toggleLink(WTPart part,
                                     EPMDocument doc)
Parameters:
part -
doc -
Returns:
BinaryLink

getBuildRules

public static BinaryLink[] getBuildRules(Object object)
returns the active links for object

Supported API: false

Parameters:
object -
Returns:
BinaryLink[]

getBuildRules

private static BinaryLink[] getBuildRules(WTPart part)
returns active link for a give part

Parameters:
part -
Returns:
BinaryLink[]

getBuildRules

private static BinaryLink[] getBuildRules(EPMDocument doc)
return active links for a given document

Parameters:
doc -
Returns:
BinaryLink[]

rollupAndSetFirst

public static Vector rollupAndSetFirst(Vector docandparts,
                                       boolean instances)


Supported API: false

Parameters:
docandparts -
instances -
Returns:
Vector

rollupAndSetFirst

public static Iterated rollupAndSetFirst(Iterated docorpart,
                                         boolean isinstance)


Supported API: false

Parameters:
docorpart -
isinstance -
Returns:
Iterated

removeContainedInLinks

public static void removeContainedInLinks(EPMDocument instance)
                                   throws Exception


Supported API: false

Parameters:
instance -
Throws:
Exception

getGenericDocumentNumber

public static String getGenericDocumentNumber(EPMDocument doc)
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

Supported API: false

Returns:
String - generic name

compare

public static boolean compare(Persistable first,
                              Persistable second)
This method checks whether two persistable objects are identical in Windchill

Supported API: false

Parameters:
first - The first object to be compared
second - The second object to be compared
Returns:
boolean

getEPMFamily

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

Supported API: false

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

Supported API: false

Returns:
boolean - true if generic

isDocumentInstance

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

Supported API: false

Returns:
boolean - true if generic

getInstance

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

Supported API: false

Returns:
boolean - true if generic

assignView

public static WTPart assignView(WTPart a_Part,
                                EPMWorkspace a_Workspace)
Assign view to the specified part as found from the view property of the workspace.


getView

public static View getView(EPMWorkspace workspace)
This method returns View for the given workspace.

Throws:
WTException

getUsedByEPMDucuments

public static Vector getUsedByEPMDucuments(EPMDocument epmDoc)
For the specified EPMDocument, get a Vector of the documents for the 'usedBy' association


getUsedByDocumentsByLink

public static Vector getUsedByDocumentsByLink(QueryResult theEPMMemberLinks)
For the specified QueryResult of the EPMMemberLink objects, return a vector of EPM documents. Make sure not to repeat the same document by ensuring uniqueness of oid.


getIteration

public static Iterated getIteration(Iterated anyIteration,
                                    ConfigSpec configSpec)
                             throws WTException
This method obtains the correct iteration of an iterated object based on the input config spec.

Parameters:
anyIteration - Any iteration of the object
configSpec - Config spec to be used for retrieving the iteration
Returns:
Iterated
Throws:
WTException

getAllIterationsOfobject

public static QueryResult getAllIterationsOfobject(Object obj)

getAllWorkspacesForIteratedObject

public static Vector getAllWorkspacesForIteratedObject(WTObject obj)
                                                throws WTException
Throws:
WTException

getKey

public static String getKey(Object obj)

getIBAValue

public static String getIBAValue(Object obj,
                                 String ibaValue)
spatanka: Added this utility method to get IBA values for searchPart attribute required for AutoAssociate Functionality preference settings. Returns IBA value

Returns:
String IBA Value
Throws:

isOrganizationExposed

public static boolean isOrganizationExposed()

isAutoNumberingEnabled

public static boolean isAutoNumberingEnabled(WTContainer container,
                                             String objectClassName)

isAutoNumberingEnabled

public static boolean isAutoNumberingEnabled(WTContainer container,
                                             Class objectClass)

getOwningOrganizationOfWSContextContainer

public static WTOrganization getOwningOrganizationOfWSContextContainer(EPMWorkspace ws)

getAssociatedDocuments

public static EPMDocument[] getAssociatedDocuments(WTPart target)
                                            throws WTException
This method gives all EPMDocument objects associated with a WTPart object

Parameters:
target - The part whose associated documents are to be obtained
Returns:
EPMDocument[]
Throws:
WTException

isValueChanged

public static boolean isValueChanged(Persistable newPersistable,
                                     Persistable currentPersistable)
Return true if the value has changed for the specified new & current (old) persistables. It is assumed that the specified persistables are compatible class of same type. This method is null pointer exception proof.


getQueryResultForPart

private static QueryResult getQueryResultForPart(WTPart target)
                                          throws WTException
Throws:
WTException

isOrganizationEditable

public static boolean isOrganizationEditable(HTTPState state)
                                      throws WTException
Throws:
WTException

findLinks

public static BinaryLink[] findLinks(Object source,
                                     Object target)
This method will return the links (active/passive) between the source and target object Either source or target is of type WTPart and other is supposed to be of type EPMDocument


findBuildRules

private static BinaryLink[] findBuildRules(WTPart part,
                                           EPMDocument doc)

deleteLinks

public static boolean deleteLinks(Object[] links)

getGhostIgnoreOption

public static String getGhostIgnoreOption()

getErrorMessage

public static String getErrorMessage(Exception ex,
                                     Locale locale)

getSeriesKey

public static Object getSeriesKey(WTContained containedObj)

doesBelongToSameSeriesType

public static boolean doesBelongToSameSeriesType(WTContained containedObj1,
                                                 WTContained containedObj2)

setVersionIdentifierForObject

public static Versioned setVersionIdentifierForObject(Versioned vcObj,
                                                      String versionlabel,
                                                      boolean isNew)
                                               throws WTException,
                                                      WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

setVersionIdentifierForObject

public static Versioned setVersionIdentifierForObject(Versioned vcObj,
                                                      String versionlabel)
                                               throws WTException,
                                                      WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException