Hi,
This code from 
http://code.xwiki.org/xwiki/bin/view/Snippets/Create200DummyUsersSnippet
for(user in users){
 fullName = user.get(0) + user.get(1)
 udoc = xwiki.getDocument("XWiki."+fullName)
 uobj = udoc.getObject("XWiki.XWikiUsers", true)
 uobj.set("first_name", user.get(0))
 uobj.set("last_name" , user.get(1))
 print("* Registering *" + udoc.fullName + "*\n")
 udoc.save()
 gObj = allGroup.newObject('XWiki.XWikiGroups')
 gObj.set('member',udoc.fullName)
}
How to test if membership of group Xwiki.XWikiAllgroup already exists
If I run the script twice I get two records in the group for the same person

I would rather have the same behaviour as with getDocument; if not exists it 
creates a new one, otherwise a new version?

Gerritjan
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to