Issue #734 has been updated by Frédéric POISSON.

I see the problem, the cause is due to base js variable which on mainIdentifier 
could be either the source or the destination. And so searching my roleOccupant 
attribute is not available on destination. I added an "if" for checking that 
case.

Here is now my mainIdentifier final function :
<pre>
function mainIdentifierInit()
{
        var dn   = "" + srcBean.getMainIdentifier().slice(0);
        var base = dn.replace(/[^,]*,\s*/i,'');
        var main = srcBean.getMainIdentifier();
        if ( base.match(/dc=example,dc=com/) )
        {
                try {
                        main = "uid=" + 
srcBean.getDatasetFirstValueById("uid").trim() + ","
                        + srcLdap.attribute(srcLdap.search("ou=lsc", 
"(seeAlso=" + base + ")").get(0), "roleOccupant" ).get(0);
                } catch(e) {
                        //java.lang.System.out.println("Fonction 
mainIdentifierInit() error: " + e);
                }
        }
        return main;
}
</pre>

With this lsc.xml configuration :
<pre> <mainIdentifier>js:mainIdentifierInit();//srcLdap.</mainIdentifier> </pre>

So now all is ok for me, but is it a "normal" behavior to load a class only if 
it present as a comment inside a js call ? 
----------------------------------------
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

Reply via email to