User directory

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

User directory

Ben Stuggler
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
Reply | Threaded
Open this post in threaded view
|

Re: User directory

Arnaud bourree-2
2010/5/18 Ben Stuggler <[hidden email]>:

>
> 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
> [hidden email]
> 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.
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: User directory

Thomas Mortagne
Administrator
In reply to this post by Ben Stuggler
On Tue, May 18, 2010 at 11:46, Ben Stuggler <[hidden email]> 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/java/com/xpn/xwiki/plugin/rightsmanager/RightsManagerPluginApi.java
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
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: User directory

Ben Stuggler
Hi,

 Thanks you for your help, it's giving me some way to obtain what I want!

Regards

Ben