Package com.ptc.windchill.esi.utl
Class ESIUtility
java.lang.Object
com.ptc.windchill.esi.utl.ESIUtility
A convenient class for ESI utility API's.
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns the value of the property "com.ptc.windchill.esi.CalculateDeltaUsingLatestPublishedObject".static voidclearUISessionContext(Persistable primaryBusinessObject, String userName) Clears the session context for the input object and user by removing its keys and destroying it.static voidclearUISessionContext(Persistable primaryBusinessObject, WTPrincipal user) Clears the session context for the input object and user by removing its keys and destroying it.static StringencodeUser(String userIn) Encodes the input user name.static StringgetResponseFileName(Persistable pbo, String txnNumber, String fileExtension) Returns a string which is used as a name for the response file.static LocaleReturns the locale to be used for publication.static SessionContextgetUISessionContext(Persistable primaryBusinessObject, String userName) Returns the session context for the input object and user.static SessionContextgetUISessionContext(Persistable primaryBusinessObject, WTPrincipal user) Returns the session context for the input object and user.static booleanisIterationInSameView(ViewManageable newViewIteration, ViewManageable oldViewIteration) Check if the input ViewManageable object iterations are from the same view.
Supported API: truestatic booleanisValidUISessionContext(Persistable primaryBusinessObject, String userName) Checks if there is a valid session context for the input object and user; a valid session context is one that has content that resulted from the Send To Distribution Target UI.static booleanisValidUISessionContext(Persistable primaryBusinessObject, WTPrincipal user) Checks if a valid session context exists for the input object and user.static intReturns the value of the property "postEventRetryCount".static longReturns the value of the property "postEventRetryPeriod".static booleanReturns the value of the property "com.ptc.windchill.esi.publishEffectivityInformationFromManufacturingHistory".static booleanReturns the value of the property "com.ptc.windchill.esi.PublishOldCCObjectAndAssocLinks".static booleanReturns the value of the property "com.ptc.windchill.esi.PublishOneOffVersion".static booleanReturns the value of the property "com.ptc.windchill.esi.renderEffectivityElementInPartElement".static booleanReturns the value of the property "com.ptc.windchill.esi.skipSUMAPartsWhilePublishing".static booleanReturns the value of the property "com.ptc.windchill.esi.renderEffectivityWithPartAttributes".static StringReturns the value of the property "com.ptc.windchill.esi.useVersionInfofromPartOrED".static booleanReturns the value of the property "com.ptc.windchill.esi.useOOTBImplementationToResolveDocument".static booleanReturns the value of the property "com.ptc.windchill.esi.useOOTBRefDocumentBehaviour".static booleanReturns the value of the property "com.ptc.windchill.esi.UseSameProcessPlanFilterToResolveBOM".
-
Method Details
-
getTargetLocale
Returns the locale to be used for publication. Method verified source locale and returns appropriate target locale used for publication of objects
Supported API: true- Returns:
- the target Locale object.
- Throws:
WTException
-
getUISessionContext
public static SessionContext getUISessionContext(Persistable primaryBusinessObject, String userName) Returns the session context for the input object and user. The method creates a new session context and returns it, if one does not already exist for the specified parameters; otherwise, it returns the existing session context that may have been created by some other caller for the same set of input parameters.
Note: This call must follow with clear session APIclearUISessionContext(Persistable, String)after use of the this session context.
Never log session context without checking if debug is enabled, as this is a performance intensive operation and can cause the system to slow down.
Supported API: true- Parameters:
primaryBusinessObject- The input object for which to return a session context. This is typically the primary business object that is sent to a distribution target via the Send to Distribution Target UI.userName- The input user name for which to return a session context. This is typically the user that brings up the Send to Distribution Target UI.- Returns:
- SessionContext object to be used for maintaining state information for the given set of input parameters.
-
getUISessionContext
public static SessionContext getUISessionContext(Persistable primaryBusinessObject, WTPrincipal user) throws WTException Returns the session context for the input object and user. The method creates a new session context and returns it, if one does not already exist for the specified parameters; otherwise, it returns the existing session context that may have been created by some other caller for the same set of input parameters.
Note: This call must follow with clear session APIclearUISessionContext(Persistable, String)after use of the this session context.
Never log session context without checking if debug is enabled, as this is a performance intensive operation and can cause the system to slow down.
Supported API: true- Parameters:
primaryBusinessObject- The input object for which to return a session context. This is typically the primary business object that is sent to a distribution target via the Send to Distribution Target UI.user- The input user for which to return a session context. This is typically the user that brings up the Send to Distribution Target UI.- Returns:
- SessionContext object to be used for maintaining state information for the given set of input parameters.
- Throws:
WTException- throws exception if filed to get user name for provided principal.
-
clearUISessionContext
Clears the session context for the input object and user by removing its keys and destroying it.
Supported API: true- Parameters:
primaryBusinessObject- The input object for which to clear the session context. This is typically the primary business object that is sent to a distribution target via the Send to Distribution Target UI.userName- The input user name. This is typically the user that brings up the Send to Distribution Target UI.
-
clearUISessionContext
public static void clearUISessionContext(Persistable primaryBusinessObject, WTPrincipal user) throws WTException Clears the session context for the input object and user by removing its keys and destroying it.
Supported API: true- Parameters:
primaryBusinessObject- The input object for which to clear the session context. This is typically the primary business object that is sent to a distribution target via the Send to Distribution Target UI.user- The input user. This is typically the user that brings up the Send to Distribution Target UI.- Throws:
WTException- throws exception if filed to get user name for provided principal.
-
isValidUISessionContext
Checks if there is a valid session context for the input object and user; a valid session context is one that has content that resulted from the Send To Distribution Target UI.
Supported API: true- Parameters:
primaryBusinessObject- The input object for which to check if a valid session context exists. This is typically the primary business object that is sent to a distribution target via the Send to Distribution Target UI.userName- The input user name. This is typically the user that brings up the Send to Distribution Target UI.- Returns:
- true if a valid context exists for the input object and user; otherwise, a false.
-
isValidUISessionContext
public static boolean isValidUISessionContext(Persistable primaryBusinessObject, WTPrincipal user) throws WTException Checks if a valid session context exists for the input object and user. Delegates the actual work to an overloaded version of the method.
Supported API: true- Parameters:
primaryBusinessObject- The input object for which to check if a valid session context exists. This is typically the primary business object that is sent to a distribution target via the Send to Distribution Target UI.user- The input user. This is typically the user that brings up the Send to Distribution Target UI.- Returns:
- The value returned by the overloaded version.
- Throws:
WTException- if the method failed to get a user name for the provided principal.
-
encodeUser
Encodes the input user name. Use this API to encode the user name before passing it to the postResult() API of ESITransactionUtility.
Supported API: true- Parameters:
userIn- Name of the user to encode.- Returns:
- User name in the encoded form.
- See Also:
-
getResponseFileName
public static String getResponseFileName(Persistable pbo, String txnNumber, String fileExtension) throws WTException Returns a string which is used as a name for the response file. E.g.: ESIResponse_Demo_Organization_1.xml. In this example, the string- "ESIResponse_" is the value retrieved from the preference "ESI Response File Prefix".
- "Demo_Organization" is the organization name retrieved from the primary business object (spaces in the organization name is replaced by "-").
- "1" is the input transaction number.
Supported API: true- Parameters:
pbo- - Primary business object that is being published in the transaction indicated by the argument 'txnNumber'.txnNumber- - ESI transaction number.fileExtension- - File extension.- Returns:
- Returns a string which is used as a name for the response file.
- Throws:
WTException
-
calculateDeltaUsingLatestPublishedObject
public static boolean calculateDeltaUsingLatestPublishedObject()Returns the value of the property "com.ptc.windchill.esi.CalculateDeltaUsingLatestPublishedObject". If this property is not available in the esi.properties file, a true will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.CalculateDeltaUsingLatestPublishedObject".
-
isIterationInSameView
public static boolean isIterationInSameView(ViewManageable newViewIteration, ViewManageable oldViewIteration) Check if the input ViewManageable object iterations are from the same view.
Supported API: true- Parameters:
newViewIteration- - The new iteration of ViewManageable to be compared.oldViewIteration- - The old iteration of ViewManageable with which new iteration needs to be compared.- Returns:
- - true, if the input ViewManageable iterations are from the same view values; otherwise false.
-
useSameProcessPlanFilterToResolveBOM
public static boolean useSameProcessPlanFilterToResolveBOM()Returns the value of the property "com.ptc.windchill.esi.UseSameProcessPlanFilterToResolveBOM". If this property is not available in the esi.properties file, a true will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.UseSameProcessPlanFilterToResolveBOM".
-
useOOTBRefDocumentBehaviour
public static boolean useOOTBRefDocumentBehaviour()Returns the value of the property "com.ptc.windchill.esi.useOOTBRefDocumentBehaviour". If this property is not available in the esi.properties file, a true will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.useOOTBRefDocumentBehaviour".
-
useOOTBImplementationToResolveDocument
public static boolean useOOTBImplementationToResolveDocument()Returns the value of the property "com.ptc.windchill.esi.useOOTBImplementationToResolveDocument". If this property is not available in the esi.properties file, a true will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.useOOTBImplementationToResolveDocument".
-
useOOTBEnterpriseDataBehaviour
Returns the value of the property "com.ptc.windchill.esi.useVersionInfofromPartOrED". If this property is not available in the esi.properties file, "COMMON_ENTERPRISE_DATA" will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.useVersionInfofromPartOrED".
-
publishEffectivityInfoFromMfgHistory
public static boolean publishEffectivityInfoFromMfgHistory()Returns the value of the property "com.ptc.windchill.esi.publishEffectivityInformationFromManufacturingHistory". If this property is not available in the esi.properties file, false value will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.publishEffectivityInformationFromManufacturingHistory".
-
useOldEffectivityBehaviour
public static boolean useOldEffectivityBehaviour()Returns the value of the property "com.ptc.windchill.esi.renderEffectivityWithPartAttributes". If this property is not available in the esi.properties file, a false will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.renderEffectivityWithPartAttributes".
-
renderEffectivityElementInPartElement
public static boolean renderEffectivityElementInPartElement()Returns the value of the property "com.ptc.windchill.esi.renderEffectivityElementInPartElement". If this property is not available in the esi.properties file, a false will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.renderEffectivityElementInPartElement".
-
publishOldCCAndAssocLinks
public static boolean publishOldCCAndAssocLinks()Returns the value of the property "com.ptc.windchill.esi.PublishOldCCObjectAndAssocLinks". If this property is not available in the esi.properties file, a true will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.PublishOldCCObjectAndAssocLinks".
-
publishOneOffVersion
public static boolean publishOneOffVersion()Returns the value of the property "com.ptc.windchill.esi.PublishOneOffVersion". If this property is not available in the esi.properties file, a false will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.PublishOneOffVersion".
-
skipSumaParts
public static boolean skipSumaParts()Returns the value of the property "com.ptc.windchill.esi.skipSUMAPartsWhilePublishing". If this property is not available in the esi.properties file, a true will be assumed as the value. Out-of-the-box, this property is not available in the esi.properties file.
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.skipSUMAPartsWhilePublishing".
-
postEventRetryCount
public static int postEventRetryCount()Returns the value of the property "postEventRetryCount". If this property is not available in the esi.properties file, a 20 will be assumed as the value. This property denotes the retry count for the post event
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.renderEffectivityElementInPartElement".
-
postEventRetryPeriod
public static long postEventRetryPeriod()Returns the value of the property "postEventRetryPeriod". If this property is not available in the esi.properties file, a 90000 will be assumed as the value. This property denotes the time interval for which PostEvent method should wait before it retries for posting an event
Supported API: true- Returns:
- The value of the property "com.ptc.windchill.esi.renderEffectivityElementInPartElement".
-