Class PrefsRegistry

java.lang.Object
wt.prefs.registry.PrefsRegistry
All Implemented Interfaces:
RemoteAccess

@Deprecated public class PrefsRegistry extends Object implements RemoteAccess
Deprecated.
This class is responsible for managing the Preferences Registry. The Preference Registry consists of two parts. The first is the Registry of Localized Preference data such as Perference Names, Descriptions and so forth. The second part is the Preference Meta-Data such as information on the type of Preference, The UI Renderer etc. Most methods will require a Fully Qualified keyname as an argument. A Fully Qualified Preference keyname is of the form:

    /wt/prefs/delegates/DelegateOrder

. Each node in the key is separated by '/' characters. Depending on the method, the keyname or null will be returned if a valid value could not be found in the registry. (Please see the method signature and documentation below for details.) The registry will be comprised of two localized files:
  • wt/prefs/registry/prefRegistry.class
  • wt/prefs/registry/custRegistry.class

The prefRegisty[_XX_YY].class files (where optionally the XX is the language and YY is the country, such as prefRegistry_en_US.class) will exist for each of the supported locales in Windchill, and contain the Preference Localized Data for all Preferences shipped with the Windchill product. The custRegistry is the customized registry. Windchill provides an empty custRegistry.rbInfo file which may be customized by the customizers to meet the locale requirements of a customer. Any key may exist in both the customized registry and the preference registry, however the customized value will be retrieved first if it exists and will supercede the Windchill registry entry. This is useful if a customer wishes to expand/decrease the information provided for a preference, or rename a preference from the client side. See the registry rbInfo files for details on the correct format to use for the key/names if creating entries in the rbInfo files. Instructions on the compiling rbInfo files should be located in the Windchill Customizers Guide.

Along with Preference Registry rbInfo files, there are a pair of properties files which are used to store non-localized data which may be required for the use of certain preferences. This may include information such as a class name to invoke for the given preference, a Preference Type etc. These files are located in the wt/prefs/registry under the codebase folder and are called:

  • wt/prefs/registry/prefInfo.properties
  • wt/prefs/registry/custInfo.properties

Like the registry files, these files will load the Preference properties first followed by the customization properties second overriding any properties that are in common. Thus the customized file has the 'final say' on the given property. The format of the property values are described in the properties files themselves. Values may be retrieved using the getValue(String,[String]) methods below. Alternatively, a grouping of properties may be obtained via the <A HREF=#getValues(java.lang.String, java.lang.String)> getValues(String,String) method.

The properties files can be reloaded dynamically at runtime without having to shutdown the MethodServer and restarting by invoking the method reloadProperties() or by invoking this class from the command prompt (if in a development environment) using java wt.prefs.registry.PrefsRegistry

Supported API: true

Extendable: false

  • Method Details

    • getLocalizedName

      public static final String getLocalizedName(String keyname, Locale aLocale)
      Deprecated.
      This method will return the localized name of the preference given a fully qualified key name. The key name should have it's path separated by the '/' character. If the locale is not a valid Windchill locale, the default locale's value will be returned. If there is no entry for the localized name in either the customized or core Preference Registry, the keyname will be returned.
      Parameters:
      keyname - The preference key.
      aLocale - The locale of the key

      Supported API: true
      Returns:
      The localized name of the preference or the keyname if there is not entry.
    • getLocalizedDescription

      public static final String getLocalizedDescription(String keyname, Locale aLocale)
      Deprecated.
      This method will return the localized description for the given key name.
      Parameters:
      keyname - The preference key.
      aLocale - The locale of the key

      Supported API: true
      Returns:
      The localized description or null if not found.
    • getLocalizedShortDescription

      public static final String getLocalizedShortDescription(String keyname, Locale aLocale)
      Deprecated.
      This method will return the localized short description for the given key name.
      Parameters:
      keyname - The preference key. Do not have suffix.
      aLocale - The locale of the key

      Supported API: true
      Returns:
      The localized short description or null if not found.
    • getRegistryKeys

      public static Vector getRegistryKeys()
      Deprecated.
      This method will return a list of all the Registry Keys that are in the the registry that may be used to query the registry. The keys are the fully qualified preference Keys and anything after the SUFFIX_TOKEN will be parsed off. Essentially, it returns a vector of all the keys for which there is some registry entry for.

      Supported API: true
      Returns:
      Vector The list of keys.
    • getLocalizedValue

      public static String getLocalizedValue(String keyname, String constant, Locale locale)
      Deprecated.
      This method will get a localized value from the Registry using the keyname and a constant. A valid keyname will consist of the Fully Qualified Preference Key. The constant is optional, and if null will be ignored. The Customized resource bundle will be searched first, followed by the Windchill resource bundle for the value. If none of these are found the properties files will be searched for an entry in an alternate resource bundle.
      Parameters:
      keyname - The fully Qualified Preference Key name.
      constant - The constant (either defined above or not). Following constants are suppported: TYPE, DISPLAY_NAME, DESCRIPTION, SHORT_DESCRIPTION, DEFAULT, VALID_VALUES, USER_VISIBLE
      locale - The locale for the value

      Supported API: true
      Returns:
      The localized value for the locale, the default locale or null if not found.
    • getLocalizedValues

      public static HashMap getLocalizedValues(String keyname, String constant, Locale locale)
      Deprecated.
      This method will return a map of Localized Values from the registry. This method will first attempt to read the Fully Qualified Preference Keyname with the appended optional constant from the properties files, and if found will utilize this value to determine the desired localized values. If not found in the properties file, the registry will be checked, however placing non-localized information in the registry is NOT recommended.

      An example entry in the properties file might be:

        /wt/test/Sample%VALID_VALUES=ACCEPT_BUTTON,DENY_BUTTON

      Using this example, the getLocalizedValues() method would expect a keyname of /wt/test/Sample and a constant of %VALID_VALUES. This would then be queried in the properties files. The values ACCEPT_BUTTON and DENY_BUTTON would then be requested from the registry under the registry key of /wt/test/Sample%VALID_VALUES.ACCEPT_BUTTON for example, and this value would be placed in the HashMap.
      Parameters:
      keyname - The name of the preference key
      constant - The optional constant to append to the key
      locale - The locale of the Preference values.

      Supported API: true
      Returns:
      HashMap The map of localized values which correspond to the desired keyname, or an empty map if none are found. Values are delimited by comma.
    • getValue

      public static final String getValue(String keyname, String suffix)
      Deprecated.
      This method will return an entry from the Preference property Information files for the given keyname and optional suffix. If no property is found null will be returned.
      Parameters:
      keyname - The key name for the preference.
      suffix - The optional suffix (without the SUFFIX_TOKEN)

      Supported API: true
      Returns:
      The property for the keyname/suffix or null
    • getValues

      public static HashMap getValues(String keyname, String suffix)
      Deprecated.
      This method will return a map of all the values which are referenced by the designated keyname and optional suffix from the properties file. This data should be non-localized preference Meta-data. The method will first retrieve the property defined as the Fully Qualified Key Name and suffix, such as the example below:

        /wt/test/Sample%VALID_VALUES=ACCEPT_FLAG,DENY_FLAG

      For each value that is contained in the property (in this case there is two ACCEPT_FLAG and DENY_FLAG) these properties are looked up in the Prefernce Property files. Any values found will be returned in the map. If the value can not be found, the map will contain the value obtained from the reference (for example ACCEPT_FLAG) for both the map key and value.

      Note:In the above example, the suffix %VALID_VALUES was used, however any suffix is valid.
      Parameters:
      keyname - The keyname to retrieve
      suffix - The suffix to retrive the information under.

      Supported API: true
      Returns:
      HashMap a map of values from the registry.
    • initializeProperties

      public static void initializeProperties() throws IOException
      Deprecated.
      This method will initialize the properties object by re-reading the properties files, and creating the properties object if required.

      Supported API: true
      Throws:
      IOException - Thrown if there is an error reading the files.
    • reloadProperties

      public static void reloadProperties() throws IOException, WTException
      Deprecated.
      This method will cause the properties files to be reinitialized within the Preference Registry within the MethodServer.

      Supported API: true
      Throws:
      IOException - Thown if there is an error reading the files.
      WTException
    • main

      public static void main(String[] args)
      Deprecated.
      This method serves as a way to flush the properties registry files at runtime, which is useful if a developer wants to change the properties file without shutting down and restarting the method servers.

      Supported API: true
      Parameters:
      args - (ignored)