Liam,
Please keep replies on the list.
On 13 juil. 2010, at 16:41, [email protected] wrote:
Hi Jonathan,
Wondering if you might be able to provide a quick example of
ldap.atrribute --I can't seem to get it to return anything
Here is one iteration of what I tried:
lsc.syncoptions.MySyncTask.manager.force_value
=ldap.attribute("",("cn")(ldap.search
("",srcBean.getAttributeValueById("manager")
.get(0))
This should probably be:
lsc.syncoptions.MySyncTask.manager.force_value
=ldap.search("", "cn=" + ldap.attribute(srcBean.getAttributeValueById
("manager"), "cn")).get(0)
Hope this helps,
Jonathan
Liam Curtis
Global Unix/WAN Administrator
The Siemon Company
phone: 860-945-5831
email: [email protected]
"Siemon makes every attempt to ensure that the content of materials
presented or communicated to you is accurate. The content herein is
for
informational purpose only and Siemon assumes no responsibility or
obligation for actions resulting from this content unless otherwise
agreed
to in writing and signed by both parties."
Jonathan Clarke <[email protected]>
07/12/2010 01:31 PM
To
[email protected]
cc
[email protected]
Subject
Re: [lsc-users] How to map attributes ldap2ldap
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