Class PreferenceHelper
The methods of this class ( createEditMask() and
createContextMask() ) replace those found in the PrefsUtil class.
This class is safe to provide to the client and will be able to communicate with a Windchill Method Server over RMI if client side communication is required.
To assist in the usage of the Preferences Framework, the helper creation context methods will return context masks in the form as defined below. It is important to ensure any code utilizes the correct context in order to be 'well-formed' in a multi-level preference heirarchy.
Context Mask Format
The form of the context mask will be in a String Array using the following order: (order from 1 (top) to bottom in the Preference Heirarchy )
Division Policy.1
Division Policy.2
...
Division Policy.n
User
Division.n
...
Division.2
Division.1
System Defaults
Supported API: true
- See Also:
-
WTPreferencesPreferenceDelegateUserDelegate
-
Method Summary
Modifier and TypeMethodDescriptionstatic String[]Deprecated.This method will create a Context Mask for the current logged in user.static String[]createContextMask(String division) Deprecated.This method will create a Context Mask for the current logged in user.static String[]createContextMask(String aContainer, String division) Deprecated.This method will create a Context Mask for the current logged in user.static String[]createContextMask(String aDivision, WTUser aUser) Deprecated.This method will create a Context Mask for the named user.static String[]createContextMask(WTContainerRef aContainer, String aDivision, WTUser aUser) Deprecated.This method will create a Context Mask for the named user.static final StringDeprecated.This method will attempt to create the Edit Mask for the current user.static StringcreateEditMask(String division, boolean policy) Deprecated.This method will attempt to create the Edit Mask for the current user at a given division node in the Heirarchy.static StringcreateEditMask(String division, WTUser aUser, boolean policy) Deprecated.This method will attempt to create the Edit Mask for a given user at a given division node in the Heirarchy.static StringcreateEditMask(WTContainerRef aContainer, WTUser aUser, boolean policy) Deprecated.This method will attempt to create the Edit Mask for a given user at the given container node in the Heirarchy.static StringgetDisplayNameFromContext(String aContext, Locale aLocale) Deprecated.This method will access the delegate for the given context and return the localized string the represents that context within the delegate.static String[]Deprecated.This method will return the divisions that the user can administer from the current sesssion context.static String[]getDivisionsAsAdministrator(String aContainer) Deprecated.This method will return the divisions that the session's user can administer from the list of all the delegates in the current heirarchy.static String[]getDivisionsAsAdministrator(WTContainerRef aContainer) Deprecated.This method will return the divisions that the session's user can administer from the list of all the delegates in the current heirarchy.static String[]getDivisionsAsAdministrator(WTContainerRef aContainer, WTUser user) Deprecated.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[]Deprecated.This method will return the divisions that the named user can administer from the list of all the delegates in the current heirarchy.
-
Method Details
-
getDisplayNameFromContext
Deprecated.This method will access the delegate for the given context and return the localized string the represents that context within the delegate.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: true- Parameters:
aLocale- The locale of the current browseraContext- The context name or Division to localize.- Returns:
- String The display name or empty is no name was found.
- Throws:
WTException
-
getDivisionsAsAdministrator
Deprecated.This method will return the divisions that the named user can administer from the list of all the delegates in the current heirarchy.
Supported API: true- Parameters:
user- The user which wants administration rights.- Returns:
- String[] The array of Divisions which are administerable.
-
getDivisionsAsAdministrator
Deprecated.This method will return the divisions that the named user can administer from the list of all the delegates in the current heirarchy. For container delegate, the named container aContainer and its ancestors will be checked for administrative rights of the user.
Supported API: true- Parameters:
aContainer- The container to check adminitrative rights (for container delegate)user- The user which wants administration rights.- Returns:
- String[] The array of Divisions which are administerable.
-
getDivisionsAsAdministrator
Deprecated.This method will return the divisions that the session's user can administer from the list of all the delegates in the current heirarchy. For container delegate, the named container aContainer and its ancestors will be checked for administrative rights of the user.
Supported API: true- Parameters:
aContainer- The container to check adminitrative rights for the current session's user (for container delegate)- Returns:
- String[] The array of Divisions which are administerable.
-
getDivisionsAsAdministrator
Deprecated.This method will return the divisions that the user can administer from the current sesssion context. The user is obtained from the Session on the MethodServer via the SessionHelper.
Supported API: true- Returns:
- String[] Array of Divisions which are administerable.
-
getDivisionsAsAdministrator
Deprecated.This method will return the divisions that the session's user can administer from the list of all the delegates in the current heirarchy. For container delegate, the named container aContainer and its ancestors will be checked for administrative rights of the user.
Supported API: true- Parameters:
aContainer- Reference String of the container to check adminitrative rightsfor the current session's user (for container delegate)- Returns:
- String[] The array of Divisions which are administerable.
-
createEditMask
Deprecated.This method will attempt to create the Edit Mask for the current user. With this context, a call toWTPreferences.setEditContext( createEditMask( ) );Will edit a preference at the user level upon a
WTPreferences.put( aKey, aPreference );
Supported API: true- Returns:
- String The correct Edit Mask
-
createEditMask
Deprecated.This method will attempt to create the Edit Mask for the current user at a given division node in the Heirarchy. If the user can not administrate preferences at that division (ie. edit the value) then this method will return a null String. If the user is a valid user to edit at this level, then the correct context will be returned. With this context, a call toWTPreferences.setEditContext( createEditMask( division, policy ) );Will edit a preference at this level upon a
WTPreferences.put( aKey, aPreference );
Supported API: true- Parameters:
division- The division node in the heirarchy that is to be edited.policy- Whether the Editmask is a policy (WTPreferences.DIVISION_POLICY_CONTEXT)- Returns:
- String The correct Edit Mask or null if the user can not edit the value at this division node.
-
createEditMask
Deprecated.This method will attempt to create the Edit Mask for a given user at a given division node in the Heirarchy. If the user can not administrate preferences at that division (ie. edit the value) then this method will return a null String. If the user is a valid user to edit at this level, then the correct context will be returned. With this context, a call toWTPreferences.setEditContext( createEditMask( division, aUseri, policy ) );Will edit a preference at this level upon a
WTPreferences.put( aKey, aPreference );
Supported API: true- Parameters:
division- The division node in the heirarchy that is to be edited.aUser- The user requesting editing permissions.policy- Whether the Editmask is a policy (WTPreferences.DIVISION_POLICY_CONTEXT)- Returns:
- String The correct Edit Mask or null if the user can not edit the value at this division node.
-
createEditMask
Deprecated.This method will attempt to create the Edit Mask for a given user at the given container node in the Heirarchy. If the user can not administrate preferences at that container (ie. edit the value) then this method will return a null String. If the user is a valid user to edit at this level, then the correct context will be returned. * With this context, a call toWTPreferences.setEditContext( createEditMask( aContainer, aUser, policy ) );Will edit a preference at this level upon a
WTPreferences.put( aKey, aPreference );
Supported API: true- Parameters:
aContainer- The container in the heirarchy that is to be edited.aUser- The user requesting editing permissions.policy- Whether the Editmask is a policy (WTPreferences.CONTAINER_POLICY_CONTEXT)- Returns:
- String The correct Edit Mask or null if the user can not edit the value at this container.
-
createContextMask
Deprecated.This method will create a Context Mask for the current logged in 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.1was 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: true- Parameters:
division- The division to take higher priority- Returns:
- String[] array of contexts in the order above.
-
createContextMask
Deprecated.This method will create a Context Mask for the current logged in 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.1was 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: true- Parameters:
aContainer- The container string to create the hierarchy fordivision- The division to take higher priority- Returns:
- String[] array of contexts in the order above.
-
createContextMask
Deprecated.This method will create a Context Mask for the named user. The mask that is created, if a fully expanded context mask (except for theWTPreferences.USER_CONTEXTwhich 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.1was 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: true- Parameters:
aDivision- The division to create the Context Mask with.aUser- The user to create the mask for.- Returns:
- String[] array of contexts in the order above.
-
createContextMask
Deprecated.This method will create a Context Mask for the named user. The mask that is created, if a fully expanded context mask (except for theWTPreferences.USER_CONTEXTwhich 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, Policy.2, User, Division.1....}and
Division.1was passed in as the container 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: true- Parameters:
aContainer- The container to create the context mask with, for container delegate.aDivision- The preferred division to create the Context Mask with.aUser- The user to create the mask for.- Returns:
- String[] array of contexts in the order above.
-
createContextMask
Deprecated.This method will create a Context Mask for the current logged in user. The mask that is created, if a fully expanded context mask (except for theWTPreferences.USER_CONTEXTwhich is expanded during Preferences calls). The mask will have a proper heirarchy list for a given user. The user is taken from the current session context managed on the Method Server.Please see Context Mask Format for details on the proper format of the context mask.
Supported API: true- Returns:
- String[] array of contexts in the order above.
- See Also:
-