org.exoplatform.forum.extras.injection.faq
Class AbstractFAQInjector

java.lang.Object
  extended by org.exoplatform.container.component.BaseComponentPlugin
      extended by org.exoplatform.services.bench.DataInjector
          extended by org.exoplatform.forum.extras.injection.faq.AbstractFAQInjector
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
Direct Known Subclasses:
AnswerInjector, AttachmentInjector, CategoryInjector, CommentInjector, MembershipInjector, ProfileInjector, QuestionInjector

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


Field Summary
protected  String answerBase
          .
protected  int answerNumber
          .
protected  int byteSizeBase
          .
protected  String categoryBase
          .
protected  int categoryNumber
          .
protected  String commentBase
          .
protected  int commentNumber
          .
protected static String DOMAIN
          .
protected  ExoNameGenerator exoNameGenerator
          .
protected  org.exoplatform.faq.service.FAQService faqService
          .
protected  org.exoplatform.faq.service.FAQSetting faqSetting
          .
protected  org.exoplatform.forum.common.jcr.KSDataLocation locator
          .
protected  LoremIpsum4J lorem
          .
protected  org.exoplatform.services.organization.OrganizationService organizationService
          .
protected static String PASSWORD
          .
protected  String questionBase
          .
protected  int questionNumber
          .
protected  Random random
          .
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
AbstractFAQInjector()
           
 
Method Summary
protected  String answerName()
           
 int answerNumber(String base)
           
protected  String categoryName()
           
 int categoryNumber(String base)
           
protected  String commentName()
           
 int commentNumber(String base)
           
 Object execute(HashMap<String,String> stringStringHashMap)
           
 org.exoplatform.faq.service.Answer getAnswerByName(String answerName)
           
 org.exoplatform.faq.service.Category getCategoryByName(String catName)
           
protected  org.exoplatform.faq.service.Category getCategoryRoot(boolean isUpdate)
           
 org.exoplatform.faq.service.Comment getCommentByName(String commentName)
           
protected  javax.jcr.Node getFAQHomeNode(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 org.exoplatform.services.log.Log getLog()
           
 org.exoplatform.faq.service.Question getQuestionByName(String questionName)
           
 void init(String userPrefix, String categoryPrefix, String questionPrefix, String answerPrefix, String commentPrefix, int byteSize)
           
protected  int param(HashMap<String,String> params, String name)
           
protected  String questionName()
           
 int questionNumber(String base)
           
 void reject(HashMap<String,String> stringStringHashMap)
           
protected  javax.jcr.NodeIterator search(String queryString)
           
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
.


questionBase

protected String questionBase
.


answerBase

protected String answerBase
.


commentBase

protected String commentBase
.


byteSizeBase

protected int byteSizeBase
.


organizationService

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


faqService

protected final org.exoplatform.faq.service.FAQService faqService
.


locator

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


userHandler

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


faqSetting

protected org.exoplatform.faq.service.FAQSetting faqSetting
.


userNumber

protected int userNumber
.


categoryNumber

protected int categoryNumber
.


questionNumber

protected int questionNumber
.


answerNumber

protected int answerNumber
.


commentNumber

protected int commentNumber
.


random

protected final Random random
.


exoNameGenerator

protected ExoNameGenerator exoNameGenerator
.


lorem

protected LoremIpsum4J lorem
.

Constructor Detail

AbstractFAQInjector

public AbstractFAQInjector()
Method Detail

init

public void init(String userPrefix,
                 String categoryPrefix,
                 String questionPrefix,
                 String answerPrefix,
                 String commentPrefix,
                 int byteSize)

userNumber

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

categoryNumber

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

questionNumber

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

answerNumber

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

commentNumber

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

getCategoryRoot

protected org.exoplatform.faq.service.Category getCategoryRoot(boolean isUpdate)

search

protected javax.jcr.NodeIterator search(String queryString)
                                 throws Exception
Throws:
Exception

getFAQHomeNode

protected javax.jcr.Node getFAQHomeNode(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                 throws Exception
Throws:
Exception

getCategoryByName

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

getQuestionByName

public org.exoplatform.faq.service.Question getQuestionByName(String questionName)
                                                       throws Exception
Throws:
Exception

getAnswerByName

public org.exoplatform.faq.service.Answer getAnswerByName(String answerName)
                                                   throws Exception
Throws:
Exception

getCommentByName

public org.exoplatform.faq.service.Comment getCommentByName(String commentName)
                                                     throws Exception
Throws:
Exception

userName

protected String userName()

categoryName

protected String categoryName()

questionName

protected String questionName()

answerName

protected String answerName()

commentName

protected String commentName()

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

getLog

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

param

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


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