com.xpn.xwiki.user.api
Interface XWikiGroupService

All Known Implementing Classes:
ExoGroupServiceImpl, XWikiGroupServiceImpl

public interface XWikiGroupService

Interface giving access to users and groups management.

Version:
$Id: XWikiGroupService.java 11673 2008-08-05 12:02:40Z tmortagne $

Method Summary
 void addUserToGroup(java.lang.String user, java.lang.String database, java.lang.String group, XWikiContext context)
           
 int countAllGroupsNamesForMember(java.lang.String member, XWikiContext context)
          Return the number of groups containing provided member.
 int countAllMatchedGroups(java.lang.Object[][] matchFields, XWikiContext context)
          Return number of groups with provided constraints.
 int countAllMatchedUsers(java.lang.Object[][] matchFields, XWikiContext context)
          Return number of users with provided constraints.
 int countAllMembersNamesForGroup(java.lang.String group, XWikiContext context)
          Return the number of members provided group contains.
 void flushCache()
           
 java.util.Collection<java.lang.String> getAllGroupsNamesForMember(java.lang.String member, int nb, int start, XWikiContext context)
          Get all groups containing provided member.
 java.util.List<?> getAllMatchedGroups(java.lang.Object[][] matchFields, boolean withdetails, int nb, int start, java.lang.Object[][] order, XWikiContext context)
          Search for all groups with provided constraints and in a provided order.
 java.util.Collection<java.lang.String> getAllMatchedMembersNamesForGroup(java.lang.String group, java.lang.String matchField, int nb, int start, java.lang.Boolean orderAsc, XWikiContext context)
          Get members of provided group.
 java.util.List<?> getAllMatchedUsers(java.lang.Object[][] matchFields, boolean withdetails, int nb, int start, java.lang.Object[][] order, XWikiContext context)
          Search for all users with provided constraints and in a provided order.
 java.util.Collection<java.lang.String> getAllMembersNamesForGroup(java.lang.String group, int nb, int start, XWikiContext context)
          Get all members provided group contains.
 void init(XWiki xwiki, XWikiContext context)
           
 void initCache(int iCapacity, XWikiContext context)
           
 void initCache(XWikiContext context)
           
 java.util.List<java.lang.String> listAllGroups(XWikiContext context)
          Deprecated. Use getAllMatchedGroups(Object[][], boolean, int, int, Object[][], XWikiContext).
 java.util.Collection<java.lang.String> listGroupsForUser(java.lang.String username, XWikiContext context)
          Deprecated. Use getAllGroupsNamesForMember(String, int, int, XWikiContext).
 java.util.List<java.lang.String> listMemberForGroup(java.lang.String s, XWikiContext context)
          Deprecated. Use getAllMembersNamesForGroup(String, int, int, XWikiContext).
 void removeUserOrGroupFromAllGroups(java.lang.String userOrGroupWiki, java.lang.String userOrGroupSpace, java.lang.String userOrGroupName, XWikiContext context)
          Remove user or group name from all groups.
 

Method Detail

init

void init(XWiki xwiki,
          XWikiContext context)
          throws XWikiException
Throws:
XWikiException

initCache

void initCache(XWikiContext context)
               throws XWikiException
Throws:
XWikiException

initCache

void initCache(int iCapacity,
               XWikiContext context)
               throws XWikiException
Throws:
XWikiException

flushCache

void flushCache()

listGroupsForUser

java.util.Collection<java.lang.String> listGroupsForUser(java.lang.String username,
                                                         XWikiContext context)
                                                         throws XWikiException
Deprecated. Use getAllGroupsNamesForMember(String, int, int, XWikiContext).

Throws:
XWikiException

addUserToGroup

void addUserToGroup(java.lang.String user,
                    java.lang.String database,
                    java.lang.String group,
                    XWikiContext context)
                    throws XWikiException
Throws:
XWikiException

removeUserOrGroupFromAllGroups

void removeUserOrGroupFromAllGroups(java.lang.String userOrGroupWiki,
                                    java.lang.String userOrGroupSpace,
                                    java.lang.String userOrGroupName,
                                    XWikiContext context)
                                    throws XWikiException
Remove user or group name from all groups.

Parameters:
userOrGroupWiki - the name of the wiki of the member.
userOrGroupSpace - the name of the space of the member.
userOrGroupName - the name of the member.
context - the XWiki context.
Throws:
XWikiException - error when browsing groups.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

listMemberForGroup

java.util.List<java.lang.String> listMemberForGroup(java.lang.String s,
                                                    XWikiContext context)
                                                    throws XWikiException
Deprecated. Use getAllMembersNamesForGroup(String, int, int, XWikiContext).

Throws:
XWikiException

listAllGroups

java.util.List<java.lang.String> listAllGroups(XWikiContext context)
                                               throws XWikiException
Deprecated. Use getAllMatchedGroups(Object[][], boolean, int, int, Object[][], XWikiContext).

Throws:
XWikiException

getAllMatchedUsers

java.util.List<?> getAllMatchedUsers(java.lang.Object[][] matchFields,
                                     boolean withdetails,
                                     int nb,
                                     int start,
                                     java.lang.Object[][] order,
                                     XWikiContext context)
                                     throws XWikiException
Search for all users with provided constraints and in a provided order.

Parameters:
matchFields - the field to math with values. It is a table of table with :
  • fiedname : the name of the field
  • fieldtype : for example StringProperty. If null the field is considered as document field
  • pattern matching : based on HQL "like" command
withdetails - indicate if a List containing String names is returned or List containing XWikiDocument.
nb - the maximum number od result to return.
start - the index of the first found user to return.
order - the fields to order from. It is a table of table with :
  • fieldname : the name of the field
  • fieldtype : for example StringProperty. If null the field is considered as document field
context - the XWikiContext.
Returns:
the list of users.
Throws:
XWikiException - error when getting users.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

getAllMatchedGroups

java.util.List<?> getAllMatchedGroups(java.lang.Object[][] matchFields,
                                      boolean withdetails,
                                      int nb,
                                      int start,
                                      java.lang.Object[][] order,
                                      XWikiContext context)
                                      throws XWikiException
Search for all groups with provided constraints and in a provided order.

Parameters:
matchFields - the field to math with values. It is a table of table with :
  • fiedname : the name of the field
  • fieldtype : for example StringProperty. If null the field is considered as document field
  • pattern matching : based on HQL "like" command
.
withdetails - indicate if a List containing String names is returned or List containing XWikiDocument.
nb - the maximum number od result to return.
start - the index of the first found group to return.
order - the field to order from. It is a table of table with :
  • fieldname : the name of the field
  • fieldtype : for example StringProperty. If null the field is considered as document field
context - the XWikiContext.
Returns:
the list of groups.
Throws:
XWikiException - error when getting groups.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

countAllMatchedUsers

int countAllMatchedUsers(java.lang.Object[][] matchFields,
                         XWikiContext context)
                         throws XWikiException
Return number of users with provided constraints.

Parameters:
matchFields - the field to math with values. It is a table of table with :
  • fiedname : the name of the field
  • fieldtype : for example StringProperty. If null the field is considered as document field
  • pattern matching : based on HQL "like" command
.
context - the XWikiContext.
Returns:
the of found users.
Throws:
XWikiException - error when getting number of users.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

countAllMatchedGroups

int countAllMatchedGroups(java.lang.Object[][] matchFields,
                          XWikiContext context)
                          throws XWikiException
Return number of groups with provided constraints.

Parameters:
matchFields - the field to math with values. It is a table of table with :
  • fiedname : the name of the field
  • fieldtype : for example StringProperty. If null the field is considered as document field
  • pattern matching : based on HQL "like" command
.
context - the XWikiContext.
Returns:
the of found groups.
Throws:
XWikiException - error when getting number of groups.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

getAllGroupsNamesForMember

java.util.Collection<java.lang.String> getAllGroupsNamesForMember(java.lang.String member,
                                                                  int nb,
                                                                  int start,
                                                                  XWikiContext context)
                                                                  throws XWikiException
Get all groups containing provided member.

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

getAllMembersNamesForGroup

java.util.Collection<java.lang.String> getAllMembersNamesForGroup(java.lang.String group,
                                                                  int nb,
                                                                  int start,
                                                                  XWikiContext context)
                                                                  throws XWikiException
Get all members 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.
context - the XWiki context.
Returns:
the Collection of String containing member name.
Throws:
XWikiException - error when browsing groups.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

getAllMatchedMembersNamesForGroup

java.util.Collection<java.lang.String> getAllMatchedMembersNamesForGroup(java.lang.String group,
                                                                         java.lang.String matchField,
                                                                         int nb,
                                                                         int start,
                                                                         java.lang.Boolean orderAsc,
                                                                         XWikiContext context)
                                                                         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.
context - the XWiki context.
Returns:
the Collection of String containing member name.
Throws:
XWikiException - error when browsing groups.
Since:
1.6M1

countAllGroupsNamesForMember

int countAllGroupsNamesForMember(java.lang.String member,
                                 XWikiContext context)
                                 throws XWikiException
Return the number of groups containing provided member.

Parameters:
member - the name of the member (user or group).
context - the XWiki context.
Returns:
the number of groups.
Throws:
XWikiException - error when getting number of users.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

countAllMembersNamesForGroup

int countAllMembersNamesForGroup(java.lang.String group,
                                 XWikiContext context)
                                 throws XWikiException
Return the number of members provided group contains.

Parameters:
group - the name of the group.
context - the XWiki context.
Returns:
the number of members.
Throws:
XWikiException - error when getting number of groups.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2


Copyright © 2004-2008 XWiki. All Rights Reserved.