|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.prefs.PreferenceHelperService
The PreferenceHelperService is the server-side Helper for the Preferences Framework and is responsible for the maintaining of the Delegate Heirarchy and Delegate list in Windchill.
The public methods contained in this class should not be
called directly, but instead should be called from the
wt.prefs.PreferenceHelper
class.
This class will on the server-side
of any RMI calls where necessary, and will work properly
only on the server environment due to server-side dependencies.
Supported API: false
PreferenceHelper
,
WTPreferences
,
PreferenceDelegate
,
UserDelegate
Nested Class Summary | |
private static class |
PreferenceHelperService.PrefCacheKey
|
Field Summary | |
private static Cache |
cache
|
private static int |
cacheSize
|
private static List |
cvDelegateHeirarchy
List of all DelegateStructures for initialized delegates |
private static String |
cvDelegateList
The most recently obtained heirarchy list from delegates.properties |
private static Hashtable |
cvDelegates
The hashtable of all Delegates |
private static long |
cvLastUpdate
Get the last update of the delegate orders |
private static String |
DEF_CONTAINER_DEL
Default container delegate class. |
private static long |
TIME_OUT
Timeout for properties refresh |
private static boolean |
VERBOSE
|
Fields inherited from interface wt.method.RemoteAccess |
versionID |
Constructor Summary | |
PreferenceHelperService()
|
Method Summary | |
static String[] |
createContextMask(String division)
This method will create a Context Mask for the current logged in user. |
static String[] |
createContextMask(String aContainer,
String division)
This method will create a Context Mask for the current logged in user. |
static String[] |
createContextMask(String aDivision,
WTUser aUser)
This method will create a Context Mask for the named user. |
static String[] |
createContextMask(WTContainerRef aContainer,
String aDivision,
WTUser aUser)
This method will create a Context Mask for the named user. |
static String |
createEditMask()
This method will attempt to create the Edit Mask for the current user. |
static String |
createEditMask(String division,
Boolean apolicy)
This method will attempt to create the Edit Mask for the current user at a given division node in the Heirarchy. |
static String |
createEditMask(String division,
WTUser aUser,
Boolean apolicy)
This method will attempt to create the Edit Mask for a given user at a given division node in the Heirarchy. |
static String |
createEditMask(WTContainerRef aContainer,
WTUser aUser,
Boolean apolicy)
This method will attempt to create the Edit Mask for a given user at a given container level in the Heirarchy. |
private static PreferenceDelegate |
getDelegate(String delegate_tag)
This method will return a PreferenceDelegate that is assigned as the
delegate for a specific delegate tag. |
private static void |
getDelegateHeirarchy()
This method will access the Preferences Framework and will create a heirarchial list of PreferenceDelegates as defined in the Property wt.prefs.delegates.DelegateOrder |
static String |
getDisplayNameFromContext(String aContext,
Locale aLocale)
This method will access the delegate for the given context and return the localized string the represents that context within the delegate. |
static String[] |
getDivisionsAsAdministrator()
This method will return the divisions that the user can administer from the current sesssion context. |
static String[] |
getDivisionsAsAdministrator(String aContainer)
This method will return the divisions that the named user can administer from the list of all the delegates in the current heirarchy. |
static String[] |
getDivisionsAsAdministrator(WTContainerRef aContainer)
This method will return the divisions that the named user can administer from the list of all the delegates in the current heirarchy. |
static String[] |
getDivisionsAsAdministrator(WTContainerRef aContainer,
WTUser aUser)
This method will return the divisions that the named user can administer from the list of all the delegates in the current heirarchy. |
static String[] |
getDivisionsAsAdministrator(WTUser user)
This method will return the divisions that the named user can administer from the list of all the delegates in the current heirarchy. |
static Long |
getTimeOutInterval()
|
static void |
setTimeOutInterval(Long time)
|
static String |
transformContext(String context)
Performs transformations on context Transforms WTPreferences.USER_CONTEXT to WTPreferences.USER_CONTEXT + identity Supported API: false |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static List cvDelegateHeirarchy
private static Hashtable cvDelegates
private static String cvDelegateList
private static long cvLastUpdate
private static long TIME_OUT
private static int cacheSize
private static boolean VERBOSE
private static final String DEF_CONTAINER_DEL
private static Cache cache
Constructor Detail |
public PreferenceHelperService()
Method Detail |
public static String getDisplayNameFromContext(String aContext, Locale aLocale) throws WTException
NOTE: If the context is a WTPreferences.DIVISION_CONTEXT or WTPreferences.DIVISION_POLICY_CONTEXT, the Macro constant will be stripped before being sent to the delegate. Both a fully defined context (one that has a WTPreferences.DIVISION_CONTEXT) or a delegate context (just the name of the division) are valid parameters.
Supported API: false
aLocale
- The locale of the current browseraContext
- The context name or Division to localize.
WTException
public static Long getTimeOutInterval() throws WTException
WTException
public static void setTimeOutInterval(Long time) throws WTException
WTException
private static final void getDelegateHeirarchy()
wt.prefs.delegates.DelegateOrder in the delegates.properties
file.
This property lists the order from the top
most context (mostly likely $DEFAULT - the system defaults) and through
the delegates that are implemented followed by the $USER delegate. This
property is comma separated and may contain trailing and leading spaces
which are stripped off at read time. Any new delegates added to the
system or removed should be reflected in this property. For example, if
a customization creates an LDAPDelegate to read from their LDAP Heirarchy,
and there will be a $DEFAULT and $USER level, the customizers should
create a $DIVISION context in the property like and a corresponding
$DIVISION preference. The property list might now
read:
$DEFAULT,$DIVISION,$USER
As mentioned above, another preference should be created,
/wt/prefs/delegates/$DIVISION
which contains the class that will
be utilized to delegate the Division. (for example cust.prefs.LDAPDelegate)
If there are different delegates for handling different $DIVISION
contexts, then they also must be listed in delegates.properties in proper order. For
example,
$DEFAULT,$DIVISION:Enterprise,$DIVISION:Plant,$DIVISION:Department,$DIVISION,$USER
In the above example, the Preference Heirarchy would be
interpreted by the delegates using the $DEFAULT delegate first, followed
by the $DIVISION:Enterprise delegate and so forth, using the $DIVISION to
handle any other divisions below the ones listed explicitly.
This structure can best be described by looking at things from a tree
model, where we have
System Defaults
-Windchill Enterprise
-Cutsomer Tree Heirarchy (LDAP)
-Individual User Preferences
By Default Windchill will ship with the following heirarchy, which may
be customized on site.
System Defaults
- Windchill Enterprise
- Individual User Preferences
Notes:
- The $DIVISION tag above is used by both $DIVISION and
$DIVISION_POLICIES, since both are essentially the same division, except
they have different ordering in the contextMasks.
- The usage of
WTPreferences.xxxx_CONTEXT
tags is meant only to
separate the idea of System Default, User and 'other' levels.
Supported API: false
private static PreferenceDelegate getDelegate(String delegate_tag)
PreferenceDelegate
that is assigned as the
delegate for a specific delegate tag. For example if the delegate
tag is WTPreferences.DEFAULT_CONTEXT
then the delegate for handling
Windchill System Defaults should be returned. Likewise,
WTPreferences.USER_CONTEXT
will return the delegate for the User
Preferences. All other context delegates are obtained in the following
manner:
WTPreferences.DIVISION_CONTEXT:some_division
or
WTPreferences.DIVISION_POLICY_CONTEXT:some_division
an attempt is first
made to find the Delegate for some_division
. If this is not able to be
located, then the Delegate for WTPreferenes.DIVISION_CONTEXT
will be
returned.
delegate_tag
- The Context to determine the proper delegate for.
public static String[] getDivisionsAsAdministrator(WTUser user) throws WTException
user
- The user which wants administration rights.
WTException
public static String[] getDivisionsAsAdministrator(WTContainerRef aContainer, WTUser aUser) throws WTException
aContainer
- The container to check administrative rights.aUser
- The user which wants administration rights.
WTException
public static String[] getDivisionsAsAdministrator(WTContainerRef aContainer) throws WTException
WTException
public static String[] getDivisionsAsAdministrator() throws WTException
WTException
public static String[] getDivisionsAsAdministrator(String aContainer) throws WTException
WTException
public static final String createEditMask() throws WTException
WTPreferences.setEditContext( createEditMask( ) );
Will edit a preference at the user level upon a
WTPreferences.put( aKey, aPreference );
Supported API: false
WTException
public static String createEditMask(String division, Boolean apolicy) throws WTException
WTPreferences.setEditContext( createEditMask( division, policy ) );
Will edit a preference at this level upon a
WTPreferences.put( aKey, aPreference );
Supported API: false
division
- The division node in the heirarchy that is to be edited.
WTException
public static String createEditMask(String division, WTUser aUser, Boolean apolicy) throws WTException
WTPreferences.setEditContext( createEditMask( division, aUseri, policy ) );
Will edit a preference at this level upon a
WTPreferences.put( aKey, aPreference );
Supported API: false
division
- The division node in the heirarchy that is to be edited.aUser
- The user requesting editing permissions.
WTException
public static String createEditMask(WTContainerRef aContainer, WTUser aUser, Boolean apolicy) throws WTException
WTPreferences.setEditContext( createEditMask( aContainer, aUser, policy ) );
Will edit a preference at this level upon a
WTPreferences.put( aKey, aPreference );
Supported API: false
aContainer
- The container in the heirarchy that is to be edited.aUser
- The user requesting editing permissions.
WTException
public static String[] createContextMask(String division) throws WTException
{ Policy.1, Policy2, User, Division.1....}
and
Division.1
was passed in as the division parameter then the new order
would be
{ Policy.1, Policy.2, Division.1, User, .... }
Please see Context Mask Format for details
on the proper format of the context mask.
Supported API: false
division
- The division to take higher priority
WTException
public static String[] createContextMask(String aContainer, String division) throws WTException
{ Policy.1, Policy2, User, Division.1....}
and
Division.1
was passed in as the division parameter then the new order
would be
{ Policy.1, Policy.2, Division.1, User, .... }
Please see Context Mask Format for details
on the proper format of the context mask.
Supported API: false
aContainer
- The container to create the hierarchy fordivision
- The division to take higher priority
WTException
public static String[] createContextMask(String aDivision, WTUser aUser) throws WTException
WTPreferences.USER_CONTEXT
which is expanded during
Preferences calls). The mask will have a proper heirarchy list for a given user.
The mask that is created with the named division being taken in precedence over the normal ordering of the context mask. For example, if the normal order was:
{ Policy.1, Policy2, User, Division.1....}
and
Division.1
was passed in as the division parameter then the new order
would be
{ Policy.1, Policy.2, Division.1, User, .... }
Please see Context Mask Format for details
on the proper format of the context mask.
Supported API: false
@param aUser The user to create the mask for.
aDivision
- The division to create the Context Mask with.
WTException
public static String[] createContextMask(WTContainerRef aContainer, String aDivision, WTUser aUser) throws WTException
WTPreferences.USER_CONTEXT
which is expanded during
Preferences calls). The mask will have a proper heirarchy list for a given user.
The mask that is created with the named division being taken in precedence over the normal ordering of the context mask. For example, if the normal order was:
{ Policy.1, Policy2, User, Division.1....}
and
Division.1
was passed in as the division parameter then the new order
would be
{ Policy.1, Policy.2, Division.1, User, .... }
Please see Context Mask Format for details
on the proper format of the context mask.
Supported API: false
@param aUser The user to create the mask for.
aDivision
- The division to create the Context Mask with.
WTException
public static String transformContext(String context) throws WTException
context
- context to be transformed
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |