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 the plugin.
 void addListenerPlugin(PollEventListener listener)
          Adds poll event listener.
 String getActivityIdForOwner(String ownerPath)
          Gets value of exo:activityId property in specified node via path.
 List<Poll> getPagePoll()
          Gets list of polls.
 Poll getPoll(String pollId)
          Gets the poll by id.
 PollSummary getPollSummary(List<String> groupOfUser)
          Gets the poll summary.
 boolean hasPermissionInForum(String pollPath, List<String> allInfoOfUser)
          Checks has permission of user viewer the poll in the forum.
 void removeListenerPlugin(PollEventListener listener)
          Removes poll event listener.
 Poll removePoll(String pollId)
          Removes the poll.
 void saveActivityIdForOwner(String ownerPath, String activityId)
          Defines Mixin type exo:activityInfo for node that means to add exo:activityId property into Node what is owner created activity via patch
 void savePoll(Poll poll, boolean isNew, boolean isVote)
          Saves poll.
 void setClosedPoll(Poll poll)
          Sets the 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 the plugin.

Specified by:
addInitialDefaultDataPlugin in interface PollService
Parameters:
plugin - the plugin
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 the poll by id.

Specified by:
getPoll in interface PollService
Returns:
the poll
Throws:
Exception - the exception

removePoll

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

Specified by:
removePoll in interface PollService
Returns:
the poll

savePoll

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

Specified by:
savePoll in interface PollService
Parameters:
poll - the poll
isNew - is the new
isVote - is the vote
Throws:
Exception - the exception

addListenerPlugin

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

Specified by:
addListenerPlugin in interface PollService
Throws:
Exception

removeListenerPlugin

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

Specified by:
removeListenerPlugin in interface PollService
Throws:
Exception

setClosedPoll

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

Specified by:
setClosedPoll in interface PollService

getPagePoll

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

Specified by:
getPagePoll in interface PollService
Returns:
the list of polls
Throws:
Exception - the exception

hasPermissionInForum

public boolean hasPermissionInForum(String pollPath,
                                    List<String> allInfoOfUser)
                             throws Exception
Description copied from interface: PollService
Checks has permission of user viewer the poll in the forum.

Specified by:
hasPermissionInForum in interface PollService
Parameters:
pollPath - the path of the poll.
allInfoOfUser - user, group and membership of the user.
Returns:
boolean
Throws:
Exception - the exception

getPollSummary

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

Specified by:
getPollSummary in interface PollService
Parameters:
groupOfUser - group
Returns:
the poll summary
Throws:
Exception - the exception

saveActivityIdForOwner

public void saveActivityIdForOwner(String ownerPath,
                                   String activityId)
Description copied from interface: PollService
Defines Mixin type exo:activityInfo for node that means to add exo:activityId property into Node what is owner created activity via patch

Specified by:
saveActivityIdForOwner in interface PollService
Parameters:
ownerPath - - the Path's Node what is owner created activity
activityId - - the Id's activity created.

getActivityIdForOwner

public String getActivityIdForOwner(String ownerPath)
Description copied from interface: PollService
Gets value of exo:activityId property in specified node via path. If property is not existing then return null.

Specified by:
getActivityIdForOwner in interface PollService
Parameters:
ownerPath - - the Path's Node what is owner created activity
Returns:
String - the Id's activity created.


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.