Class WindchillEnterpriseDelegate

java.lang.Object
wt.prefs.delegates.PreferenceDelegate
wt.prefs.delegates.WindchillEnterpriseDelegate

@Deprecated public class WindchillEnterpriseDelegate extends wt.prefs.delegates.PreferenceDelegate
Deprecated.
This class is provided as a potential top level delegate for customizations. Out-of-the-box, this delegate will provide customers with the ability to set system wide preferences and policies based on the System Default preferences. The ruleset for this delegate is that any member of the Windchill Group Administrators will have the authority to administrate and edit preferences at this level in the preference Heirarchy. Thus, this delegate fills a gap between the wt.prefs.delegates.UserDelegate and wt.prefs.delegates.DefaultSystemDelegate which allows preference values and preference policies to be set different from the system default but available to all users.

Like all delegates, this delegate could be subclassed and it's methods overloaded to handle a customers situation, or not be implemented at all. The order of delegates are defined in the delegates.properties file under the property wt.prefs.delegates.DelegateOrder which defines the heirarchy of delegates from top to bottom. See wt.prefs.delegates.PreferenceDelegate for more details on this property.

When using this delegate in the Preference Heirarchy, the wt.prefs.delegates.DelegateOrder property entry for this delegate should appear as $DIVISION:Windchill Enterprise. As well, in the load file preferences.txt an entry should be included which defines the class to invoke for this delegate definition. The shipped preferences.txt file should include a line
    PrefEntry~$DIVISION:Windchill Enterprise~wt.prefs.delegates.WindchillEnterpriseDelegate~/wt/prefs/delegates

which defines that the fully qualified preference name wt/prefs/delegates/$DIVISION:Windchill Enterprise will utilize the class wt.prefs.delegates.WindchillEnterprsieDelegate.

Customizing WindchillEnterpriseDelegate

This delegate can be easily customized to handle different users beyond those defined in the delegate.properties file without changing the inplace heirarchy of preferences. First the following step should be done.

  • Change the Preference Value of the fully qualified preference name to point to the new sub-class. For example (wt.customizations.prefs.MySystemAdminDelegate).
  • Make sure the proper preference is changed using either the Preferences Administrator interface or editing and reloading the preferences.txt file.
    NOTE In the second case do NOT reload the preferences.txt file on a live system since this will override any set preferences.

Next a class must be created which extends this class. Since the constant WINDCHILL_ENTERPRISE is defined as public the subclass may utilize the parent's methods.
Finally, the method isAdministrator(String division, WTUser user) should be overloaded to include any code that will include additional users beyond those defined to be memebers of the Administrators Group A sample of this method might be:

    public boolean isAdministrator(String division, WTUser user)
    {
      boolean tvadmin = super.isAdministrator(division,user);
      if( tvadmin == false )
      {
        // do custom user validation.
      }
      return tvadmin;
    }
This would be all that is necessary to develop a delegate which uses Windchill Administrators and some other users (such as a new group, etc.).

Supported API: true
Extendable: true
See Also:
  • Method Details

    • getLocalizedName

      public String getLocalizedName(String division, Locale aLocale)
      Deprecated.
      This method will retrieve the localized name of this Delegate from the resource bundle wt.prefs.prefsResource for display purposes.

      Supported API: true
      Specified by:
      getLocalizedName in class wt.prefs.delegates.PreferenceDelegate
      Parameters:
      division - (ignored)
      aLocale - The locale of the client for the message.
      Returns:
      The localized name of the delegate.
    • isAdministrator

      public boolean isAdministrator(String division, WTUser user)
      Deprecated.
      Will determine if the user is an adminstrator of the division. As user will be considered an administrator of the Windchill Enterprise division if they are a member of the Windchill Administrators group.

      Supported API: true
      Specified by:
      isAdministrator in class wt.prefs.delegates.PreferenceDelegate
      Parameters:
      user - The user of determine administrative privileges for.
      division - The divsion to apply the privileges too (ignored in this class, since this is the top-level division in the heirarchy
      returns - true if the user matches the current context's session user.
    • getDivisionsAsAdministrator

      public ArrayList getDivisionsAsAdministrator(WTUser user)
      Deprecated.
      This method will return the divisions which the user has administrative privileges for. This method will return the Windchill Enterprise division for members of the Windchill Administrator's group and will return empty for any other user.

      Supported API: true
      Specified by:
      getDivisionsAsAdministrator in class wt.prefs.delegates.PreferenceDelegate
      Parameters:
      user - The user to check authentication on.
      Returns:
      The Windchill Enterprise division for Administrators or empty for other users
    • getDivisions

      public ArrayList getDivisions(WTUser user)
      Deprecated.
      This method will return the heirarchial divisions for the named user that this delegate is responsible for. Currently this delegate will return the Windchill Enterprise division.

      Supported API: true
      Specified by:
      getDivisions in class wt.prefs.delegates.PreferenceDelegate
      Parameters:
      user - ignored.
      Returns:
      The user's division.