Hi Mathieu,
In a workspace, the membership relationship is stored in the workspace's
XWiki.XWikiAllGroup. In other words, all global users that are members of
the someWorkspace:XWiki.XWikiAllGroup are considered to be members of the
"someWorkspace" workspaces itself.
To get a list of all the members of workspace "someWorkspace", you can just
query the members of the "someWorkspace:XWiki.XWikiAllGroup" group.
However, this only gives you references to the main wiki users (global
users). If you want to inspect each of these users individually (first
name, last name, avatar, etc.), you will need to query this information on
the main wiki, since that is where the global users are stored.
So to recap:
- User information/storage: in the main wiki, in the user's profile page
- Workspace membership information: in the workspace, XWiki.XWikiAllGroup
The UserDirectory of a workspace does some extra funky stuff to come up
with the list of all users that are direct or indirect members of the
workspace group (someWorkspace:XWiki.XWikiAllGroup). If you are feeling
adventurous, I invite you to have a look at
XWiki.UserDirectoryLivetableResultsOverride inside a workspace. This page
is used by the Main.UserDirectory inside a workspace to override the way
the UserDirectory behaves on a non-workspace wiki (which is to list all the
local users -- this is not the case in a workspace).
Hope this helps,
Eduard
On Mon, Jun 4, 2012 at 5:08 PM, <mathieu.canzerini(a)intech.lu> wrote:
Thanks for your answer.
If I set the wiki to query with this API, I will get all of the users
of the main wiki in the suggests.
But I want only get the workspace users. Is it possible ?
Thank you.
On Mon, 4 Jun 2012 16:02:01 +0200, Ludovic Dubost <ludovic(a)xwiki.com>
wrote:
Yes,
your users are in the main wiki. In DBListClass you cannot query the
global wiki.
You will need to write a customer displayer script and declare it in
your class
An example of customer displayer is here:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Multiselect+custom+dis…
Your custom displayer will need to query the main wiki using a
specific search API (in the XWiki object) which allows to set the wiki
to query.
Ludovic
2012/6/4 <mathieu.canzerini(a)intech.lu>lu>:
> Hello everybody,
>
> Here is my problem :
> I'm in a workspace.
> I've created a class with a database list field.
> I've written the HQL query :
> -> select obj.name from BaseObject obj where
> obj.className='XWiki.XWikiUsers'
> And when i'm in edit mode, the suggest says me : "no results !" when
i'm
> writing a username.
>
> I wonder if this problem is related to the difference between local
users (=
> workspace users ?) and global users (= wiki
users ?).
>
> Thanks for your attention
>
> M.Canzerini
>
> _______________________________________________
> users mailing list
> users(a)xwiki.org
>
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users