2018-02-01 19:17 GMT+01:00 Lior Dotan <[email protected]>:
> On Thu, Feb 1, 2018 at 8:02 PM, Clément OUDOT <[email protected]> wrote:
>> 2018-02-01 18:15 GMT+01:00 Lior Dotan <[email protected]>:
>>> On Thu, Feb 1, 2018 at 6:57 PM, Clément OUDOT <[email protected]> wrote:
>>>> Hello,
>>>>
>>>> if this can help, I have a small script that I use in LSC to convert
>>>> group of groups from AD to a flatten group in OpenLDAP.
>>>>
>>> Thanks, this looks promising.
>>>
>>> I've plaved the js function right above the other js code in the
>>> dataset section, is that correct?
>>
>>
>> No, put it in a js file that you will include at the end of the task.
>> See 
>> https://lsc-project.org/documentation/latest/scripting/start#external_files
>>
>>
>>
> I've moved the js function to a separate file but I still get this error:
>            js:
>                var membersSrcDn = srcBean.getDatasetValuesById("member");
>                var membersDstDn = new java.util.ArrayList();
>                for  (var i=0; i<membersSrcDn.size(); i++) {
>                        var memberSrcDn = membersSrcDn.get(i);
>                        membersDstDn.addAll( getMembersDn(srcLdap,
> ldap, memberSrcDn) );
>                }
>                if ( membersDstDn.size() == 0) {
>                        membersDstDn.add("cn=empty");
>                }
>                membersDstDn
>
>                                          on
> id=CN=GroupA,OU=ad-testing,DC=ad-testing,DC=test,DC=io
> Reason: javax.script.ScriptException: ReferenceError: "ldap" is not
> defined in nashorn:mozilla_compat.js at line number 67
> Feb 01 18:15:21 - ERROR - Error while synchronizing ID {cn=[Bass
> Players]}: org.lsc.exception.LscServiceException:
> javax.script.ScriptException: ReferenceError: "ldap" is not defined in
> nashorn:mozilla_compat.js at line number 67


ldap is the LDAP connection object linked to the destination service.
It should be defined if you use an ldapDestinationService. It can be
used with scriptable JNDI services:
https://lsc-project.org/javadoc/2.1-SNAPSHOT/org/lsc/jndi/ScriptableJndiServices.html

Clément.
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to