org.chorem.pollen.ui.pages.poll
Class VoteForPoll

java.lang.Object
  extended by org.chorem.pollen.ui.pages.poll.VoteForPoll

@IncludeStylesheet(value={"context:css/vote.css","context:css/lightbox.css"})
@IncludeJavaScriptLibrary(value={"${tapestry.scriptaculous}/builder.js","context:js/lightbox.js"})
public class VoteForPoll
extends Object

Classe de la page de vote.

Version:
$Id: VoteForPoll.java 2923 2010-03-10 09:39:32Z fdesbois $
Author:
kmorin, rannou

Constructor Summary
VoteForPoll()
           
 
Method Summary
 Integer getAddNumberVote()
           
 Date getChoiceNameAsDate()
          Retourne la date correspondant au choix courant
 String getCreatorName()
          Récupération du créateur du sondage.
 String getCurrentChoiceResult()
          Retourne le résultat correspondant au choix de sondage courant.
 String getCurrentVotingId()
          Retourne l'identifiant du votant du vote courant
 ContextLink getFeedContext()
          Context to get feed of the current poll
 String getHelpMessage()
          Retourne le message d'aide correspondant au type de sondage.
 ImageContextLink getImgContext()
          Context to get images for choices.
 int getNbVotesPerPage()
          Get the number of votes to display per page from configuration.
 String getNoPagerText()
           
 int getPage()
           
 String getResultsAsString()
          Retourne une chaîne contenant les résultats du sondage.
 List<VoteDTO> getVotes()
          Retrieve votes of the current poll from business module.
 String getVoteSizeMessage()
           
 boolean isAccountFieldDisplayed()
          Retourne vrai si le champs pollAccount doit apparaître.
 boolean isAddChoice()
           
 boolean isAnonymousVoteDisplayed()
          Retourne vrai si la checkbox anonymousVote doit être affichée.
 boolean isChoiceHidden()
           
 Boolean isChoiceInVote(ChoiceDTO choice)
          Retourne si le choix fait partie du vote (s'il a été renseigné par le votant).
 boolean isCondorcetVoteCounting()
           
 boolean isCreatorUser()
          retourne vrai si l'utilisateur est le créateur du sondage
 boolean isCurrentVoteAnonymous()
          Retourne true si le sondage est anonyme ou si le vote courant est anonyme.
 boolean isDateType()
           
 boolean isDescNull()
           
 boolean isFeedFileExisting()
          Vérifie que le fichier de flux de syndication existe.
 boolean isFreePoll()
           
 boolean isGroupPoll()
           
 boolean isImageType()
           
 boolean isModifAllowed(String votingId)
          Retourne vrai si la modification du vote est autorisée.
 boolean isNormalVoteCounting()
           
 boolean isNumberVoteCounting()
           
 boolean isPercentageVoteCounting()
           
 boolean isPollChoiceOrVoteStarted()
           
 boolean isPollChoiceRunning()
           
 boolean isPollChoiceStarted()
           
 boolean isPollFinished()
           
 boolean isPollNull()
           
 boolean isPollRunning()
           
 boolean isPollStarted()
           
 boolean isRestrictedPoll()
           
 boolean isTextType()
           
 boolean isVoteAnonymous()
          Retourne true si le sondage est anonyme ou si le vote soumis est anonyme.
 void setAddChoice(boolean addChoice)
           
 void setAddNumberVote(Integer value)
           
 char setCurrentVoteChoice()
           
 void setPage(int page)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoteForPoll

public VoteForPoll()
Method Detail

getFeedContext

public ContextLink getFeedContext()
Context to get feed of the current poll

Returns:
a FeedContext defined in .tml file

getImgContext

public ImageContextLink getImgContext()
Context to get images for choices.

Returns:
an ImageContextLink defined in .tml file

getVoteSizeMessage

public String getVoteSizeMessage()

isModifAllowed

public boolean isModifAllowed(String votingId)
Retourne vrai si la modification du vote est autorisée. C'est à dire si l'utilisateur connecté est l'auteur du vote ou si le votant défini par l'url est l'auteur du vote.

Parameters:
votingId - le votant a rechercher
Returns:
vrai si la modification du vote est autorisée

isAddChoice

public boolean isAddChoice()

setAddChoice

public void setAddChoice(boolean addChoice)

setAddNumberVote

public void setAddNumberVote(Integer value)

getAddNumberVote

public Integer getAddNumberVote()

isChoiceInVote

public Boolean isChoiceInVote(ChoiceDTO choice)
Retourne si le choix fait partie du vote (s'il a été renseigné par le votant).

Parameters:
choice - le choix concerné
Returns:
true si le choix est dans le vote

isChoiceHidden

public boolean isChoiceHidden()

setCurrentVoteChoice

public char setCurrentVoteChoice()

getCurrentChoiceResult

public String getCurrentChoiceResult()
Retourne le résultat correspondant au choix de sondage courant.

Returns:
le résultat du choix

isFeedFileExisting

@Log
public boolean isFeedFileExisting()
Vérifie que le fichier de flux de syndication existe.

Returns:
vrai si le fichier existe

getResultsAsString

public String getResultsAsString()
Retourne une chaîne contenant les résultats du sondage.

Returns:
les résultats

isVoteAnonymous

public boolean isVoteAnonymous()
Retourne true si le sondage est anonyme ou si le vote soumis est anonyme. Utilisé lors de la soumission d'un vote.

Returns:
true si le vote est anonyme

isCurrentVoteAnonymous

public boolean isCurrentVoteAnonymous()
Retourne true si le sondage est anonyme ou si le vote courant est anonyme. Utilisé dans la boucle de parcours des votes.

Returns:
true si le vote est anonyme

isAnonymousVoteDisplayed

public boolean isAnonymousVoteDisplayed()
Retourne vrai si la checkbox anonymousVote doit être affichée.


getCurrentVotingId

public String getCurrentVotingId()
Retourne l'identifiant du votant du vote courant


isPollNull

public boolean isPollNull()

isPollChoiceStarted

public boolean isPollChoiceStarted()

isPollStarted

public boolean isPollStarted()

isPollFinished

public boolean isPollFinished()

isPollChoiceOrVoteStarted

public boolean isPollChoiceOrVoteStarted()

isPollChoiceRunning

public boolean isPollChoiceRunning()

isPollRunning

public boolean isPollRunning()

isDescNull

public boolean isDescNull()

isAccountFieldDisplayed

public boolean isAccountFieldDisplayed()
Retourne vrai si le champs pollAccount doit apparaître.


isFreePoll

public boolean isFreePoll()

isRestrictedPoll

public boolean isRestrictedPoll()

isGroupPoll

public boolean isGroupPoll()

isTextType

public boolean isTextType()

isDateType

public boolean isDateType()

isImageType

public boolean isImageType()

isNormalVoteCounting

public boolean isNormalVoteCounting()

isPercentageVoteCounting

public boolean isPercentageVoteCounting()

isCondorcetVoteCounting

public boolean isCondorcetVoteCounting()

isNumberVoteCounting

public boolean isNumberVoteCounting()

isCreatorUser

public boolean isCreatorUser()
retourne vrai si l'utilisateur est le créateur du sondage


getCreatorName

public String getCreatorName()
Récupération du créateur du sondage.

Returns:
le nom du créateur du sondage.

getHelpMessage

public String getHelpMessage()
Retourne le message d'aide correspondant au type de sondage.


getChoiceNameAsDate

public Date getChoiceNameAsDate()
Retourne la date correspondant au choix courant


getPage

public int getPage()

setPage

@Log
public void setPage(int page)

getNbVotesPerPage

public int getNbVotesPerPage()
Get the number of votes to display per page from configuration.

Returns:
the number of votes to display per page

getNoPagerText

public String getNoPagerText()

getVotes

public List<VoteDTO> getVotes()
Retrieve votes of the current poll from business module. The votes are ordered by creation date, only the ones to display are loaded depends on current page using pager component.

Returns:
the list of votes to display


Copyright © 2009-2010 CodeLutin. All Rights Reserved.