[xwiki-users] User directory
Hi, I would like to create a directory of users (with name, phone and email) who are in a specific group but I'm not comfortable with query. Is there anybody who have already work on a thing like this? To avoid temporally the problem, I thought add a tag on the concerned users, like this we can have a list of the user and go on the profile page, but XWiki has to be blacklisted, so it's doesn't work for usual user. Thanks Regard Ben -- View this message in context: http://xwiki.475771.n2.nabble.com/User-directory-tp5069225p5069225.html Sent from the XWiki- Users mailing list archive at Nabble.com.
2010/5/18 Ben Stuggler <[email protected]>:
Hi,
I would like to create a directory of users (with name, phone and email) who are in a specific group but I'm not comfortable with query. Is there anybody who have already work on a thing like this?
To avoid temporally the problem, I thought add a tag on the concerned users, like this we can have a list of the user and go on the profile page, but XWiki has to be blacklisted, so it's doesn't work for usual user.
Thanks
Regard
Ben
-- View this message in context: http://xwiki.475771.n2.nabble.com/User-directory-tp5069225p5069225.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
You can try the following groovy code {{groovy}} for(du in xwiki.search("select doc from XWikiDocument doc, BaseObject obj where obj.name = doc.fullName and obj.className = 'XWiki.XWikiUsers' and doc.fullName <> 'XWiki.Admin' order by doc.fullName")) { u = xwiki.getDocument(du.fullName) if (!u.isUserInGroup('mygroup')) continue print "[["+u+"]] fn="+u.first_name+" ln="+u.last_name+" "+u.email+" "; } {{/groovy}} Hop that help you Arnaud.
On Tue, May 18, 2010 at 11:46, Ben Stuggler <[email protected]> wrote:
Hi,
I would like to create a directory of users (with name, phone and email) who are in a specific group but I'm not comfortable with query. Is there anybody who have already work on a thing like this?
To avoid temporally the problem, I thought add a tag on the concerned users, like this we can have a list of the user and go on the profile page, but XWiki has to be blacklisted, so it's doesn't work for usual user.
There is many APIs provided by "rightsmanager" plugin so that you don't need to write low level queries. See http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/j... for an exhaustive list of the available methods. You access this api using $xwiki.rightsmanager For example you can get all the users names of the current wiki with the following code {{velocity}} $xwiki.rightsmanager.usersApi.allUsersNames {{/velocity}} or the users pages with {{velocity}} $xwiki.rightsmanager.usersApi.allUsers {{/velocity}} There is also lot's of way to filter the result (LIKE style filters, limit and offset) FYI this is what is used by the standard users and groups admin UI (filters included).
Thanks
Regard
Ben
-- View this message in context: http://xwiki.475771.n2.nabble.com/User-directory-tp5069225p5069225.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Hi, Thanks you for your help, it's giving me some way to obtain what I want! Regards Ben -- View this message in context: http://xwiki.475771.n2.nabble.com/User-directory-tp5069225p5074655.html Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (3)
-
Arnaud bourree -
Ben Stuggler -
Thomas Mortagne