com.xpn.xwiki.plugin.rightsmanager
Class RightsManagerPluginApi

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.plugin.PluginApi<RightsManagerPlugin>
          extended by com.xpn.xwiki.plugin.rightsmanager.RightsManagerPluginApi

public class RightsManagerPluginApi
extends PluginApi<RightsManagerPlugin>

API for managing rights, users and groups.

Since:
XWiki Core 1.1.2, XWiki Core 1.2M2
Version:
$Id: 758bc77a813509992694d5f754a8e6c2981381cc $

Field Summary
static String CONTEXT_LASTERRORCODE
          Field name of the last error code inserted in context.
static String CONTEXT_LASTEXCEPTION
          Field name of the last api exception inserted in context.
protected static org.slf4j.Logger LOGGER
          The logging toolkit.
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
RightsManagerPluginApi(RightsManagerPlugin plugin, XWikiContext context)
          Create an instance of the Rights Manager plugin user api.
 
Method Summary
 int countAllGroupsNamesForMember(String member)
          Return the number of groups containing provided member.
 int countAllMembersNamesForGroup(String group)
          Return the number of members provided group contains.
 Collection<String> getAllGroupsNamesForMember(String member)
          Get all groups containing provided user.
 Collection<String> getAllMatchedMembersNamesForGroup(String group, String matchField, int nb, int start, Boolean orderAsc)
          Get members of provided group.
 Collection<String> getAllMembersNamesForGroup(String group)
          Get all members (users or groups) provided group contains.
 Collection<String> getAllMembersNamesForGroup(String group, int nb, int start)
          Get all members (users or groups) provided group contains.
 RightsManagerGroupsApi getGroupsApi()
           
 RightsManagerRightsApi getRightsApi()
           
 RightsManagerUsersApi getUsersApi()
           
 
Methods inherited from class com.xpn.xwiki.plugin.PluginApi
getInternalPlugin, getProtectedPlugin, setPlugin
 
Methods inherited from class com.xpn.xwiki.api.Api
convert, convert, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_LASTERRORCODE

public static final String CONTEXT_LASTERRORCODE
Field name of the last error code inserted in context.

See Also:
Constant Field Values

CONTEXT_LASTEXCEPTION

public static final String CONTEXT_LASTEXCEPTION
Field name of the last api exception inserted in context.

See Also:
Constant Field Values

LOGGER

protected static final org.slf4j.Logger LOGGER
The logging toolkit.

Constructor Detail

RightsManagerPluginApi

public RightsManagerPluginApi(RightsManagerPlugin plugin,
                              XWikiContext context)
Create an instance of the Rights Manager plugin user api.

Parameters:
plugin - the entry point of the Rights Manager plugin.
context - the XWiki context.
Method Detail

getRightsApi

public RightsManagerRightsApi getRightsApi()
Returns:
the API for managing rights and inheritance.

getUsersApi

public RightsManagerUsersApi getUsersApi()
Returns:
the API for managing users.

getGroupsApi

public RightsManagerGroupsApi getGroupsApi()
Returns:
the API for managing groups.

getAllGroupsNamesForMember

public Collection<String> getAllGroupsNamesForMember(String member)
                                              throws XWikiException
Get all groups containing provided user.

Parameters:
member - the name of the member (user or group).
Returns:
the Collection of String containing group name.
Throws:
XWikiException - error when browsing groups.

getAllMembersNamesForGroup

public Collection<String> getAllMembersNamesForGroup(String group)
                                              throws XWikiException
Get all members (users or groups) provided group contains.

Parameters:
group - the name of the group.
Returns:
the Collection of String containing member (user or group) name.
Throws:
XWikiException - error when browsing groups.

getAllMembersNamesForGroup

public Collection<String> getAllMembersNamesForGroup(String group,
                                                     int nb,
                                                     int start)
                                              throws XWikiException
Get all members (users or groups) provided group contains.

Parameters:
group - the name of the group.
nb - the maximum number of result to return.
start - the index of the first found user to return.
Returns:
the Collection of String containing member (user or group) name.
Throws:
XWikiException - error when browsing groups.

getAllMatchedMembersNamesForGroup

public Collection<String> getAllMatchedMembersNamesForGroup(String group,
                                                            String matchField,
                                                            int nb,
                                                            int start,
                                                            Boolean orderAsc)
                                                     throws XWikiException
Get members of provided group.

Parameters:
group - the group.
matchField - a string to search in result to filter.
nb - the maximum number of result to return.
start - the index of the first found user to return.
orderAsc - if true, the result is ordered ascendent, if false it descendant. If null no order is applied.
Returns:
the Collection of String containing member name.
Throws:
XWikiException - error when browsing groups.
Since:
1.6M1

countAllGroupsNamesForMember

public int countAllGroupsNamesForMember(String member)
                                 throws XWikiException
Return the number of groups containing provided member.

Parameters:
member - the name of the member (user or group).
Returns:
the number of groups.
Throws:
XWikiException - error when getting number of users.

countAllMembersNamesForGroup

public int countAllMembersNamesForGroup(String group)
                                 throws XWikiException
Return the number of members provided group contains.

Parameters:
group - the name of the group.
Returns:
the number of members.
Throws:
XWikiException - error when getting number of groups.


Copyright © 2004-2013 XWiki. All Rights Reserved.