org.exoplatform.forum.extras.injection.forum
Class AbstractForumInjector

java.lang.Object
  extended by org.exoplatform.container.component.BaseComponentPlugin
      extended by org.exoplatform.services.bench.DataInjector
          extended by org.exoplatform.forum.extras.injection.forum.AbstractForumInjector
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
Direct Known Subclasses:
AttachmentInjector, CategoryInjector, ForumInjector, MembershipInjector, PostInjector, ProfileInjector, TopicInjector

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

Version:
$Revision$
Author:
ThanhVu

Field Summary
protected  int byteSizeBase
          .
protected  String categoryBase
          .
protected  int categoryNumber
          .
protected static String DOMAIN
          .
protected  ExoNameGenerator exoNameGenerator
          .
protected  String forumBase
          .
protected  int forumNumber
          .
protected  org.exoplatform.forum.service.ForumService forumService
          .
protected  org.exoplatform.forum.common.jcr.KSDataLocation locator
          .
protected  LoremIpsum4J lorem
          .
protected  org.exoplatform.services.organization.OrganizationService organizationService
          .
protected static String PASSWORD
          .
protected  String postBase
          .
protected  int postNumber
          .
protected  Random random
          .
protected  String topicBase
          .
protected  int topicNumber
          .
protected  String userBase
          .
protected  org.exoplatform.services.organization.UserHandler userHandler
          .
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
AbstractForumInjector()
           
 
Method Summary
protected  String categoryName()
           
 int categoryNumber(String base)
           
 Object execute(HashMap<String,String> stringStringHashMap)
           
protected  String forumName()
           
 int forumNumber(String base)
           
 org.exoplatform.forum.service.Category getCategoryByForumName(String forumName)
           
 org.exoplatform.forum.service.Category getCategoryByName(String catName)
           
 org.exoplatform.forum.service.Forum getForumByName(String forumName)
           
 org.exoplatform.forum.service.Forum getForumByTopicName(String topicName)
           
protected  String getId(String type)
           
 org.exoplatform.services.log.Log getLog()
           
 org.exoplatform.forum.service.Post getPostByName(String postName)
           
 org.exoplatform.forum.service.Topic getTopicByName(String topicName)
           
 org.exoplatform.forum.service.Topic getTopicByPostName(String postName)
           
 void init(String userPrefix, String categoryPrefix, String forumPrefix, String topicPrefix, String postPrefix, int byteSize)
           
protected  int param(HashMap<String,String> params, String name)
           
protected  String postName()
           
 int postNumber(String base)
           
 void reject(HashMap<String,String> stringStringHashMap)
           
protected  String topicName()
           
 int topicNumber(String base)
           
protected  String userName()
           
 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

PASSWORD

protected static final String PASSWORD
.

See Also:
Constant Field Values

DOMAIN

protected static final String DOMAIN
.

See Also:
Constant Field Values

userBase

protected String userBase
.


categoryBase

protected String categoryBase
.


forumBase

protected String forumBase
.


topicBase

protected String topicBase
.


postBase

protected String postBase
.


byteSizeBase

protected int byteSizeBase
.


userNumber

protected int userNumber
.


categoryNumber

protected int categoryNumber
.


forumNumber

protected int forumNumber
.


topicNumber

protected int topicNumber
.


postNumber

protected int postNumber
.


organizationService

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


forumService

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


locator

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


userHandler

protected final org.exoplatform.services.organization.UserHandler userHandler
.


random

protected final Random random
.


exoNameGenerator

protected ExoNameGenerator exoNameGenerator
.


lorem

protected LoremIpsum4J lorem
.

Constructor Detail

AbstractForumInjector

public AbstractForumInjector()
Method Detail

init

public void init(String userPrefix,
                 String categoryPrefix,
                 String forumPrefix,
                 String topicPrefix,
                 String postPrefix,
                 int byteSize)

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> stringStringHashMap)
               throws Exception
Specified by:
execute in class org.exoplatform.services.bench.DataInjector
Throws:
Exception

reject

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

userNumber

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

categoryNumber

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

forumNumber

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

topicNumber

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

postNumber

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

getCategoryByName

public org.exoplatform.forum.service.Category getCategoryByName(String catName)
                                                         throws Exception
Throws:
Exception

getForumByName

public org.exoplatform.forum.service.Forum getForumByName(String forumName)
                                                   throws Exception
Throws:
Exception

getCategoryByForumName

public org.exoplatform.forum.service.Category getCategoryByForumName(String forumName)
                                                              throws Exception
Throws:
Exception

getTopicByName

public org.exoplatform.forum.service.Topic getTopicByName(String topicName)
                                                   throws Exception
Throws:
Exception

getPostByName

public org.exoplatform.forum.service.Post getPostByName(String postName)
                                                 throws Exception
Throws:
Exception

getTopicByPostName

public org.exoplatform.forum.service.Topic getTopicByPostName(String postName)
                                                       throws Exception
Throws:
Exception

getForumByTopicName

public org.exoplatform.forum.service.Forum getForumByTopicName(String topicName)
                                                        throws Exception
Throws:
Exception

userName

protected String userName()

categoryName

protected String categoryName()

forumName

protected String forumName()

topicName

protected String topicName()

postName

protected String postName()

getId

protected String getId(String type)

param

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


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