wt.prefs.delegates
Class PreferenceDelegate

java.lang.Object
  extended bywt.prefs.delegates.PreferenceDelegate
Direct Known Subclasses:
ContainerDelegate, DefaultSystemDelegate, UserDelegate, WindchillEnterpriseDelegate

public abstract class PreferenceDelegate
extends Object

PreferenceDelegate

This is the abstract class that may be utilized by customizers to create site-specific delegates. Each delegate must be declared to the Windchill system via the Preferences Interface by creating a preference key equal to /wt/prefs/delegates/$DIVISION or /wt/prefs/delegates/$DIVISION:Unique Name and a value of the fully qualified class name (for example cust.prefs.LDAPDelegate). As well, the Preference Order property (wt.prefs.delegateOrder) in the delegates.properties file must be changed to add the appropriate delegate to the preference order.

Each subclass of PreferenceDelegate must implement the abstract methods mentioned below. Each method states what the inputs are and what the expected result of the method should produce. The manner in which this is achieved (whether via a XML file, LDAP system etc.) is upto the customizer to implement at this stage.

Glossary

See Also:
wt.prefs.WTPreferences, wt.prefs.delegates.DefaultSystemDelegate, wt.prefs.delegates.UserDelegate

Field Summary
static String DELEGATE_FILE
           
static String DELEGATE_ORDER
           
static String DELEGATE_PREFERENCE_NODE
           
 
Constructor Summary
PreferenceDelegate()
           
 
Method Summary
 ArrayList getDivisions(WTContainerRef aContainer, WTUser user)
          This method is called by the Delegate to determine the nodes that the delegate is responsible for either above or below the current node (or division).
abstract  ArrayList getDivisions(WTUser user)
          This method is called by the Delegate to determine the nodes that the delegate is responsible for either above or below the current node (or division).
 ArrayList getDivisionsAsAdministrator(WTContainerRef aContainer, WTUser user)
          This method will return the divisions of given container and all its ancestor containers the user has administration privileges for.
abstract  ArrayList getDivisionsAsAdministrator(WTUser user)
          This method will return the divisions within this delegate that the user has administration privileges for.
abstract  String getLocalizedName(String division, Locale aLocale)
           
abstract  boolean isAdministrator(String division, WTUser user)
          Determine whether the user is an adminstrator of the desired division.
 boolean isAdministrator(WTContainerRef container, String division, WTUser user)
          Determine whether the user is an administrator of the desired container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELEGATE_ORDER

public static final String DELEGATE_ORDER
See Also:
Constant Field Values

DELEGATE_PREFERENCE_NODE

public static final String DELEGATE_PREFERENCE_NODE
See Also:
Constant Field Values

DELEGATE_FILE

public static final String DELEGATE_FILE
See Also:
Constant Field Values
Constructor Detail

PreferenceDelegate

public PreferenceDelegate()
Method Detail

getLocalizedName

public abstract String getLocalizedName(String division,
                                        Locale aLocale)

isAdministrator

public abstract boolean isAdministrator(String division,
                                        WTUser user)
Determine whether the user is an adminstrator of the desired division. If the division is not in the scope of the current delegate then the method should always return false. For container scope calls, this method would check for administrative rights on the exchange container.

Parameters:
division - The current node within the structure
user - The current user of the preference.
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 abstract ArrayList getDivisionsAsAdministrator(WTUser user)
This method will return the divisions within this delegate that the user has administration privileges for. If there are no adminstrative divisions for this user, then null will be returned. For container scope delegate, this method would get the divisions for exchange container if the user has admininstrative previleges.

Note:

Parameters:
user - The user to look for administration divisions for.
Returns:
The array of divisions that this user has administration privileges for or null if there are none.

getDivisions

public abstract ArrayList getDivisions(WTUser user)
This method is called by the Delegate to determine the nodes that the delegate is responsible for either above or below the current node (or division). For container scope delegate, this method would return the divisions of exchange container.

Notes:

Parameters:
user - The current user of the preference
Returns:
a String Array of divisions for this delegate.

isAdministrator

public boolean isAdministrator(WTContainerRef container,
                               String division,
                               WTUser user)
Determine whether the user is an administrator of the desired container. If the container is not in the scope of the current delegate then the method should always return false.

Note:

Parameters:
container - The container for which administrative rights of user are ascertained
division - The current node within the structure (can be null for container scope calls)
user - The current user of the preference.
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(WTContainerRef aContainer,
                                             WTUser user)
This method will return the divisions of given container and all its ancestor containers the user has administration privileges for. If there are no adminstrative divisions for this user, then null will be returned.

Note:

Note:

Parameters:
aContainer - The container check for administrative rights for.
user - The user to look for administration divisions for.
Returns:
Array of divisions that the user has administration privileges for or null if there are none.

getDivisions

public ArrayList getDivisions(WTContainerRef aContainer,
                              WTUser user)
This method is called by the Delegate to determine the nodes that the delegate is responsible for either above or below the current node (or division).

Notes:

Parameters:
aContainer - The current container scope for getting the divisions.
user - The current user of the preference
Returns:
a String Array of divisions for this delegate.