org.exoplatform.forum.extras.injection.poll
Class AbstractPollInjector

java.lang.Object
  extended by org.exoplatform.container.component.BaseComponentPlugin
      extended by org.exoplatform.services.bench.DataInjector
          extended by org.exoplatform.forum.extras.injection.poll.AbstractPollInjector
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
Direct Known Subclasses:
GroupInjector, PollInjector, VoteInjector

public abstract class AbstractPollInjector
extends org.exoplatform.services.bench.DataInjector


Field Summary
static String DEFAULT_GROUP_PREFIX
           
static String DEFAULT_POLL_PRIVATE_PREFIX
           
static String DEFAULT_POLL_PUBLIC_PREFIX
           
protected  ExoNameGenerator exoNameGenerator
           
protected static org.exoplatform.forum.service.ForumService forumService
           
protected  String groupBase
           
protected  org.exoplatform.services.organization.GroupHandler groupHandler
           
protected  int groupNumber
           
protected  org.exoplatform.forum.common.jcr.KSDataLocation locator
           
protected  LoremIpsum4J lorem
           
protected static int OPTION_DEFAULT_SIZE
           
protected  String optionBase
           
protected  int optionNumber
           
protected static org.exoplatform.services.organization.OrganizationService organizationService
           
static String POLL_DEFAULT_TYPE
           
static String POLL_TYPE
           
protected  String pollPrivateBase
           
protected  int pollPrivateNumber
           
protected  String pollPublicBase
           
protected  int pollPublicNumber
           
protected static org.exoplatform.poll.service.PollService pollService
           
protected  Random random
           
protected  String userBase
           
protected  int userNumber
           
 
Fields inherited from class org.exoplatform.services.bench.DataInjector
ARRAY_SPLIT
 
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name
 
Constructor Summary
AbstractPollInjector()
           
 
Method Summary
 Object execute(HashMap<String,String> stringHashMap)
           
 org.exoplatform.poll.service.Poll getFullPublicPollByName(String pollName)
           
 org.exoplatform.services.organization.Group getGroupByName(String groupName)
           
protected  int getIntParam(HashMap<String,String> params, String name)
           
 org.exoplatform.services.log.Log getLog()
           
 org.exoplatform.poll.service.Poll getPrivatePollByName(String groupName, String pollName)
           
 org.exoplatform.poll.service.Poll getPublicPollByName(String pollName)
           
 javax.jcr.Node getPublicPollNodeByName(String pollName)
           
protected static String getStringValueParam(HashMap<String,String> params, String key, String defaultValue)
           
protected  String groupName()
           
 int groupNumber(String base)
           
 void init(String groupPrefix, String pollPublicPrefix, String pollPrivatePrefix, String toGroup, String userPrefix)
           
 javax.jcr.NodeIterator pollNodesForPublic(String pollBase)
           
 int pollNumberForPrivate(String groupName, String pollBase)
           
 int pollNumberForPublic(String pollBase)
           
protected  String pollPrivateName()
           
protected  String pollPublicName()
           
 void reject(HashMap<String,String> stringHashMap)
           
 int userNumber(String base)
           
 
Methods inherited from class org.exoplatform.services.bench.DataInjector
createTextResource, getRestId, inject, paragraphs, randomParagraphs, randomUser, randomWords, readGroupsIfExist, readMembershipIfExist, readUsersIfExist, setRestId, words
 
Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POLL_DEFAULT_TYPE

public static final String POLL_DEFAULT_TYPE
See Also:
Constant Field Values

DEFAULT_POLL_PRIVATE_PREFIX

public static final String DEFAULT_POLL_PRIVATE_PREFIX
See Also:
Constant Field Values

DEFAULT_POLL_PUBLIC_PREFIX

public static final String DEFAULT_POLL_PUBLIC_PREFIX
See Also:
Constant Field Values

DEFAULT_GROUP_PREFIX

public static final String DEFAULT_GROUP_PREFIX
See Also:
Constant Field Values

OPTION_DEFAULT_SIZE

protected static final int OPTION_DEFAULT_SIZE
See Also:
Constant Field Values

pollService

protected static org.exoplatform.poll.service.PollService pollService

forumService

protected static org.exoplatform.forum.service.ForumService forumService

locator

protected final org.exoplatform.forum.common.jcr.KSDataLocation locator

organizationService

protected static org.exoplatform.services.organization.OrganizationService organizationService

groupHandler

protected org.exoplatform.services.organization.GroupHandler groupHandler

groupBase

protected String groupBase

groupNumber

protected int groupNumber

pollPublicBase

protected String pollPublicBase

pollPrivateBase

protected String pollPrivateBase

pollPrivateNumber

protected int pollPrivateNumber

pollPublicNumber

protected int pollPublicNumber

optionBase

protected String optionBase

optionNumber

protected int optionNumber

userBase

protected String userBase

userNumber

protected int userNumber

random

protected Random random

exoNameGenerator

protected ExoNameGenerator exoNameGenerator

lorem

protected LoremIpsum4J lorem

POLL_TYPE

public static final String POLL_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractPollInjector

public AbstractPollInjector()
Method Detail

getLog

public org.exoplatform.services.log.Log getLog()
Specified by:
getLog in class org.exoplatform.services.bench.DataInjector

execute

public Object execute(HashMap<String,String> stringHashMap)
               throws Exception
Specified by:
execute in class org.exoplatform.services.bench.DataInjector
Throws:
Exception

reject

public void reject(HashMap<String,String> stringHashMap)
            throws Exception
Specified by:
reject in class org.exoplatform.services.bench.DataInjector
Throws:
Exception

pollPublicName

protected String pollPublicName()

pollPrivateName

protected String pollPrivateName()

groupName

protected String groupName()

init

public void init(String groupPrefix,
                 String pollPublicPrefix,
                 String pollPrivatePrefix,
                 String toGroup,
                 String userPrefix)

groupNumber

public int groupNumber(String base)
                throws Exception
Throws:
Exception

getGroupByName

public org.exoplatform.services.organization.Group getGroupByName(String groupName)
                                                           throws Exception
Throws:
Exception

userNumber

public int userNumber(String base)
               throws Exception
Throws:
Exception

getPublicPollByName

public org.exoplatform.poll.service.Poll getPublicPollByName(String pollName)
                                                      throws Exception
Throws:
Exception

getFullPublicPollByName

public org.exoplatform.poll.service.Poll getFullPublicPollByName(String pollName)
                                                          throws Exception
Throws:
Exception

getPublicPollNodeByName

public javax.jcr.Node getPublicPollNodeByName(String pollName)
                                       throws Exception
Throws:
Exception

getPrivatePollByName

public org.exoplatform.poll.service.Poll getPrivatePollByName(String groupName,
                                                              String pollName)
                                                       throws Exception
Throws:
Exception

pollNumberForPrivate

public int pollNumberForPrivate(String groupName,
                                String pollBase)
                         throws Exception
Throws:
Exception

pollNumberForPublic

public int pollNumberForPublic(String pollBase)
                        throws Exception
Throws:
Exception

pollNodesForPublic

public javax.jcr.NodeIterator pollNodesForPublic(String pollBase)
                                          throws Exception
Throws:
Exception

getStringValueParam

protected static String getStringValueParam(HashMap<String,String> params,
                                            String key,
                                            String defaultValue)

getIntParam

protected int getIntParam(HashMap<String,String> params,
                          String name)


Copyright © 2013 eXo Platform SAS. All Rights Reserved.