8.2.1. Activating the OrganizationIntegrationService

To activate the service, you can configure it in your custom extension. To tidy up, the configuration should be written in a separated file.

  1. Create the WEB-INF/conf/organization/sync.xml file in your custom extension project, with the following content:

    
    <configuration>
        <component>
            <type>org.exoplatform.platform.organization.integration.OrganizationIntegrationService</type>
            <init-params>
                <value-param>
                    <name>workspace</name>
                    <value>collaboration</value>
                </value-param>
                <value-param>
                    <name>homePath</name>
                    <value>/</value>
                </value-param>
                <value-param>
                    <name>synchronizeGroups</name>
                    <value>true</value>
                </value-param>
            </init-params>
        </component>
        
        <external-component-plugins>
            <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
            <component-plugin>
                <name>organization.initializer.group.event.listener</name>
                <set-method>addListenerPlugin</set-method>
                <type>org.exoplatform.platform.organization.integration.NewGroupListener</type>
                <description>description</description>
            </component-plugin>
            <component-plugin>
                <name>organization.initializer.user.event.listener</name>
                <set-method>addListenerPlugin</set-method>
                <type>org.exoplatform.platform.organization.integration.NewUserListener</type>
                <description>description</description>
            </component-plugin>
            <component-plugin>
                <name>organization.initializer.membership.event.listener</name>
                <set-method>addListenerPlugin</set-method>
                <type>org.exoplatform.platform.organization.integration.NewMembershipListener</type>
                <description>description</description>
            </component-plugin>
            <component-plugin>
                <name>organization.initializer.profile.event.listener</name>
                <set-method>addListenerPlugin</set-method>
                <type>org.exoplatform.platform.organization.integration.NewProfileListener</type>
                <description>description</description>
            </component-plugin>
        </external-component-plugins>

        <external-component-plugins>
            <target-component>org.exoplatform.services.listener.ListenerService</target-component>
            <component-plugin>
                <name>exo.core.security.ConversationRegistry.register</name>
                <set-method>addListener</set-method>
                <type>org.exoplatform.platform.organization.integration.FirstLoginListener</type>
            </component-plugin>
        </external-component-plugins>
    </configuration>
  2. Edit WEB-INF/conf/configuration.xml to import the sync.xml file:

    
    <import>war:/conf/organization/sync.xml</import>

Some remarks:

Testing

After deploying your custom extension in eXo Platform, start the server. Next, log in as root and browse the URL: http://mycompany.com:8080/rest/management/orgsync (change the host and port if needed). You should receive the list of methods of the OrganizationIntegrationService.

If you enter the URL: http://mycompany.com:8080/rest/management/orgsync/syncAll, the synchronization will run for all users and groups.

Note

In the case of LDAP groups mapped into Platform, you noticed that parent groups, such as /acme/roles need to be created manually. If the OrganizationIntegration service is activated while the parent groups are not created yet, it may throw some exceptions at the startup, but it is not a problem.

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