Le 23/03/2016 17:46, Patrice M. a écrit :
Thank you very much! I misread a line.
Now I'm coming with another question...
I have to synchronize a complete DIT from source LDAP Directory
(dc=koinobori,dc=fr) to an ADLDS instance
(cn=users,ou=koinobori,c=fr), and face strange behaviour.
*The idea*: I want to permute the DIT branches names, using the
entryDN of the dcObjects from OpenLDAP, using the given code:
<mainIdentifier> var dn; var replace; var pattern; var regmask; dn =
srcBean.getDatasetFirstValueById("entryDN"); pattern =
"dc=koinobori,dc=fr"; replace = "cn=users,ou=koinobori,c=fr"; regmask
= "gi"; regex = new RegExp(pattern, regmask); dn = dn.replace(regex,
replace); dn </mainIdentifier>
But, I'm stuck with the given error: ERR_04202 A value is missing on
some RDN
With debugger, the DN appears to become "dn:
org.mozilla.javascript.NativeJavaObject@4abf54ca"
Well...
Since I have a multilevel dcObjects structure, I cannot simply get the
"dc" attribute value and concatenate strings.
Did someone out there already faced the same kind of problem?
Thanks a lot by advance
You should maybe put the result of replace in another var, like var
dstDn = dn.replace(...);
And looking at replace syntax, I would rather directly write it like that:
var dstDn = dn.replace(/dc=koinobori,dc=fr/gi,
'cn=users,ou=koinobori,c=fr');
See
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
--
Clément OUDOT
Consultant en logiciels libres, Expert infrastructure et sécurité
Savoir-faire Linux
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users