@Component @Named(value="wiki.user") @Singleton @Unstable public class WikiUserManagerScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
WikiUserManagerScriptService() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptInvitation(MemberCandidacy invitation,
String message)
Accept the invitation to join a wiki.
|
boolean |
acceptRequest(MemberCandidacy request,
String message,
String privateComment)
Accept the request to join the wiki.
|
boolean |
addMember(String userId,
String wikiId)
Add a user as a member.
|
boolean |
addMembers(Collection<String> userIds,
String wikiId)
Add a list of users as a members.
|
MemberCandidacy |
askToJoin(String userId,
String wikiId,
String message)
Perform a request to join a wiki.
|
boolean |
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 that the current user has the right to see.
|
MemberCandidacy |
getCandidacy(String wikiId,
int candidacyId)
Get the specified candidacy.
|
Exception |
getLastError()
Get the error generated while performing the previously called action.
|
Collection<String> |
getMembers(String wikiId) |
MembershipType |
getMembershipType() |
MembershipType |
getMembershipType(String wikiId) |
UserScope |
getUserScope() |
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.
|
boolean |
join(String userId,
String wikiId)
Join a wiki.
|
boolean |
leave(String userId,
String wikiId)
Leave a wiki.
|
boolean |
refuseInvitation(MemberCandidacy invitation,
String message)
Refuse the invitation to join a wiki.
|
boolean |
refuseRequest(MemberCandidacy request,
String message,
String privateComment)
Refuse the request to join the wiki.
|
boolean |
removeMember(String userId,
String wikiId)
Remove a member.
|
boolean |
setMembershipType(String wikiId,
String type) |
boolean |
setUserScope(String wikiId,
String scope) |
public Exception getLastError()
null
if no exception was thrownpublic UserScope getUserScope()
public UserScope getUserScope(String wikiId)
wikiId
- Id of the wiki to testpublic boolean setUserScope(String wikiId, String scope)
wikiId
- Id of the wiki to changescope
- scope to setpublic MembershipType getMembershipType()
public MembershipType getMembershipType(String wikiId)
wikiId
- Id of the wiki to testpublic boolean setMembershipType(String wikiId, String type)
wikiId
- Id of the wiki to changetype
- the membership type to setpublic Collection<String> getMembers(String wikiId)
wikiId
- if the the wikipublic Boolean isMember(String userId, String wikiId)
userId
- Id of the userwikiId
- Id of the wikipublic boolean addMember(String userId, String wikiId)
userId
- UserID to addwikiId
- Id of the wikipublic boolean addMembers(Collection<String> userIds, String wikiId)
userIds
- List of userID to addwikiId
- Id of the wikipublic boolean removeMember(String userId, String wikiId)
userId
- UserID to removewikiId
- Id the the wikipublic MemberCandidacy getCandidacy(String wikiId, int candidacyId)
wikiId
- Id of the wiki concerned by the candidacycandidacyId
- id of the candidacypublic Collection<MemberCandidacy> getAllInvitations(String wikiId)
wikiId
- id of the wiki to joinpublic Boolean hasPendingInvitation(org.xwiki.model.reference.DocumentReference user, String wikiId)
user
- DocumentReference to the user to testwikiId
- id of the wiki to testpublic Boolean hasPendingRequest(org.xwiki.model.reference.DocumentReference user, String wikiId)
user
- DocumentReference to the user to testwikiId
- id of the wiki to testpublic Collection<MemberCandidacy> getAllRequests(String wikiId)
wikiId
- id of the wiki to joinpublic boolean join(String userId, String wikiId)
userId
- userId to add to the wikiwikiId
- id of the wikipublic boolean leave(String userId, String wikiId)
userId
- userId to remove from the wikiwikiId
- id of the wikipublic MemberCandidacy askToJoin(String userId, String wikiId, String message)
userId
- UserID of the requesterwikiId
- Id of the wiki to joinmessage
- Message that motivates the requestpublic boolean acceptRequest(MemberCandidacy request, String message, String privateComment)
request
- request to acceptmessage
- message about the acceptanceprivateComment
- private comment that only the administrator can seepublic boolean refuseRequest(MemberCandidacy request, String message, String privateComment)
request
- request to refusemessage
- message about the refusalprivateComment
- private comment that only the administrator can seepublic boolean cancelCandidacy(MemberCandidacy candidacy)
candidacy
- Candidacy to cancelpublic MemberCandidacy invite(String userId, String wikiId, String message)
userId
- Id of the user to addwikiId
- Id of the wiki to joinmessage
- MemberCandidacy messagepublic boolean acceptInvitation(MemberCandidacy invitation, String message)
invitation
- invitation to acceptmessage
- message that goes along the acceptancepublic boolean refuseInvitation(MemberCandidacy invitation, String message)
invitation
- invitation to refusemessage
- message that goes along the refusalCopyright © 2004–2014 XWiki. All rights reserved.