Package com.xpn.xwiki.user.api
Interface XWikiGroupService
-
- All Known Implementing Classes:
XWikiGroupServiceImpl
public interface XWikiGroupService
Interface giving access to users and groups management.- Version:
- $Id: 44f4b4c8c50a7215aaf7c52cc68695bc1b7307d5 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addUserToGroup(String user, String database, String group, XWikiContext context)
Deprecated.should never be used ! There is a listener taking care of that automatically.int
countAllGroupsNamesForMember(String member, XWikiContext context)
Return the number of groups containing provided member.int
countAllMatchedGroups(Object[][] matchFields, XWikiContext context)
Return number of groups with provided constraints.default int
countAllMatchedMembersNamesForGroup(String group, String filter, XWikiContext xcontext)
Filters the members of the specified group using the given text and counts the results.int
countAllMatchedUsers(Object[][] matchFields, XWikiContext context)
Return number of users with provided constraints.int
countAllMembersNamesForGroup(String group, XWikiContext context)
Return the number of members provided group contains.void
flushCache()
Deprecated.since 10.8RC1, use GroupManager component insteadCollection<String>
getAllGroupsNamesForMember(String member, int nb, int start, XWikiContext context)
Get all groups containing provided member in the provided member wiki.Collection<DocumentReference>
getAllGroupsReferencesForMember(DocumentReference memberReference, int limit, int offset, XWikiContext context)
Get all groups containing provided member in the current wiki.List<?>
getAllMatchedGroups(Object[][] matchFields, boolean withdetails, int nb, int start, Object[][] order, XWikiContext context)
Search for all groups with provided constraints and in a provided order.Collection<String>
getAllMatchedMembersNamesForGroup(String group, String matchField, int nb, int start, Boolean orderAsc, XWikiContext context)
Get members of provided group.List<?>
getAllMatchedUsers(Object[][] matchFields, boolean withdetails, int nb, int start, Object[][] order, XWikiContext context)
Search for all users with provided constraints and in a provided order.Collection<String>
getAllMembersNamesForGroup(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)
Deprecated.since 10.8RC1, use GroupManager component insteadvoid
initCache(XWikiContext context)
Deprecated.since 10.8RC1, use GroupManager component insteadList<String>
listAllGroups(XWikiContext context)
Collection<String>
listGroupsForUser(String username, XWikiContext context)
Deprecated.List<String>
listMemberForGroup(String s, XWikiContext context)
Deprecated.void
removeUserOrGroupFromAllGroups(String userOrGroupWiki, String userOrGroupSpace, String userOrGroupName, XWikiContext context)
Remove user or group name from all groups.default void
replaceMemberInAllGroups(DocumentReference memberSource, DocumentReference memberTarget, XWikiContext context)
Replace a given member reference by another one in all groups of the wiki.
-
-
-
Method Detail
-
init
void init(XWiki xwiki, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
initCache
@Deprecated void initCache(XWikiContext context) throws XWikiException
Deprecated.since 10.8RC1, use GroupManager component instead- Throws:
XWikiException
-
initCache
@Deprecated void initCache(int iCapacity, XWikiContext context) throws XWikiException
Deprecated.since 10.8RC1, use GroupManager component instead- Throws:
XWikiException
-
flushCache
@Deprecated void flushCache()
Deprecated.since 10.8RC1, use GroupManager component instead
-
listGroupsForUser
@Deprecated Collection<String> listGroupsForUser(String username, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
addUserToGroup
@Deprecated void addUserToGroup(String user, String database, String group, XWikiContext context) throws XWikiException
Deprecated.should never be used ! There is a listener taking care of that automatically.- Throws:
XWikiException
-
removeUserOrGroupFromAllGroups
void removeUserOrGroupFromAllGroups(String userOrGroupWiki, String userOrGroupSpace, 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:
- 1.1.2, 1.2M2
-
replaceMemberInAllGroups
default void replaceMemberInAllGroups(DocumentReference memberSource, DocumentReference memberTarget, XWikiContext context) throws XWikiException
Replace a given member reference by another one in all groups of the wiki.- Parameters:
memberSource
- the reference of the member that should be replacedmemberTarget
- the reference of the member that is used as replacementcontext
- the current context- Throws:
XWikiException
- in case of problem when doing the replacement- Since:
- 11.9RC1
-
listMemberForGroup
@Deprecated List<String> listMemberForGroup(String s, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
listAllGroups
@Deprecated List<String> listAllGroups(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
getAllMatchedUsers
List<?> getAllMatchedUsers(Object[][] matchFields, boolean withdetails, int nb, int start, 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 aList
containingString
names is returned orList
containingXWikiDocument
.nb
- the maximum number of results to return. Infinite if 0.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
- asc : a Boolean, if true the order is ascendent
context
- theXWikiContext
.- Returns:
- the list of users.
- Throws:
XWikiException
- error when getting users.- Since:
- 1.1.2, 1.2M2
-
getAllMatchedGroups
List<?> getAllMatchedGroups(Object[][] matchFields, boolean withdetails, int nb, int start, 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 aList
containingString
names is returned orList
containingXWikiDocument
.nb
- the maximum number of result to return. Infinite if 0.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
- asc : a Boolean, if true the order is ascendent
context
- theXWikiContext
.- Returns:
- the list of groups.
- Throws:
XWikiException
- error when getting groups.- Since:
- 1.1.2, 1.2M2
-
countAllMatchedUsers
int countAllMatchedUsers(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
- theXWikiContext
.- Returns:
- the of found users.
- Throws:
XWikiException
- error when getting number of users.- Since:
- 1.1.2, 1.2M2
-
countAllMatchedGroups
int countAllMatchedGroups(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
- theXWikiContext
.- Returns:
- the of found groups.
- Throws:
XWikiException
- error when getting number of groups.- Since:
- 1.1.2, 1.2M2
-
getAllGroupsNamesForMember
Collection<String> getAllGroupsNamesForMember(String member, int nb, int start, XWikiContext context) throws XWikiException
Get all groups containing provided member in the provided member wiki.Since 10.8RC1 it's recommended to use org.xwiki.user.group.GroupManager unless you want to bypass the cache.
- 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
ofString
containing group name. - Throws:
XWikiException
- error when browsing groups.- Since:
- 1.1.2, 1.2M2
-
getAllGroupsReferencesForMember
Collection<DocumentReference> getAllGroupsReferencesForMember(DocumentReference memberReference, int limit, int offset, XWikiContext context) throws XWikiException
Get all groups containing provided member in the current wiki.Since 10.8RC1 it's recommended to use org.xwiki.user.group.GroupManager unless you want to bypass the cache.
- Parameters:
memberReference
- the member. Can be either user or group.limit
- the maximum number of result to return.offset
- the index of the first found member to return.context
- the XWiki context.- Returns:
- the
Collection
ofDocumentReference
containing representing groups. - Throws:
XWikiException
- error when browsing groups.- Since:
- 2.4M2
-
getAllMembersNamesForGroup
Collection<String> getAllMembersNamesForGroup(String group, int nb, int start, XWikiContext context) throws XWikiException
Get all members provided group contains.Since 10.8RC1 it's recommended to use org.xwiki.user.group.GroupManager unless you want to bypass the cache.
- 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
ofString
containing member name. - Throws:
XWikiException
- error when browsing groups.- Since:
- 1.1.2, 1.2M2
-
getAllMatchedMembersNamesForGroup
Collection<String> getAllMatchedMembersNamesForGroup(String group, String matchField, int nb, int start, 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
ofString
containing member name. - Throws:
XWikiException
- error when browsing groups.- Since:
- 1.6M1
-
countAllMatchedMembersNamesForGroup
default int countAllMatchedMembersNamesForGroup(String group, String filter, XWikiContext xcontext) throws XWikiException
Filters the members of the specified group using the given text and counts the results.- Parameters:
group
- the group whose members are going to be countedfilter
- the text used to filter the group membersxcontext
- the XWiki context- Returns:
- the number of group members that match the given text filter
- Throws:
XWikiException
- if counting the group members fails- Since:
- 10.8RC1
- See Also:
getAllMatchedMembersNamesForGroup(String, String, int, int, Boolean, XWikiContext)
-
countAllGroupsNamesForMember
int countAllGroupsNamesForMember(String member, XWikiContext context) throws XWikiException
Return the number of groups containing provided member.Since 10.8RC1 it's recommended to use org.xwiki.user.group.GroupManager unless you want to bypass the cache.
- 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:
- 1.1.2, 1.2M2
-
countAllMembersNamesForGroup
int countAllMembersNamesForGroup(String group, XWikiContext context) throws XWikiException
Return the number of members provided group contains.Since 10.8RC1 it's recommended to use org.xwiki.user.group.GroupManager unless you want to bypass the cache.
- 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:
- 1.1.2, 1.2M2
-
-