cancel
Showing results for 
Search instead for 
Did you mean: 

Importing Multiple OU trees from Active Directory

ctrl
Champ in-the-making
Champ in-the-making
Hi any one and everyone

is anyone aware of a way in which multiple ou trees can be imported or query from AD (Active Directory) in to Alfresco? in the sync context xml i saw something in there that says to repeat the export bean and refernce it in the sync properties file pointing at the second tree i would like to import. Tried that it didnt really work for me! does any one have any ideas?

Thanks
Ctrl.
1 REPLY 1

tommorris
Champ in-the-making
Champ in-the-making
This is how we import more than one sub-tree from LDAP.

Edit this file:
C:\Alfresco\tomcat\shared\classes\alfresco\extension\ldap-synchronisation-context.xml

1. Copy the entire section of the 'ldapPeopleExportSource' bean and add a unique suffice to the id (in this example, '2').
Also, change the searchBase substitution-variable to the path of the second tree you want to import.
The 'value' element looks like (i'm using an xpath-like syntax for brevity here):
beans/
   bean[@id='ldapPeopleExportSource2']/
      property[@name='searchBase']/
         value
            = ${ldap.synchronisation.personSearchBase2}
This needs changes to the file 'ldap-synchronisation.properties'. Add another variable called 'ldap.synchronisation.personSearchBase2'

2. Copy the entire section of the 'ldapPeopleImport' bean and add the unique suffice to the id.
Then make sure to properly reference the last bean (ldapPeopleExportSource2) we created.
beans/
   bean[@id='ldapPeopleImport2']/
      property[@name='exportSource']/
         ref[@bean='ldapPeopleExportSource2']
3. Copy the entire section of the 'ldapPeopleTrigger' bean and add the unique suffice to the id.
Then make sure to properly reference the last bean (ldapPeopleImport2) we created.
Because another bean is being declared within this, don't forget to give that a unique name too.
beans/
   bean[@id='ldapPeopleTrigger2']/
      property[@name='jobDetail']/
         bean[@id='dapPeopleJobDetail2']/
            property[@name='jobDataAsMap']/
               map/
                  entry[@key='bean']/
                     ref[@bean='dapPeopleImport2']
In this section don't forget to create another cron expression just for this bean.
(You may get a HibernateOptimisticLockingFailureException if you use the same cron expression…)
beans/
   bean[@id='ldapPeopleTrigger2']/
      property[@name='cronExpression']/
         value
            = ${ldap.synchronisation.import.person2.cron}
This needs changes to the file 'ldap-synchronisation.properties'. Add another variable called 'ldap.synchronisation.import.person.cron2'

Hope this helps someone.

http://www.ixxus.com
Alfresco Partner