Le 12/07/2010 19:02, [email protected] a écrit :
Hi Jonathan,
Hopefully one last question.
I am now trying to sync up the manager attribute based upon CN of the
source dir. I am trying this:
lsc.syncoptions.MySyncTask.manager.force_value =ldap.search("","(cn=" +
srcBean.getAttributeValueById("manager") + ")").get(0)
and I get an error like this:
Jul 12 12:47:45 - ERROR - Error while synchronizing ID
{mail=john_...@mydomain.
com}: org.mozilla.javascript.WrappedException: Wrapped
java.lang.IndexOutOfBound
sException: Index: 0, Size: 0 (<cmd>#1)
Do I need to write some kind of subroutine? AD requires the full DN to
enter as manager attribute, but since directory structures are both
completely different, trying to figure out how to match manager similar to
ldap.search (though I never got the latter to work)...
This error indicates that you're trying to read a non-existent value, so
I presume that the search didn't return any results.
This looks likely since you say your manager attribute in the source is
a DN. Assuming it's "cn=joe,cn=users,dc=myplace,dc=com" then your
syncoption is effectively doing a search for
"cn=cn=joe,cn=users,dc=myplace,dc=com" which is obviously not going to work.
You'll see in the documentation below that there are other methods in
the ldap object, which will help you. In this case, I think you need to
read the "cn" attribute from your "manager" DN in the source (look at
ldap.attribute function) then use that to do the ldap.search you're
trying to do.
Also wondering if there is more detailed documentation on ldap.search
syntax....
Indeed, there is the JavaDoc from all methods you can use from
JavaScript here:
http://lsc-project.org/javadoc/1.2-SNAPSHOT/index.html?org/lsc/jndi/ScriptableJndiServices.html
Hope this helps,
Jonathan
Thanks!!!!
Jonathan Clarke<[email protected]>
07/12/2010 11:10 AM
To
<[email protected]>
cc
<[email protected]>
Subject
Re: [lsc-users] How to map attributes ldap2ldap
On Mon, 12 Jul 2010 10:56:55 -0400, [email protected] wrote:
Hello All,
After a nice victory trying to sync directories, I am now trying to
figure
out how to map an attribute from the source to a different attribute in
the destination. I took a look at sql-map-config, but that seems to
apply
only to sql db.
This is what syncoptions are for. See the documentation at
http://lsc-project.org/wiki/documentation/1.2/configuration/syncoptions.
You'll also find some examples in the distribution, under
etc/lsc.properties-sample.
A simple example is writing the "cn" attribute as "SURNAME, Givenname":
lsc.syncoptions.MyTaskName.cn.force_value =
srcBean.getAttributeValueById("sn").toUpperCase() + ", " +
srcBean.getAttributeValueById("givenName")
(this assumes "sn" and "givenName" are read from the source directory)
This is one of the strengths of LSC. Each syncoption value can take a
JavaScript expression, enabling you to manipulate data virtually any way
you like!
Thanks much to this very helpful community...
It's a pleasure to help. Thanks for your patience in getting into LSC, and
feel free to send us feedback on how it could be easier!
Regards,
Jonathan
--
--------------------------------------------------------------
Jonathan Clarke - [email protected]
--------------------------------------------------------------
Ldap Synchronization Connector (LSC) - http://lsc-project.org
--------------------------------------------------------------
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users