Issue #734 has been updated by Frédéric POISSON.
I'm not sure to understand your workaround, but i do that inside my lsc.xml :
<pre>
<dataset>
<name>description</name>
<policy>FORCE</policy>
<forceValues>
<string>js:descriptionDataset(srcLdap);//srcLdap</string>
</forceValues>
</dataset>
</pre>
and my function is like this :
<pre>
function descriptionDataset(srcLdap)
{
var dn = "" + srcBean.getMainIdentifier().slice(0);
var base = dn.replace(/[^,]*,\s*/i,'');
var main = null;
try {
main = "CN="
+ srcBean.getDatasetFirstValueById("cn").trim()
+ ","
+ srcLdap.attribute(srcLdap.search("ou=lsc",
"(seeAlso=" + base + ")").get(0), "description" ).get(0);
java.lang.System.out.println("description first: " + main);
} catch(e) {
java.lang.System.out.println("Error: " + e);
main = srcBean.getMainIdentifier();
}
java.lang.System.out.println("description last: " + main);
return main;
}
</pre>
I have now that error :
<pre>
Nov 19 16:37:38 - ERROR - Fail to compute expression:
descriptionDataset(srcLdap);//srcLdap on
id=uid=elpida.duplaquet,ou=PeopleHR,dc=example,dc=com
Reason: javax.script.ScriptException:
sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "srcLdap" is not
defined. (<Unknown source>#3) in <Unknown source> at line number 3
Nov 19 16:37:38 - ERROR - Error while synchronizing ID {uid=elpida.duplaquet}:
org.lsc.exception.LscServiceException: javax.script.ScriptException:
sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "srcLdap" is not
defined. (<Unknown source>#3) in <Unknown source> at line number 3
</pre>
Do you see any changes ?
----------------------------------------
Bug #734: External Javascript file do not load srcLdap
http://tools.lsc-project.org/issues/734
Author: Frédéric POISSON
Status: Assigned
Priority: Normal
Assigned to: Raphaël Ouazana
Category: Core
Target version: 2.1.2
Problem in version: 2.1.1
Hello,
While i'm trying to run LSC with an external JavaScript file defined with
scriptInclude, i use a function with srcLdap object. But i have a
<pre>"srcLdap" is not defined.</pre> error and my JavaScript code do not run
correctly. If i try to give the srcLdap as an argument of my function i have
the error <pre>ReferenceError: "srcLdap" is not defined.</pre>, but if i put
the code of the function inside lsc.xml file and the dataset, all is running
fine.
Could you tell me if srcLdap and ldap from org.lsc.jndi.ScriptableJndiServices
are available with LSC 2.1.1 ? And how to use them ?
Thanks,
Regards
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://tools.lsc-project.org/my/account
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-dev mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-dev