Package com.xwiki.xpoll
Interface XPollManager
-
@Role @Unstable public interface XPollManagerProvides methods to interact with the polls of a XWiki page.- Since:
- 2.1
- Version:
- $Id$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetRestURL(org.xwiki.model.reference.DocumentReference documentReference)Map<String,Integer>getVoteResults(org.xwiki.model.reference.DocumentReference documentReference)voidvote(org.xwiki.model.reference.DocumentReference page, org.xwiki.model.reference.DocumentReference user, Vote vote)Casts a vote of a user to an existing poll in a XWiki page.
-
-
-
Method Detail
-
vote
void vote(org.xwiki.model.reference.DocumentReference page, org.xwiki.model.reference.DocumentReference user, Vote vote) throws XPollExceptionCasts a vote of a user to an existing poll in a XWiki page.- Parameters:
page- the page that has a poll associated with itselfuser- a reference to the user that cast the votesvote- user voted options- Throws:
XPollException- thrown if the page is not found or if the function fails to create a new XPollVote or save the Document
-
getRestURL
String getRestURL(org.xwiki.model.reference.DocumentReference documentReference)
- Parameters:
documentReference- the document that we want to get the URL for- Returns:
- the REST URL of the XPoll associated with the specific document
-
getVoteResults
Map<String,Integer> getVoteResults(org.xwiki.model.reference.DocumentReference documentReference) throws XPollException
- Parameters:
documentReference- a document reference- Returns:
- a map that has the XPoll proposals as keys and the scores as values.
- Throws:
XPollException- thrown if the document is missing or if it lacks a poll.
-
-