Hi everybody,
I had a problem using the mainIdentifier of LSC.
The problem is that the :
<mainIdentifier>"uid="+ srcBean.getDatasetFirstValueById("uid")
+",ou=people,dc=my-domain,dc=com"</mainIdentifier
don't succeed in finding the uid attribute (or any fetchedAttribute).
While the attributes seemed to be correctly loaded in the ldap
(OpenLDAP), I thought that the problem was due to some javascript or
configuration problem, but after some debugging, I found out that the
attribute values were never transmitted to the Rhino engine.
Indeed, the values were correctly read from the source, but there was a
problem of transmission in the code.
This problem only occurs for a <ldapSourceService>, and not for a
<asyncLdapSourceService> component. (maybe this is a regression ?)
Here is an example illustrating my problem:
<ldapSourceService>
<name>ldap-src-service</name>
<connection reference="ldap-src-conn" />
<baseDn>ou=people,dc=my-domain,dc=com</baseDn>
<pivotAttributes>
<string>myUniqueId</string>
</pivotAttributes>
<fetchedAttributes>
<string>cn</string>
<string>sn</string>
<string>objectClass</string>
<string>uid</string>
<string>myUniqueId</string>
</fetchedAttributes>
<getAllFilter>(objectClass=inetorgperson)</getAllFilter>
<getOneFilter>(&(objectClass=inetorgperson)(myUniqueId={myUniqueId}))</getOneFilter>
</ldapSourceService>
I think the problem is in:
src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java
I have built a patch to show more precisely were this is. I don't
garantee that it is optimal or even exhaustive, but it seemed to work
for me.
If somebody could give a look at it and even test it...
Thank you in advance!
David
*** AbstractSimpleJndiService.java.old 2012-04-23 18:09:19.529592903 +0200
--- AbstractSimpleJndiService.java 2012-04-23 18:09:09.775592465 +0200
***************
*** 203,209 ****
NamingEnumeration<?> ne = sr.getAttributes().getAll();
while (ne.hasMore()) {
Attribute attr = (Attribute) ne.next();
! beanToFill.datasets().put(attr.getID(), SetUtils.attributeToSet(attr));
}
return beanToFill;
}
--- 203,211 ----
NamingEnumeration<?> ne = sr.getAttributes().getAll();
while (ne.hasMore()) {
Attribute attr = (Attribute) ne.next();
! LscDatasets lds = beanToFill.datasets();
! lds.put(attr.getID(), SetUtils.attributeToSet(attr));
! beanToFill.setDatasets(lds);
}
return beanToFill;
}
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users