+

Search Tips   |   Advanced Search

Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS

 

Runtime operations user preferences administrative tasks


You can use the Jacl and Jython scripting languages to clone, set, and get preferences with the wsadmin tool. Use the commands and parameters in the UserPreferences group. User preferences are stored under the cell context or in the context for each resource type. The following list gives examples on the cell level and at each resource level:

Use the following commands to work with the preferences for runtime operations:

 

clonePreference

The clonePreference command copies a preference from one user or role to another user or role.

Target object: The configID of the parent of where the preference is cloned.

Required parameters

-name
Name of the preference to clone. (String, required)

Optional parameters

-scope
Specifies the scope of the preference to save when the preferences are cloned. The scope can be one of the following values:

  • Applications

  • Servers

  • Clusters

  • ServiceClasses
If you do not specify a scope, the scope of the configID is used. (String, optional)
-touser
Specifies the user for which to retrieve preferences. If you do not indicate this value, the default uses the user ID for the session in which the command is running. (String, optional)
-torole
Specifies the role for which to retrieve preferences. This value is ignored if you specified the -touser parameter. (String, optional)
-fromuser
Specifies the user that gets a copy the preferences. You can indicate multiple users by putting the users in a list, for example: user1,user2,user3. Do not put spaces in the list. (String, optional)
-fromrole
Specifies the role that gets a copy of the preferences. (String, optional)

Return value

The command returns

Batch mode example usage

Interactive mode example usage

 

getPreferences

The getPreferences command returns a collection of preferences based on the preference document you specify by passing in a role or user name. You must have administrator privileges to get preferences for a certain user or user role.

Target object: the configID of the parent

Required parameters

-name
Name of the preference. (String, required)

Optional parameters

-scope
Specifies a scope for the preferences. You can choose from one of the following valid values:

  • Applications

  • Servers

  • Clusters

  • ServiceClasses
The default scope is empty, or undefined. If the scope is empty, the scope is derived from where the document is being read. For example, if the document is in the cell scope, then the scope is cell scoped. If the document is in a specific server context, then the scope is assumed to be applicable to that server. (String, optional)
-user
Specifies the user name for which to retrieve preferences. If you do not indicate a user, the default action is to use the user name that is running the script. (String, optional)
-role
Specifies the user role for which to retrieve preferences. (String, optional)

Return value:

The command returns a DescriptivePropertyGroup object that contains the preferences, or null if no preferences are found.

Batch mode example usage

Interactive mode example usage

 

setPreference

The setPreference command sets a specific preference in a preference document. You must have administrator privileges to set preferences for a certain user or user role.

Target object: The configID of the parent

Required parameters

-name
Name of the preference. (String, required)
-propertyLongName
Specifies the fully-qualified path to the property in the property group, delimited by a forward slash (/) character. If the property is directly contained in the root property group, then the short name of the property can be used because it would be exactly equal to the long name. (String, required)
-propertyValue
New value to set for the preference. (String, required)

Optional parameters

-scope
Specifies a scope for the preferences. You can choose from one of the following valid values:

  • Applications

  • Servers

  • Clusters

  • ServiceClasses
The default scope is empty, or undefined. If the scope is empty, the scope is derived from where the document is being read. For example, if the document is in the cell scope, then the scope is cell scoped. If the document is in a specific server context, then the scope is assumed to be applicable to that server. (String, optional)
-user
Specifies the user name for which to save preferences. If you do not indicate a user, the default action is to use the user name that is running the script. (String, optional)
-role
Specifies the user role for which to save preferences. (String, optional)

Return value

The command returns

Batch mode example usage

Interactive mode example usage

 

Jython preferences object commands

Use the following examples to interact with the preferences object with Jython commands:

To list preferences per user:

prefSets = AdminConfig.list("PreferenceSet")
print prefSets

To remove preferences for a user:

prefid = AdminConfig.getid("/PreferenceSet:User_1")
AdminConfig.remove(prefid)
AdminConfig.save()

To list preferences for all users, grouped by user:

prefs = AdminConfig.list("Preferences")
print prefs




 

Related concepts


Runtime operations overview

 

Related tasks


Monitor operations
Creating and managing reports

 

Related reference

Administrator scripting interfaces