Package com.ptc.windchill.esi.utl
Class ESIProperties
java.lang.Object
com.ptc.windchill.esi.utl.ESIProperties
Assists ESI classes in obtaining ESI configuration information.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassGiven an ESIPropertyRequest, return the java class that is identified by that property.static Class<?> getClass(ESIPropertyRequest req, WTContained containedObject) Given an ESIPropertyRequest, return the java class that is identified by that property.static ClassFetches the Class instance corresponding to the value of the input preference.static ClassFetches the Class instance corresponding to the value of the input preference or its default value as appropriate.static StringgetProperty(ESIPropertyRequest request) Returns the ESI property whose key equals the request.getName().static booleangetProperty(ESIPropertyRequest request, boolean dflt, WTContained containedObject) Convenience method to get a boolean property string and convert it to a boolean value.static StringgetProperty(ESIPropertyRequest request, WTContained containedObject) Returns the ESI preference whose key equals the request.getName().static StringgetProperty(String name) Returns the ESI property whose key equals the name argument.static booleangetProperty(String name, boolean dflt) Convenience method to get a boolean property string and convert it to a boolean value.static booleangetProperty(String name, boolean dflt, WTContained containedObject) Convenience method to get a boolean property string and convert it to a boolean value.static booleangetProperty(String name, boolean defaultValue, WTContainerRef containerRef, WTUser user) Returns the value of a preference specified by the argument "name" in the specified container or user context.static StringgetProperty(String name, String defaultValue) Returns the ESI property whose key equals the name argument.static StringgetProperty(String name, String defaultValue, WTContained containedObject) Returns the ESI preference whose key equals the name argument.static StringgetProperty(String name, String defaultValue, WTOrganization organization) Returns the value of ESI preference whose key equals to the name argument.static StringgetProperty(String name, WTContained containedObject) Returns the ESI preference whose key equals the name argument.static StringgetProperty(String name, WTOrganization organization) Returns the value of ESI preference whose key equals to the name argument.static StringReturns the path to the tasks directory under Windchill installation.static Stringsubstitute(String propertyValue) Substitutes expressions of the form$(name)in strings with property values from this properties object.
-
Method Details
-
getProperty
Returns the ESI property whose key equals the name argument.
Supported API: true- Parameters:
name-- Returns:
- String
-
getProperty
Returns the ESI property whose key equals the name argument. If no property is found, the defaultValue argument is returned.
Supported API: true- Parameters:
name-defaultValue-- Returns:
- String
-
getProperty
Returns the ESI property whose key equals the request.getName(). If no property is found, request.getDefaultValue() is returned.
Supported API: true- Parameters:
request-- Returns:
- String
-
getClass
Given an ESIPropertyRequest, return the java class that is identified by that property. If an exception occurs, log it and return null.
Supported API: true- Parameters:
req-- Returns:
- Class
-
getProperty
Convenience method to get a boolean property string and convert it to a boolean value.
Supported API: true- Parameters:
name- the property name.dflt- - The default value returned if named property does not exist- Returns:
- the value as a boolean.
-
getProperty
Returns the ESI preference whose key equals the name argument. Method returns the preference value that belongs contained object organization context. If no value found in the organization context will return value from site context.
Note: As of X-12 this class uses preferences to read the properties.
Supported API: true- Parameters:
name- the name of the preferencecontainedObject- the contained object- Returns:
- the string value of the preference
-
getProperty
Returns the ESI preference whose key equals the name argument. If no property is found, the defaultValue argument is returned. Method returns the preference value that belongs contained object organization context. If no value found in the organization context will return value from site context.
Note: As of X-12 this class uses preferences to read the properties.
Supported API: true- Parameters:
name- the name of the preferencedefaultValue- default value of preferencecontainedObject- the contained object- Returns:
- the string value of the preference
-
getProperty
Returns the ESI preference whose key equals the request.getName(). If no preference is found, request.getDefaultValue() is returned. Method returns the preference value that belongs contained object organization context.If no value found in the organization context will return value from site context.
Note: As of X-12 this class uses preferences to read the properties.
Supported API: true- Parameters:
request- an esi property requestcontainedObject- the contained object- Returns:
- the string value of the preference
-
getProperty
Returns the value of ESI preference whose key equals to the name argument. If no preference is found, the defaultValue argument is returned. Method returns the preference value that belongs to the input organization context. If no value found in the organization context, this will return a value from site context.
Note: As of 9.1, this class uses preferences to read the properties.
Supported API: true- Parameters:
name- the name of the preferencedefaultValue- default value of preferenceorganization- organization- Returns:
- the string value of the preference
-
getProperty
Returns the value of ESI preference whose key equals to the name argument. Method returns the preference value that belongs to the input organization context. If no value found in the organization context, this will return a value from site context.
Note: As of 9.1, this class uses preferences to read the properties.
Supported API: true- Parameters:
name- the name of the preferenceorganization- organization- Returns:
- the string value of the preference
-
getClass
Fetches the Class instance corresponding to the value of the input preference.
Supported API: true- Parameters:
name- Name of the input preference, whose value is the fully qualified name of a Java class.- Returns:
- Class instance for the value held by the input preference, if one could be created successfully; a null, if some error occurred while fetching the value of the preference or while creating a Class instance for the fetched value.
-
getClass
Fetches the Class instance corresponding to the value of the input preference or its default value as appropriate.
Supported API: true- Parameters:
name- Name of the input preference, whose value is the fully qualified name of a Java class.defaultVal- Default value to be used while fetching the value of the input preference.- Returns:
- Class instance for the value held by the input preference (or its default value), if one could be created successfully; a null, if some error occurred while fetching the value of the preference or while creating a Class instance for the fetched value.
-
getClass
Given an ESIPropertyRequest, return the java class that is identified by that property. If an exception occurs, log it and return null. Method returns the property value that belongs contained object organization context.If no value found in the organization context will return value from site context.
Note: As of X-12 this class uses preferences to read the properties.
Supported API: true- Parameters:
req- an esi property requestcontainedObject- the contained object- Returns:
- the Class object from the preferences value
-
getProperty
Convenience method to get a boolean property string and convert it to a boolean value. Method returns the property value that belongs contained object organization context.
Note: As of X-12 this class uses preferences to read the properties.
Supported API: true- Parameters:
name- - The property name.dflt- - default value returned if named property does not existcontainedObject- - The contained object- Returns:
- the value as a boolean.
-
getProperty
public static boolean getProperty(ESIPropertyRequest request, boolean dflt, WTContained containedObject) Convenience method to get a boolean property string and convert it to a boolean value. Method returns the property value that belongs contained object organization context.
Note: As of X-12 this class uses preferences to read the properties.
Supported API: true- Parameters:
request- - An esi property request.dflt- - The default value returned if named property does not existcontainedObject- - The contained object- Returns:
- the value as a boolean.
-
substitute
Substitutes expressions of the form$(name)in strings with property values from this properties object. If the entire value is a substitution and the named property is not found, a null is returned instead of an empty string. The expression$DATE(format)is a built inSimpleDateFormatmacro where format is a pattern expression such as MMddyy. It can be used to construct date/time based values such as log file names. The expression$LIB(key)is a built in macro which lists the contents of the directory pointed to by key separated by File.pathSeparator.This is used internally to the
WTProperties.getPropertymethod. It is exposed as a public method to allow the same substitutions to be applied against arbitrary strings.
Supported API: true- Parameters:
propertyValue- the string to be parsed for substitutions- Returns:
- the substituted string.
-
getTaskSourcePath
Returns the path to the tasks directory under Windchill installation.
Supported API: true- Returns:
- String
-
getProperty
public static boolean getProperty(String name, boolean defaultValue, WTContainerRef containerRef, WTUser user) Returns the value of a preference specified by the argument "name" in the specified container or user context. If no preference is found, the defaultValue argument is returned. To fetch the preference value, this method internally invokes the APIPreferenceService2.getValue(WTContainerRef, String, String, WTUser).
Supported API: true- Parameters:
name- - The internal name of the PreferenceDefinition.defaultValue- - default value of preference.containerRef- - Container reference specifying the context in which the preference is being retrieveduser- - User specifying the context in which the preference is being retrieved.- Returns:
- The value of the preference as a boolean.
-