eXo Platform 3.0

- Prev
- Next

## Chapter 65. Organization Service Initializer

Use the Organization Service Initializer 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>

Params for membership type:

- type: The membership type's name.

- description: The membership type's description.

Params for group:

- name: The group's name

- parentId: The id of the parent group. If the parent id is null, it means that the group is at the first level. The parentId should have the form: /ancestor/parent

- description: The group's description

- label: The group's label

Params for user:

- userName: The user's name

- password: The user's password

- firstName: The user's first name

- lastName: The user's last name

- email: The user's email

- groups: The user's membership types and groups in which he consist.

- Prev
- Up
- Home
- Next