Class ESIProperties

java.lang.Object
com.ptc.windchill.esi.utl.ESIProperties

public final class ESIProperties extends Object
Assists ESI classes in obtaining ESI configuration information.

Supported API: true

Extendable: false
  • Method Details

    • getProperty

      public static String getProperty(String name)
      Returns the ESI property whose key equals the name argument.

      Supported API: true
      Parameters:
      name -
      Returns:
      String
    • getProperty

      public static String getProperty(String name, String defaultValue)
      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

      public static String getProperty(ESIPropertyRequest request)
      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

      public static Class getClass(ESIPropertyRequest req)
      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

      public static boolean getProperty(String name, boolean dflt)
      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

      public static String getProperty(String name, WTContained containedObject)
      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 preference
      containedObject - the contained object
      Returns:
      the string value of the preference
    • getProperty

      public static String getProperty(String name, String defaultValue, WTContained containedObject)
      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 preference
      defaultValue - default value of preference
      containedObject - the contained object
      Returns:
      the string value of the preference
    • getProperty

      public static String getProperty(ESIPropertyRequest request, WTContained containedObject)
      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 request
      containedObject - the contained object
      Returns:
      the string value of the preference
    • getProperty

      public static String getProperty(String name, String defaultValue, WTOrganization organization)
      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 preference
      defaultValue - default value of preference
      organization - organization
      Returns:
      the string value of the preference
    • getProperty

      public static String getProperty(String name, WTOrganization organization)
      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 preference
      organization - organization
      Returns:
      the string value of the preference
    • getClass

      public static Class getClass(String name)
      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

      public static Class getClass(String name, String defaultVal)
      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

      public static Class<?> getClass(ESIPropertyRequest req, WTContained containedObject)
      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 request
      containedObject - the contained object
      Returns:
      the Class object from the preferences value
    • getProperty

      public static boolean getProperty(String name, 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:
      name - - The property name.
      dflt - - default value returned if named property does not exist
      containedObject - - 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 exist
      containedObject - - The contained object
      Returns:
      the value as a boolean.
    • substitute

      public static String substitute(String propertyValue)
      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 in SimpleDateFormat macro 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.getProperty method. 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

      public static 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 API PreferenceService2.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 retrieved
      user - - User specifying the context in which the preference is being retrieved.
      Returns:
      The value of the preference as a boolean.