JBoss.orgCommunity Documentation

Wiki Data injector

The Data injector for Wiki is configured as follow:



<external-component-plug-ins>
  <target-component>org.exoplatform.services.bench.DataInjectorService</target-component>
  <component-plug-in>
    <name>WikiDataInjector</name>
    <set-method>addInjector</set-method>
    <type>org.exoplatform.wiki.bench.WikiDataInjector</type>
    <description>inject data for Wiki</description>
  </component-plug-in>
</external-component-plug-ins>
http://[rest path]/bench/inject/WikiDataInjector/?type=data&q=1,2,3&pre=abc,def,mnp&wo=classic&wt=portal&maxAtt=10&mP=100

In which, parameters mean:

Param Value Description
type [data | perm] Type of injector. It can be data or perm which injects data or permission respectively.
q Number The number of pages in each depth, separated by commas. For example, if value is 1,2,3 then the injector will create 1 new child of WikiHome, 2 children per each page created in depth 1 and 3 children for each page created in depth 2.
pre String Prefix for page id in each depth, separated by commas. For example, if value is abc,def,ghk then pages in depth 1 have title starting with "abc", title of pages in depth 2 start with "def" and in depth 3 is "ghk".
wo String Wiki owner.
wt String Wiki type. The value can be: 'portal', 'user', 'group'.
maxAtt Number The size of attachment in created pages. the value is evaluated in KByte. If the value is 0 or not set, no attachment is created.
mP Number The maximum pages in each injection. The number of created pages must not exceed this value.

To grant permission, the request link is in the following format:

http://localhost:8080/rest-ksdemo/private/bench/inject/WikiDataInjector/?type=perm&q=1,2,3&pre=abc,def,ghk&wo=classic&wt=portal&perm=11&users=root,mary&groups=*:/platform/user&rcs=true

For instance, in the link above, the injector will set the Read and Edit permission for pages of portal/classic which meet the constraint (q=1,2,3 and pre=abc,def,ghk).

You can use these parameters to set up permissions for pages:

Param Value Description
q Number The number of pages in each depth separated by commas. For example, if value is 1,2,3 then the injector will create 1 new child of WikiHome, 2 children per each page created in depth 1 and 3 children for each page created in depth 2.
pre String The prefix for page id in each depth separated by commas. For example, if the value is "abc,def,ghk" then pages in depth 1 will have title starting with "abc", title of pages in depth 2 will start with "def" and in depth 3 is "ghk"
wo String The wiki owner separated by commas.
wt String The wiki type separated by commas. This value can be: portal, user or group.
users String, The list of granted permissions users separated by commas.
groups String The list of granted permissions groups separated by commas.
memship String The list of granted permissions memberships separated by commas.
perm [number][number] The declared permissions. The value must be a string with 2 numbers. The first number is to define Read permission of identity while the other one is for Edit permission. If the number is "zero", the privilege is denied and vise versa. For example, 11 means that both Read and Edit pages permmission are granted.
rcs Boolean Recursive or not. If the value is true, all pages that meet the constraint will be set permission, or deepest pages (smallest descendants) will be affected.