JBoss.orgCommunity Documentation
The following configuration is used for the Answer Data injector:
<external-component-plug-ins>
<target-component>org.exoplatform.services.bench.DataInjectorService</target-component>
<component-plug-in>
<name>AnswerDataInjector</name>
<set-method>addInjector</set-method>
<type>org.exoplatform.faq.bench.AnswerDataInjector</type>
<description>inject data for Answer</description>
</component-plug-in>
</external-component-plug-ins>
To inject data, the request link is in the following format:
http://[rest path]/bench/inject/AnswerDataInjector/?type=data&q=2,3,4,5,6&pre=cate,ques,answ,comm&att=2&attCp=100&&txtCp=100
In which:
Param | Value | Description |
---|---|---|
type | [data | perm] | Type of injector. It can be data or perm means injecting data or permission respectively. |
q | number,number,etc | The number of items in each depth. For example, if the value is 2,3,4,5,6 then the injector will create 2 new categories with the depth level is '3', add 4 questions in each category, 5 answer and 6 comment in each question. Warning: Do not set the depth level to more than 5, because the number of items are calculated by number*depth. |
pre | string, string, etc | The prefix for items id in each depth. For example, if the value is "cate, ques, answ, comm", then the category has the first name/id called "cate", the question has the fist name/id called "ques", the answer has the fist id called "answ" and the comment has the first id called "comm". |
att | number | The number of attachments in one question. If the value is '0' or not set, no attachment is created. |
attCp | number | The capacity of one attachment. The value is evaluated in KByte and must be larger than KByte. |
txtcp | number | The capacity text of one item (question/answer/comment). The value is evaluated in KByte. If the value is 0 or not set, texts are created randomly. |
All number of item injectors are calculated by:
Categories: cats = numberCat * depth!
Questions : ques = cats * numberQue
Answers : anss = quest * numberAns
Comments : coms = quest * numberComs
All = cats + ques + anss + coms
For example:
q=2,3,4,5,6: All = 2 * 3! + (2 * 3) * 4) * 5 + ((2 * 3!) * 4) * 6 = 588 (items)
If you change the depth from '3' to '5', the number of items will be 11760.
To grant permission, the request link is in the following format:
http://[rest path]/bench/inject/AnswerDataInjector/?type=perm&q=2,3,4,5,6&pre=cate,ques,answ,comm&att=2&attCp=100&&txtCp=100&view=root,demo,*:/platform/user&edit=root,*:/platform/manager
In which:
Param | Value | Description | |
---|---|---|---|
view | string, string, etc | The list of granted permissions users/groups/memberships, if the value is "any" or not set, everyone can view all category create by prefix. | |
edit | string, string, etc | The list of granted permissions users/groups/memberships, if the value is "any" or not set, only user with highest permission (Administrator) can edit all category create by prefix. |
In the other way, such settings have been declared in "ksdemo.war/WEB-INF/conf/ksdemo/ks/bench-configuration.xml", therefore, to save time and effort, you can import it to "ksdemo.war/WEB-INF/conf/configuration.xml" and then modify it rather than create new one.