I had to manage users and their rosters programmatically. UserService is a good one solution to manage users, but not their rosters. I’ve added support to the plugin to add, update, delete user rosters. Attached patch adds this capability. userService.ManageRoster.patch.zip (3847 Bytes)
I’ve created user with name ‘manager’ and added ‘user2@localhost’ and some other items successfuly. Works well for me.
As I know, Openfire does not verify duplicate roster items. And you can see no roster items in Admin panel, but they are in DB. You probably need clear Roster cache to make it sync with DB.
Jar file attached to third message of this thread has already been patched. You should just install it like any other plugin in OpenFire admin console (if standart userservice plugin is already installed you should uninstall it first). When you install patched plugin, you can see example of plugin usage on plugin description page (http:// /plugin-admin.jsp?plugin=userservice&showReadme=true&decorator=none) or you can unzip jar and find readme.html file.
OK - this patch has been merged into the Openfire trunk. It will be available in the next nightly build, but if you would like to test it immediately, you can grab the plugin from the continuous integration build here (userservice.jar). We would appreciate some help testing to ensure the patch was merged correctly.
I’ve downloaded the jar-file and tried to add/delete user/roster successfuly.
One thing I’ve just found is that I can add new user without specifying a password. Plugin’s readme says ‘password Required for ‘add’ operation’, but it actually does not verify if it is specified or not.
It was implemented in a such way in original plugin. Not sure if it should be changed.