org.exoplatform.poll.service.impl
Class PollServiceImpl

java.lang.Object
  extended by org.exoplatform.poll.service.impl.PollServiceImpl
All Implemented Interfaces:
PollService, org.picocontainer.Startable

public class PollServiceImpl
extends Object
implements org.picocontainer.Startable, PollService


Field Summary
protected  List<PollEventListener> listeners_
           
 
Constructor Summary
PollServiceImpl(org.exoplatform.container.xml.InitParams params, org.exoplatform.forum.common.jcr.KSDataLocation locator, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator)
           
 
Method Summary
 void addInitialDefaultDataPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
          Adds a plugin which initalizes the default data at first runtime.
 void addListenerPlugin(PollEventListener listener)
          Adds a listener plugin.
 String getActivityIdForOwner(String ownerPath)
          Gets information of a poll activity that is used for processing the activity streams.
 List<Poll> getPagePoll()
          Gets a list of polls.
 Poll getPoll(String pollId)
          Gets a poll by its Id.
 PollSummary getPollSummary(List<String> groupOfUser)
          Gets summary of a poll.
 boolean hasPermissionInForum(String pollPath, List<String> allInfoOfUser)
          Checks if a user has permission on a poll or not.
 void removeListenerPlugin(PollEventListener listener)
          Removes a listener plugin.
 Poll removePoll(String pollId)
          Removes a poll.
 void saveActivityIdForOwner(String ownerPath, String activityId)
          Saves information of a poll activity that is used for processing the activity streams.
 void savePoll(Poll poll, boolean isNew, boolean isVote)
          Saves a poll.
 void setClosedPoll(Poll poll)
          Sets a poll to "closed".
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners_

protected List<PollEventListener> listeners_
Constructor Detail

PollServiceImpl

public PollServiceImpl(org.exoplatform.container.xml.InitParams params,
                       org.exoplatform.forum.common.jcr.KSDataLocation locator,
                       org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator)
                throws Exception
Throws:
Exception
Method Detail

addInitialDefaultDataPlugin

public void addInitialDefaultDataPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
                                 throws Exception
Description copied from interface: PollService
Adds a plugin which initalizes the default data at first runtime.

Specified by:
addInitialDefaultDataPlugin in interface PollService
Parameters:
plugin - The plugin to be added.
Throws:
Exception - the exception

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable

getPoll

public Poll getPoll(String pollId)
             throws Exception
Description copied from interface: PollService
Gets a poll by its Id.

Specified by:
getPoll in interface PollService
Parameters:
pollId - Id of the poll.
Returns:
The poll.
Throws:
Exception - the exception

removePoll

public Poll removePoll(String pollId)
Description copied from interface: PollService
Removes a poll.

Specified by:
removePoll in interface PollService
Parameters:
pollId - Id of the poll which is removed.
Returns:
The poll

savePoll

public void savePoll(Poll poll,
                     boolean isNew,
                     boolean isVote)
              throws Exception
Description copied from interface: PollService
Saves a poll.

Specified by:
savePoll in interface PollService
Parameters:
poll - The poll to be saved.
isNew - If "true", the new poll is added. If "false", the poll is updated.
isVote - If "true", the poll can be voted. If "false", the poll is updated.
Throws:
Exception - the exception

addListenerPlugin

public void addListenerPlugin(PollEventListener listener)
                       throws Exception
Description copied from interface: PollService
Adds a listener plugin.

Specified by:
addListenerPlugin in interface PollService
Parameters:
listener - The listener plugin to be added.
Throws:
Exception

removeListenerPlugin

public void removeListenerPlugin(PollEventListener listener)
                          throws Exception
Description copied from interface: PollService
Removes a listener plugin.

Specified by:
removeListenerPlugin in interface PollService
Parameters:
listener - The listener plugin to be removed.
Throws:
Exception

setClosedPoll

public void setClosedPoll(Poll poll)
Description copied from interface: PollService
Sets a poll to "closed".

Specified by:
setClosedPoll in interface PollService
Parameters:
poll - The poll which is set to "closed".

getPagePoll

public List<Poll> getPagePoll()
                       throws Exception
Description copied from interface: PollService
Gets a list of polls.

Specified by:
getPagePoll in interface PollService
Returns:
Polls.
Throws:
Exception - the exception

hasPermissionInForum

public boolean hasPermissionInForum(String pollPath,
                                    List<String> allInfoOfUser)
                             throws Exception
Description copied from interface: PollService
Checks if a user has permission on a poll or not.

Specified by:
hasPermissionInForum in interface PollService
Parameters:
pollPath - Path to the poll.
allInfoOfUser - Information about user, group and membership of the user.
Returns:
The returned value is "true" if the checked user has permission on the poll.
Throws:
Exception - the exception

getPollSummary

public PollSummary getPollSummary(List<String> groupOfUser)
                           throws Exception
Description copied from interface: PollService
Gets summary of a poll.

Specified by:
getPollSummary in interface PollService
Parameters:
groupOfUser - All groups of the current user.
Returns:
The poll summary.
Throws:
Exception - the exception

saveActivityIdForOwner

public void saveActivityIdForOwner(String ownerPath,
                                   String activityId)
Description copied from interface: PollService
Saves information of a poll activity that is used for processing the activity streams.

Specified by:
saveActivityIdForOwner in interface PollService
Parameters:
ownerPath - Path to the poll activity.
activityId - Id of the poll activity.

getActivityIdForOwner

public String getActivityIdForOwner(String ownerPath)
Description copied from interface: PollService
Gets information of a poll activity that is used for processing the activity streams.

Specified by:
getActivityIdForOwner in interface PollService
Parameters:
ownerPath - Path to the poll activity.
Returns:
Id of the poll activity.


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.