One Star

tLDAPInput dynamic filter or lookup in ldap

Hi,
I want to load organizationalUnit from a database (flat store) into hierarchical ou in a LDAP server.
Each node (in db) contains the name, code and parent code of the ou.
I used tOracleInput whith the sql query to get all nodes. I organized the query to get the tree (parent first, then children).
To store node A, I need to know where is located the parent. So I need the parent's dn to build the dn of node A.
I tried to use the tLDAPInput to get the dn of the parent ou as a lookup of my tMap. But the filter seems to be static?
1. Is there a way to do a lookup from the Oracle's row using the parent's ou ?
2. Can I use in a tJava, the jndi connection of tLDAPInput to execute the query ?
ThX fo your help
6 REPLIES
One Star

Re: tLDAPInput dynamic filter or lookup in ldap

Why is it not possible to use an Iterate link between a tOracleInput and tLDAPInput ?
It could solve my pb of lookup reference in a ldap directory.
ThX
Community Manager

Re: tLDAPInput dynamic filter or lookup in ldap

Hello
Why is it not possible to use an Iterate link between a tOracleInput and tLDAPInput ?

Did you try
tOracleInput--main-->tLogRow
|
iterate
|
tLDAPInput
Can you upload a screenshot of your job?
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tLDAPInput dynamic filter or lookup in ldap

The point is, I can't set any link as input of tLDAPInput
One Star

Re: tLDAPInput dynamic filter or lookup in ldap

Every time I add tLDAPInput, I got an error :
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error, insert "Finally" to complete TryStatement
Syntax error, insert "}" to complete Block
at talenddemosjava.test_0_1.test.tLDAPInput_1Process(test.java:207)
at talenddemosjava.test_0_1.test.runJobInTOS(test.java:332)
at talenddemosjava.test_0_1.test.main(test.java:248)
One Star

Re: tLDAPInput dynamic filter or lookup in ldap

Ooops.
Sorry, I am new on TOS and I made mistakes. The above errors disappear if I link it to aonther component, a tLogRow for instance.
Still working on getting an LDAP request on Iterate.
One Star

Re: tLDAPInput dynamic filter or lookup in ldap

I've succeed in my Job ! But I am not sure, it's state of the art.
As I want to do LDAP sub query for each row found in db in order to fetch parent DN, I used a tJavaFlex with the source code of tLDAPInput.
Begin: contains JNDI connection initialization
Main: sub query getting the DN of existing OU
End: close the JNDI connection
This approach has a main default : reuse is not easy.
- Do I have missed a key feature in TOS ?
- How will you implement fetch or check complementary information in another referential ?
Say you have a db row with information: name|address|zipcode|jobTitleCode. And you have referential contained in LDAP Directory: zipcode associated cities, job title code with job title description. The goal is to load a person in LDAP branch: name|address|zipcode|city|jobTitleDescription. And if JobTitleDescription does not exist, reject the db row
TOS is still a great product.
BTW: as a senior developper in Java, do you think write or modify existing LDAP component is easy, heavy ou hard ?