Package org.xwiki.wiki.user
Interface WikiUserManager
-
@Role public interface WikiUserManager
Component that manage how users can participate on a wiki (local users, members, invitation, etc...).- Since:
- 5.3M2
- Version:
- $Id: 69dd1333be8341397f4cbde65833722f1c338de2 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
acceptInvitation(MemberCandidacy invitation, String message)
Accept the invitation to join a wiki.void
acceptRequest(MemberCandidacy request, String message, String privateComment)
Accept the request to join the wiki.void
addMember(String userId, String wikiId)
Add a user as a member.void
addMembers(Collection<String> userIds, String wikiId)
Add a list of users as a member.MemberCandidacy
askToJoin(String userId, String wikiId, String message)
Perform a request to join a wiki.void
cancelCandidacy(MemberCandidacy candidacy)
Cancel a candidacy.Collection<MemberCandidacy>
getAllInvitations(String wikiId)
Get all the invitations to join a wiki.Collection<MemberCandidacy>
getAllRequests(String wikiId)
Get all the join requests for a wiki.MemberCandidacy
getCandidacy(String wikiId, int candidacyId)
Get the specified member candidacy.Collection<String>
getLocalUsers(String wikiId)
Collection<String>
getMembers(String wikiId)
MembershipType
getMembershipType(String wikiId)
UserScope
getUserScope(String wikiId)
boolean
hasPendingInvitation(org.xwiki.model.reference.DocumentReference user, String wikiId)
boolean
hasPendingRequest(org.xwiki.model.reference.DocumentReference user, String wikiId)
MemberCandidacy
invite(String userId, String wikiId, String message)
Invite a global user to a wiki.boolean
isMember(String userId, String wikiId)
To know if a user is a member of a wiki.void
join(String userId, String wikiId)
Join a wiki.void
leave(String userId, String wikiId)
Leave a wiki.void
refuseInvitation(MemberCandidacy invitation, String message)
Refuse the invitation to join a wiki.void
refuseRequest(MemberCandidacy request, String message, String privateComment)
Refuse the request to join the wiki.void
removeMember(String userId, String wikiId)
Remove a member.void
removeMembers(Collection<String> userIds, String wikiId)
Remove a list of members.void
setMembershipType(String wikiId, MembershipType type)
Set the membership type of the wiki and save the configuration.void
setUserScope(String wikiId, UserScope scope)
Set the user scope of the wiki.
-
-
-
Method Detail
-
getUserScope
UserScope getUserScope(String wikiId) throws WikiUserManagerException
- Parameters:
wikiId
- Id of the wiki to test- Returns:
- the user scope of the wiki
- Throws:
WikiUserManagerException
- if problems occur
-
setUserScope
void setUserScope(String wikiId, UserScope scope) throws WikiUserManagerException
Set the user scope of the wiki.- Parameters:
wikiId
- Id of the wiki to changescope
- the scope to set- Throws:
WikiUserManagerException
- if problems occur
-
getMembershipType
MembershipType getMembershipType(String wikiId) throws WikiUserManagerException
- Parameters:
wikiId
- if of the wiki to test- Returns:
- the membership type of the specified wiki
- Throws:
WikiUserManagerException
- if problems occur
-
setMembershipType
void setMembershipType(String wikiId, MembershipType type) throws WikiUserManagerException
Set the membership type of the wiki and save the configuration.- Parameters:
wikiId
- Id of the wiki to changetype
- the membershyp type to set- Throws:
WikiUserManagerException
- if problems occur
-
getLocalUsers
Collection<String> getLocalUsers(String wikiId) throws WikiUserManagerException
- Parameters:
wikiId
- id of the wiki- Returns:
- the list of all the local users
- Throws:
WikiUserManagerException
- if problems occur
-
getMembers
Collection<String> getMembers(String wikiId) throws WikiUserManagerException
- Parameters:
wikiId
- if the the wiki- Returns:
- the list of all the members (global users).
- Throws:
WikiUserManagerException
- if problems occur
-
isMember
boolean isMember(String userId, String wikiId) throws WikiUserManagerException
To know if a user is a member of a wiki.- Parameters:
userId
- Id of the userwikiId
- Id of the wiki- Returns:
- if the user is a member of the specified wiki
- Throws:
WikiUserManagerException
- if problems occur
-
addMember
void addMember(String userId, String wikiId) throws WikiUserManagerException
Add a user as a member.- Parameters:
userId
- UserID to addwikiId
- Id of the wiki- Throws:
WikiUserManagerException
- if problems occur
-
addMembers
void addMembers(Collection<String> userIds, String wikiId) throws WikiUserManagerException
Add a list of users as a member.- Parameters:
userIds
- List of userID to addwikiId
- Id of the wiki- Throws:
WikiUserManagerException
- if problems occur
-
removeMember
void removeMember(String userId, String wikiId) throws WikiUserManagerException
Remove a member.- Parameters:
userId
- UserID to removewikiId
- Id the the wiki- Throws:
WikiUserManagerException
- if problems occur
-
removeMembers
void removeMembers(Collection<String> userIds, String wikiId) throws WikiUserManagerException
Remove a list of members.- Parameters:
userIds
- List of UserID to removewikiId
- Id the the wiki- Throws:
WikiUserManagerException
- if problems occur
-
getAllInvitations
Collection<MemberCandidacy> getAllInvitations(String wikiId) throws WikiUserManagerException
Get all the invitations to join a wiki.- Parameters:
wikiId
- id of the wiki to join- Returns:
- a list of invitations to join this wiki
- Throws:
WikiUserManagerException
- if problems occur
-
getAllRequests
Collection<MemberCandidacy> getAllRequests(String wikiId) throws WikiUserManagerException
Get all the join requests for a wiki.- Parameters:
wikiId
- id of the wiki to join- Returns:
- a list of join request for this wiki
- Throws:
WikiUserManagerException
- if problems occur
-
hasPendingInvitation
boolean hasPendingInvitation(org.xwiki.model.reference.DocumentReference user, String wikiId) throws WikiUserManagerException
- Parameters:
user
- DocumentReference to the user to testwikiId
- id of the wiki to test- Returns:
- either or not the user has a pending invitation to join the wiki
- Throws:
WikiUserManagerException
- if problems occur
-
hasPendingRequest
boolean hasPendingRequest(org.xwiki.model.reference.DocumentReference user, String wikiId) throws WikiUserManagerException
- Parameters:
user
- DocumentReference to the user to testwikiId
- id of the wiki to test- Returns:
- either or not the user has a pending request to join the wiki
- Throws:
WikiUserManagerException
- if problems occur
-
getCandidacy
MemberCandidacy getCandidacy(String wikiId, int candidacyId) throws WikiUserManagerException
Get the specified member candidacy.- Parameters:
wikiId
- Od of the request concerned by the candidacycandidacyId
- Id of the candidacy to get- Returns:
- the candidacy
- Throws:
WikiUserManagerException
- if problems occur
-
askToJoin
MemberCandidacy askToJoin(String userId, String wikiId, String message) throws WikiUserManagerException
Perform a request to join a wiki.- Parameters:
userId
- UserID of the requesterwikiId
- Id of the wiki to joinmessage
- Message that motivates the request- Returns:
- the generated candidacy
- Throws:
WikiUserManagerException
- if problems occur
-
join
void join(String userId, String wikiId) throws WikiUserManagerException
Join a wiki.- Parameters:
userId
- userId to add to the wikiwikiId
- id of the wiki- Throws:
WikiUserManagerException
- if problems occur
-
leave
void leave(String userId, String wikiId) throws WikiUserManagerException
Leave a wiki.- Parameters:
userId
- userId to remove from the wikiwikiId
- id of the wiki- Throws:
WikiUserManagerException
- if problems occur
-
acceptRequest
void acceptRequest(MemberCandidacy request, String message, String privateComment) throws WikiUserManagerException
Accept the request to join the wiki.- Parameters:
request
- request to acceptmessage
- message about the acceptanceprivateComment
- private comment that only the administrator can see- Throws:
WikiUserManagerException
- if problems occur
-
refuseRequest
void refuseRequest(MemberCandidacy request, String message, String privateComment) throws WikiUserManagerException
Refuse the request to join the wiki.- Parameters:
request
- request to refusemessage
- message about the refusalprivateComment
- private comment that only the administrator can see- Throws:
WikiUserManagerException
- if problems occur
-
invite
MemberCandidacy invite(String userId, String wikiId, String message) throws WikiUserManagerException
Invite a global user to a wiki.- Parameters:
userId
- Id of the user to addwikiId
- Id of the wiki to joinmessage
- MemberCandidacy message- Returns:
- The generated invitation
- Throws:
WikiUserManagerException
- if problems occur
-
acceptInvitation
void acceptInvitation(MemberCandidacy invitation, String message) throws WikiUserManagerException
Accept the invitation to join a wiki.- Parameters:
invitation
- invitation to acceptmessage
- message that goes along the acceptance- Throws:
WikiUserManagerException
- if problems occur
-
refuseInvitation
void refuseInvitation(MemberCandidacy invitation, String message) throws WikiUserManagerException
Refuse the invitation to join a wiki.- Parameters:
invitation
- invitation to refusemessage
- message that goes along the refusal- Throws:
WikiUserManagerException
- if problems occur
-
cancelCandidacy
void cancelCandidacy(MemberCandidacy candidacy) throws WikiUserManagerException
Cancel a candidacy.- Parameters:
candidacy
- Candidacy to cancel- Throws:
WikiUserManagerException
- if problems occur
-
-