2015-01-20 9:58 GMT+01:00 FOUCHET, Alexandre <
[email protected]>:

>    Hello,
>


Hello Alexandre,



>
>
> I have a question about some of the data I try to synchronize :
>
> I am synchronizing an ldap server with another ldap server. In lsc, I am
> using < ldapConnection> for both servers and <ldapDestinationService> for
> the tasks.
>
> The root of my problem is that my users in SRC ldap are not in the same
> place as on my DST ldap (their DN is different). For example :
>
> ·         on SRC ldap :
> “uid=fr.admin.un,dmdName=users,dmdName=portal,dmdName=applications,dc=ad,dc=cap,dc=applis,dc=fr”
>
> ·         on DST ldap :
> “uid=fr.admin.un,dmdName=users,dmdName=community,dmdName=portal,dmdName=applications,dc=ad,dc=cap,dc=applis,dc=fr”
>
>
>
> I can synchronize my users without any problem. But I need to modify
> attributes referencing those users (to update their full dn) and that is
> where my problem is. Those attributes I wish to update, are located inside
> a “groupOfUniqueNames” object.
>
> Here is one of the object I’m talking about
>
>
>
> Each of the “uniqueMember” is a full DN of a user. But as said previously,
> the full DN are different on SRC ldap and DST ldap. So I wish to update the
> value of each of those “uniqueMember” using javascript. I need to add
> “dmdName=community,” right after “dmdName=users,”.
>
> Here’s what I’ve tried.
>
>
>
>
>
>     <ldapDestinationService>
>
>         <name>ldap-dst-service-roles-com1</name>
>
>         <connection reference="ldap-dst-conn-com1" />
>
>
> <baseDn>dmdName=roles,dmdName=community,dmdName=portal,dmdName=applications,dc=ad,dc=cap,dc=applis,dc=fr</baseDn>
>
>                 <pivotAttributes>
>
>                         <string>cn</string>
>
>                 </pivotAttributes>
>
>                 <fetchedAttributes>
>
>                         <string>objectClass</string>
>
>                         <string>cn</string>
>
>                         <string>uniqueMember</string>
>
>                 </fetchedAttributes>
>
>
> <getAllFilter>(&amp;(objectClass=groupOfUniqueNames))</getAllFilter>
>
>
> <getOneFilter>(&amp;(objectClass=groupOfUniqueNames)(cn={cn}))</getOneFilter>
>
>       </ldapDestinationService>
>
>       <propertiesBasedSyncOptions>
>
>
> <mainIdentifier>"cn="+srcBean.getDatasetFirstValueById("cn")+",dmdName=roles,dmdName=community,dmdName=portal,dmdName=applications,dc=ad,dc=cap,dc=applis,dc=fr
> "</mainIdentifier>
>
>         <defaultDelimiter>;</defaultDelimiter>
>
>         <defaultPolicy>FORCE</defaultPolicy>
>
>         <conditions>
>
>                 <create>true</create>
>
>                 <update>true</update>
>
>                 <delete>true</delete>
>
>                 <changeId>false</changeId>
>
>         </conditions>
>
>         <dataset>
>
>                 <name>uniqueMember</name>
>
>                 <policy>FORCE</policy>
>
>                 <forceValues>
>
>                         <string><![CDATA[js:
>
>                                var userDNToModify =
> srcBean.getDatasetFirstValueById("uniqueMember");
>
>                                 if (userDNToModify != ""){
>
>                                         var addFromPosition =
> userDNToModify.indexOf("dmdName=secureportal,");
>
>                                         var stringToAdd =
> "dmdName=community,";
>
>                                         var modifiedDNBegin =
> userDNToModify.substring(0,addFromPosition);
>
>                                         var modifiedDNEnd =
> userDNToModify.substring(userDNToModify.indexOf("dmdName=secureportal"));
>
>                                         var dstDN =
> modifiedDNBegin.concat(stringToAdd);
>
>                                         dstDN.concat(modifiedDNEnd);
>
>                                 }        ]]>
>
>                         </string>
>
>                 </forceValues>
>
>         </dataset>
>
>       </propertiesBasedSyncOptions>
>
>     </task>
>
>
>
> Here is my question :
>
> Can I use anything else than « getDatasetFirstValueById” ? Because with
> this, I only work with the first occurrence of “uniqueMember”, the rest is
> ignored.
>
> Where could I find any documentation for what methods I can use with
> srcBean ?
>



Here: http://lsc-project.org/javadoc/2.0-SNAPSHOT/org/lsc/beans/LscBean.html

You need to use getDatasetValuesById to get all values of an attribute.



See also this tutorial to synchronize groups:
http://lsc-project.org/wiki/documentation/tutorial/synchronizegroups



Clément.
_______________________________________________________________
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