wt.prefs.delegates
Class WindchillEnterpriseDelegate

java.lang.Object
  extended bywt.prefs.delegates.PreferenceDelegate
      extended bywt.prefs.delegates.WindchillEnterpriseDelegate

public class WindchillEnterpriseDelegate
extends PreferenceDelegate

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


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.


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:

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:
PreferenceDelegate, DefaultSystemDelegate, UserDelegate, PrefsUtil, WTPreferences, Preferences

Field Summary
static String WINDCHILL_ENTERPRISE
          non-changeable name for this delegate's division.
 
Fields inherited from class wt.prefs.delegates.PreferenceDelegate
DELEGATE_FILE, DELEGATE_ORDER, DELEGATE_PREFERENCE_NODE
 
Constructor Summary
WindchillEnterpriseDelegate()
           
 
Method Summary
 ArrayList getDivisions(WTUser user)
          This method will return the heirarchial divisions for the named user that this delegate is responsible for.
 ArrayList getDivisionsAsAdministrator(WTUser user)
          This method will return the divisions which the user has administrative privileges for.
 String getLocalizedName(String division, Locale aLocale)
          This method will retrieve the localized name of this Delegate from the resource bundle wt.prefs.prefsResource for display purposes.
 boolean isAdministrator(String division, WTUser user)
          Will determine if the user is an adminstrator of the division.
 
Methods inherited from class wt.prefs.delegates.PreferenceDelegate
getDivisions, getDivisionsAsAdministrator, isAdministrator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WINDCHILL_ENTERPRISE

public static final String WINDCHILL_ENTERPRISE
non-changeable name for this delegate's division. If a display name is desired use getLocalizedName to obtain the translated name.

See Also:
Constant Field Values
Constructor Detail

WindchillEnterpriseDelegate

public WindchillEnterpriseDelegate()
Method Detail

getLocalizedName

public String getLocalizedName(String division,
                               Locale aLocale)
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 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)
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 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:
Whether the user is a valid administrator for the given node. Will return false if the node is outside of the scope managed by the delegate.

getDivisionsAsAdministrator

public ArrayList getDivisionsAsAdministrator(WTUser user)
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 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)
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 PreferenceDelegate
Parameters:
user - ignored.
Returns:
The user's division.