To activate the service, you can configure it in your custom extension. To tidy up, the configuration should be written in a separated file.
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>
Edit WEB-INF/conf/configuration.xml
to import the sync.xml
file:
<import>war:/conf/organization/sync.xml</import>
Some remarks:
The synchronizeGroups
parameter is set to true.
This enables group synchronization at the server startup.
The FirstLoginListener
is configured.
This makes sure that an LDAP user is enabled to access the Intranet page automatically when he logs in eXo Platform for the first time.
The Job Scheduler is not configured yet. You will configure it later.
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.
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.