Le 20/12/2016 à 11:19, Clément OUDOT a écrit :
> 2016-12-19 13:24 GMT+01:00 [email protected] <[email protected]>:
>> Le 19/10/2016 à 10:35, Clément OUDOT a écrit :
>>> <create>
>>>     <![CDATA[
>>>         var result = true;
>>>
>>>         var dn = srcBean.getDatasetFirstValueById("entryDN");
>>>         var regexp = /ou=projects/i;
>>>         if ( dn.match(regexp) ) { result = false; }
>>>
>>>         result;
>>>     ]]>
>>> </create>
>>>
>>>
>>> Be sure to add entryDN in source fetchedAttributes to be able to use its
>>> value in the test.
>>
>> Hi Clément,
>>
>> How would you do that in <delete> ?
>>
>> For example let's say I want to exclude the baseDn of the clean phase ?
>>
>> I tried various thing like :
>>
>>         var result = true;
>>
>>         var dn = dstBean.getDatasetFirstValueById("dn"); // entryDN =
>> same result.
>>         if ( dn == "ou=projects,dc=..." ) { result = false; }
>>
>>         result;
>>
>> Of course I add the attribute in fetchedAttributes of the *destination*.
>>
>> I got "Could not retrieve the object xxx from the directory" for every
>> entry in the destination directory of the baseDn, including the baseDn
>> entry itself.
> 
> 
> Very often the base DN has a different objectClass than the children
> entry, so the easiest is to adapt the cleanFilter in the source. For
> example to exclude organizationalUnit objects from clean phase:
> 
> <cleanFilter><![CDATA[(&(!(objectClass=organizationalUnit))(cn={cn}))]]></cleanFilter>
> 

Great ! That is a good idea indeed.

Luckily and like you said, objects under the baseDN have a specific
class that I can mention - in my case I have updated getAllFilter with
it (the source is SQL  / destination is LDAP based).

Thanks,

_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to