public interface PollService
| Modifier and Type | Method and Description |
|---|---|
void |
answer(String username,
Poll poll,
int answerIndex)
Store that the user with the given @{code username} has answered the
poll with the answer number answerIndex. |
Poll |
closePoll(Poll poll)
Close the
poll. |
List<Poll> |
getOpenPolls(CoreSession session)
Returns all open polls available with the given
session. |
DocumentModel |
getPollsContainer(DocumentModel doc)
Returns the polls container located inside the given
doc. |
PollResult |
getResultFor(Poll poll)
Returns the current
PollResult for the given poll. |
List<Poll> |
getUnansweredOpenPolls(CoreSession session)
Returns all unanswered open polls available with the given
session. |
boolean |
hasUserAnswered(String username,
Poll poll)
Returns
true if the user with the given username has
already answer the poll, false otherwise. |
Poll |
openPoll(Poll poll)
Open the
poll. |
Poll |
updatePollStatus(Poll poll,
Date date)
Update the status of the
poll according to the given
date. |
DocumentModel getPollsContainer(DocumentModel doc)
doc.
The container is created if it does not exist.
doc - the document where to create the containerList<Poll> getOpenPolls(CoreSession session)
session.List<Poll> getUnansweredOpenPolls(CoreSession session)
session.boolean hasUserAnswered(String username, Poll poll)
true if the user with the given username has
already answer the poll, false otherwise.void answer(String username, Poll poll, int answerIndex)
poll with the answer number answerIndex.PollResult getResultFor(Poll poll)
PollResult for the given poll.Poll openPoll(Poll poll)
poll. The poll will be available through the
getOpenPolls(org.nuxeo.ecm.core.api.CoreSession) method.
The start date of the poll is set to now.
Poll closePoll(Poll poll)
poll.
The end date of the poll is set to now.
Copyright © 2013 Nuxeo SA. All Rights Reserved.