Guess what? I'm uploaded one last version of the patch. I started thinking that it would suck to enable sharing to everybody and then decide that that kind of roster didn't work well in your organization. With my previous patches, you'd have to go unshare everything manually. Yikes! But with this latest patch, you can now set "groups.autoshare=nobody" and have all the sharing removed automagically. Yeah!
Here are a few effects of this patch:
1) Since we alter the global RosterManager, it works for all group providers, not just LDAP.
2) The initial roster population and autosharing is considerably slower than I expected when set to "everybody", but once the JIVEGROUPPROP table is updated, non-cached roster builds go pretty quick. Testing locally on my 2.8GHz workstation with 150+ LDAP users in 21 LDAP groups using the embedded-db, I got the following times:
nobody->everybody = 30sec
everybody->nobody = 8sec
nobody->onlyGroup = 1sec
everybody->onlyGroup = 3sec
3) Once the autosharing happens, the sharing of those groups is persistent in the DB even if you delete the autoshare system property. To remove the sharing, set "groups.autoshare=nobody".
4) Once enabled, all groups will be reshared using the new autoshare policy regardless of what they were set to previously. This patch modifies existing groups as well as new ones. For example, if you have all your groups manually set to share to "onlyGroup" and you set "group.autoshare=everybody", all existing groups will be reshared to "everybody", effectively overwriting the old showInRoster values.
Having this would be great. In the meantime I tried to automate this with something along the lines of:
GroupManager groupManager = GroupManager.getInstance();
ArrayList<Group> groups = new ArrayList<Group>(groupManager.getGroups());
for (Group group : groups) {
group.getProperties().put("sharedRoster.showInRoster", "onlygroup");
group.getProperties().put("sharedRoster.displayName", group.getDescription());
group.getProperties().put("sharedRoster.groupList", toList(new String[] {}, "UTF-8"));
}
but although this code appears to be correct, and viewing a group in the web interface shows these changes have been made, the groups are not pushed to clients unless I click "save changes" on the group-edit.jsp (without having made any changes), at which point the groups appear in connected clients. Is this just a roster caching issue or have I misunderstood/got something wrong?