Hello Raphaël,

Inside my lsc.xml i have a function call like this :
 <mainIdentifier>js:mainIdentifierUsersInit()</mainIdentifier>

And inside my js file my function use something like :
 var dn = srcLdap.search("ou=groups", "(seeAlso=" + base + ")").get(0);

Now when i try to pass srcLdap as argument inside lsc.xml like this :
 <mainIdentifier>js:mainIdentifierUsersInit(srcLdap)</mainIdentifier>

And change function initialisation like this :
function mainIdentifierUsersInit(srcLdap)
{
...
}

I have this error :
Nov 04 16:32:14 - ERROR - Fail to compute expression: 
mainIdentifierUsersInit(srcLdap) on id=uid=xxxxxx,dc=xxxxxxxx
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

Do i have made an error ?

Thanks,

Le 04/11/14 16:11, Raphaël Ouazana-Sustowski  <[email protected]> a 
écrit :
> 
> Hi,
> 
> Le 2014-11-04 11:40, POISSON Frédéric a écrit :
> >Hello,
> >
> >I'm using LSC version 2.1.1 with an external JavaScript file with
> >scriptInclude markup. I have written a function that i used before
> >inside lsc.xml file, but now with the external JavaScript file if i
> >try/catch error when i use srcLdap i have this following error :
> >
> >Error detected : ReferenceError: "srcLdap" is not defined.
> >
> >Is it possible to know if srcLdap from
> >org.lsc.jndi.ScriptableJndiServices is accessible from external
> >JavaScript files ?
> 
> This is a bit special. If I remember correctly: if your expression calling 
> the external script contains a reference to srcLdap (or even only the string 
> srcLdap), srcLdap should be available in your external script.
> Maybe something we could improve...
> 
> Anyway you can pass srcLdap as an argument to your JavaScript functions.
> 
> Regards,
> Raphaël Ouazana.
> 
--

Frederic Poisson
_______________________________________________________________
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