org.chorem.pollen.business.services
Class ServicePollImpl

java.lang.Object
  extended by org.chorem.pollen.business.services.ServicePollImpl
All Implemented Interfaces:
ServicePoll

public class ServicePollImpl
extends Object
implements ServicePoll

Implémentation du service de gestion des sondages.

Version:
$Id: ServicePollImpl.java 2933 2010-03-12 14:31:05Z fdesbois $
Author:
Erwan Nema, rannou

Constructor Summary
ServicePollImpl()
           
 
Method Summary
 boolean addVoteToPoll(String pollId, String voteId)
          Ajout d'un vote à un sondage
 String createPoll(PollDTO pollDTO)
          Création d'un sondage
 boolean deletePoll(String pollId)
          Suppression du sondage
 List<PollDTO> findInvitedPolls(String userId)
          Récupération des sondages auxquels un utilisateur est invité.
 List<PollDTO> findParticipatedPolls(String userId)
          Récupération des sondages auxquels un utilisateur a participé.
 PollDTO findPollById(String pollId)
          Récupération d'un sondage à partir de son identifiant ToPIA
 PollDTO findPollByPollId(String pollId)
          Récupération d'un sondage à partir de son identifiant.
 List<PollDTO> findPollsByName(String pollName)
          Récupération d'un sondage par son nom
 List<PollDTO> findPollsByUser(String userId)
          Récupération des sondages d'un utilisateur
 List<PollDTO> findRunningPolls(boolean withEndDate)
          Récupération des sondages en cours.
 PollAccountDTO getRestrictedAccount(String accountUId, PollDTO poll)
          Return the pollAccount corresponding to the accountUId for the restricted poll.
 List<PollDTO> selectPolls(Map<String,Object> properties)
          Récupération des sondages
 boolean updatePoll(PollDTO pollDTO)
          Mise à jour du sondage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServicePollImpl

public ServicePollImpl()
Method Detail

createPoll

public String createPoll(PollDTO pollDTO)
Description copied from interface: ServicePoll
Création d'un sondage

Specified by:
createPoll in interface ServicePoll
Parameters:
pollDTO - le sondage
Returns:
identifiant du sondage créé

updatePoll

public boolean updatePoll(PollDTO pollDTO)
Description copied from interface: ServicePoll
Mise à jour du sondage

Specified by:
updatePoll in interface ServicePoll
Parameters:
pollDTO - le sondage
Returns:
true si le sondage a été mise à jour

deletePoll

public boolean deletePoll(String pollId)
Description copied from interface: ServicePoll
Suppression du sondage

Specified by:
deletePoll in interface ServicePoll
Parameters:
pollId - le sondage
Returns:
true si le sondage a été supprimé

findPollById

public PollDTO findPollById(String pollId)
Description copied from interface: ServicePoll
Récupération d'un sondage à partir de son identifiant ToPIA

Specified by:
findPollById in interface ServicePoll
Parameters:
pollId - identifiant topia du sondage
Returns:
le sondage

findPollByPollId

public PollDTO findPollByPollId(String pollId)
Description copied from interface: ServicePoll
Récupération d'un sondage à partir de son identifiant.

Specified by:
findPollByPollId in interface ServicePoll
Parameters:
pollId - identifiant du sondage
Returns:
le sondage

findPollsByName

public List<PollDTO> findPollsByName(String pollName)
Description copied from interface: ServicePoll
Récupération d'un sondage par son nom

Specified by:
findPollsByName in interface ServicePoll
Parameters:
pollName - nom du sondage
Returns:
liste de sondages

findPollsByUser

public List<PollDTO> findPollsByUser(String userId)
Description copied from interface: ServicePoll
Récupération des sondages d'un utilisateur

Specified by:
findPollsByUser in interface ServicePoll
Parameters:
userId - Le créateur du sondage
Returns:
liste de sondages

findParticipatedPolls

public List<PollDTO> findParticipatedPolls(String userId)
Description copied from interface: ServicePoll
Récupération des sondages auxquels un utilisateur a participé.

Specified by:
findParticipatedPolls in interface ServicePoll
Parameters:
userId - L'identifiant de l'utilisateur
Returns:
liste de sondages

findInvitedPolls

public List<PollDTO> findInvitedPolls(String userId)
Description copied from interface: ServicePoll
Récupération des sondages auxquels un utilisateur est invité.

Specified by:
findInvitedPolls in interface ServicePoll
Parameters:
userId - L'identifiant de l'utilisateur
Returns:
liste de sondages

findRunningPolls

public List<PollDTO> findRunningPolls(boolean withEndDate)
Description copied from interface: ServicePoll
Récupération des sondages en cours.

Specified by:
findRunningPolls in interface ServicePoll
Parameters:
withEndDate - sélectionner uniquement les sondages ayant une date de fin
Returns:
liste de sondages

selectPolls

public List<PollDTO> selectPolls(Map<String,Object> properties)
Description copied from interface: ServicePoll
Récupération des sondages

Specified by:
selectPolls in interface ServicePoll
Parameters:
properties - filtre
Returns:
liste de sondages

addVoteToPoll

public boolean addVoteToPoll(String pollId,
                             String voteId)
Description copied from interface: ServicePoll
Ajout d'un vote à un sondage

Specified by:
addVoteToPoll in interface ServicePoll
Parameters:
pollId - identifiant topia du sondage
voteId - l'identiiant topiaId du vote
Returns:
true si le vote a été ajouté

getRestrictedAccount

public PollAccountDTO getRestrictedAccount(String accountUId,
                                           PollDTO poll)
Description copied from interface: ServicePoll
Return the pollAccount corresponding to the accountUId for the restricted poll. TODO : need JUnit test, must be done for 1.3

Specified by:
getRestrictedAccount in interface ServicePoll
Parameters:
accountUId - to check the restriction constraint
poll - reference
Returns:
the pollAccount found from poll or null if there is no pollAccount in poll restriction for the accountUId in argument


Copyright © 2009-2010 CodeLutin. All Rights Reserved.