nl.gx.webmanager.cms.element
Interface PollElement

All Superinterfaces:
DelegatedControllerAware, Element, Presentable, Wrapper

public interface PollElement
extends Element

Representation of Poll element.


Nested Class Summary
static class PollElement.PollType
          Type defining what entry mode is allowed for voting on this poll.
static class PollElement.QuestionSelectionMode
          QuestionSelectionMode defining how the question and subsequent answers shown is to be determined.
 
Method Summary
 PollItem addAnswer(java.lang.String answer)
          Add an answer to this question.
 PollItem[] getItems()
          Returns available poll items, calculate percentage of votes for each poll item to display in results page.
 int getPollId()
          Returns identifier of the current poll question.
 PollElement.PollType getPollType()
          Returns the poll type.
 java.lang.String getQuestion()
          Returns poll question.
 PollElement.QuestionSelectionMode getQuestionSelectionMode()
          Returns the question selection mode.
 int getTotalVotes()
          Returns sum of all votes on all items.
 java.lang.String getType()
          Deprecated.  
 void removeItem(PollItem item)
          Remove the indicated item.
 void setPollType(PollElement.PollType pollType)
          Sets the type to use for this poll.
 void setQuestion(java.lang.String question)
          Sets the question for this poll.
 void setQuestionSelectionMode(PollElement.QuestionSelectionMode mode)
          Sets the question selection mode to use for this poll.
 
Methods inherited from interface nl.gx.webmanager.cms.element.Element
cleanup, copy, getEditElementHeader, getElementHolder, getHeader, getIcon, getMediaItemVersion, getPageModel, getPageModelElement, getPageVersion, getPersonalization, getWebsite, isAuthorized, setAuthorized, setDefaultPresentation, setEditElementHeader, setHeader, setIcon, setPersonalization
 
Methods inherited from interface nl.gx.webmanager.cms.core.Presentable
getPresentation, render, render, setPresentation
 
Methods inherited from interface nl.gx.webmanager.wrapper.Wrapper
getId, getUUID, setId, setUUID
 
Methods inherited from interface nl.gx.webmanager.springmvc.DelegatedControllerAware
getDelegatedController, setDelegatedController
 

Method Detail

getPollId

int getPollId()
Returns identifier of the current poll question.

Returns:
poll question identifier.

getQuestion

java.lang.String getQuestion()
Returns poll question.

Returns:
poll question.

setQuestion

void setQuestion(java.lang.String question)
Sets the question for this poll.

Parameters:
question - the question

addAnswer

PollItem addAnswer(java.lang.String answer)
Add an answer to this question. This answer will be added after existing answers.

Parameters:
answer - The answer to add

removeItem

void removeItem(PollItem item)
Remove the indicated item.

Parameters:
item - the item to be removed

getItems

PollItem[] getItems()
Returns available poll items, calculate percentage of votes for each poll item to display in results page.

Returns:
available poll items (including calculated percentages of votes)

getTotalVotes

int getTotalVotes()
Returns sum of all votes on all items.

Returns:
sum of all votes on all items.

getType

java.lang.String getType()
Deprecated. 

Returns the poll type. "radio" if multiple answers are allowed, "checkbox" if only one answer is allowed.

Returns:
type of poll (radio, checkbox).

getPollType

PollElement.PollType getPollType()
Returns the poll type. PollType.MULTIPLECHOICE if multiple answers are allowed, PollType.SINGLECHOICE if only one answer is allowed.

Returns:
type of poll (PollType)

setPollType

void setPollType(PollElement.PollType pollType)
Sets the type to use for this poll.

Parameters:
pollType - The type to set

getQuestionSelectionMode

PollElement.QuestionSelectionMode getQuestionSelectionMode()
Returns the question selection mode.

Returns:
The question selection mode for this poll

setQuestionSelectionMode

void setQuestionSelectionMode(PollElement.QuestionSelectionMode mode)
Sets the question selection mode to use for this poll.

Parameters:
mode - The question selection mode to set


Copyright © 2007-2011 GX Software BV. All Rights Reserved.