2.4. Organization Service Initializer

The Organization Service Initializer is used to create users, groups and membership types by default.


<external-component-plugins>
    <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
    <component-plugin>
      <name>init.service.listener</name>
      <set-method>addListenerPlugin</set-method>
      <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
      <description>this listener populate organization data for the first launch</description>
      <init-params>
        <value-param>
          <name>checkDatabaseAlgorithm</name>
          <description>check database</description>
          <value>entry</value>
        </value-param>
        <value-param>
          <name>printInformation</name>
          <description>Print information init database</description>
          <value>false</value>
        </value-param>
        <object-param>
          <name>configuration</name>
          <description>description</description>
          <object type="org.exoplatform.services.organization.OrganizationConfig">
            <field name="membershipType">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
                    <field name="type">
                      <string>manager</string>
                    </field>
                    <field name="description">
                      <string>manager membership type</string>
                    </field>
                  </object>
                </value>
              </collection>
            </field>
            
            <field name="group">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
                    <field name="name">
                      <string>platform</string>
                    </field>
                    <field name="parentId">
                      <string></string>
                    </field>
                    <field name="description">
                      <string>the /platform group</string>
                    </field>
                    <field name="label">
                      <string>Platform</string>
                    </field>
                  </object>
                </value>
                <value>
                  <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
                    <field name="name">
                      <string>administrators</string>
                    </field>
                    <field name="parentId">
                      <string>/platform</string>
                    </field>
                    <field name="description">
                      <string>the /platform/administrators group</string>
                    </field>
                    <field name="label">
                      <string>Administrators</string>
                    </field>
                  </object>
                </value>
               </collection>
            </field>
            
            <field name="user">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.organization.OrganizationConfig$User">
                    <field name="userName">
                      <string>root</string>
                    </field>
                    <field name="password">
                      <string>exo</string>
                    </field>
                    <field name="firstName">
                      <string>Root</string>
                    </field>
                    <field name="lastName">
                      <string>Root</string>
                    </field>
                    <field name="email">
                      <string>root@localhost</string>
                    </field>
                    <field name="groups">
                      <string>
                        manager:/platform/administrators
                      </string>
                    </field>
                  </object>
                </value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

Parameters for membership type:

Params for group:

Params for user:

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus