Importing a User List
About this task
When adding new users, Watson™ Explorer Engine gives you the ability to create multiple users at the same time by importing the content of a file or a URL. This file needs to contain a top level node that contains a set of user nodes as children.
The easiest way to figure out the format of these user nodes is to create a user using the Watson Explorer Engine administration tool, check its corresponding XML code in the users.xml, and duplicate this code by:
Procedure
- Replacing the user
- Deleting the set-var named user.name under user-identity.
- Replacing the value of the set-var named user.encrypted-password by the actual password that you want to set for the user. Note that Watson Explorer Engine will take care of encrypting each password automatically.
Results
Each user node should at least include code similar to the following XML:
<user name="myname"> <user-identity> <set-var name="user.encrypted-password">mypassword</set-var> </user-identity> </user>
The following is a sample user import file:
<?xml version="1.0" encoding="UTF-8" ?> <users> <user name="johnq"> <user-identity> <set-var name="user.encrypted-password">mypassword</set-var> <set-var name="user.group" project="vgroups">435</set-var> <set-var name="user.email">johnq@vivisimo.com</set-var> </user-identity> </user> <user name="albert"> <user-identity> <set-var name="user.encrypted-password">mypassword2</set-var> <set-var name="user.group" project="vgroups">417</set-var> <set-var name="user.email">albertq@vivisimo.com</set-var> </user-identity> </user> </users>
Note that if you import a user who already exists, the imported information will be merged into the existing profile.
To disable a user, just set the user.disabled variable in their user-identity section to user.disabled:
<user name="baduser"> <user-identity> <set-var name="user.disabled">user.disabled</set-var> </user-identity> </user>