Scenario: Editing data in a LDAP directory - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

The following scenario describes a Job that reads an LDAP directory, updates the email of a selected entry and displays the output before writing the LDAP directory. To keep it simple, no alias dereferencing nor referral handling is performed. This scenario is based on Scenario: Displaying LDAP directory's filtered content. The result returned was a single entry, related to an organisational person, whom email is to be updated.

The output shows the following fields: dn, uid and mail as defined in the Job.

Dropping the components

  1. Drop the tLDAPInput, tLDAPOutput, tMap and tLogRow components from the Palette to the design workspace.

  2. Link tLDAPInput to tMap using the Row > Main connection.

  3. Link tMap to tLogRow using the Row > Main connection.

  4. Link tLogRow to tLDAPOutput using the Row > Main connection.

Configuring the components

  1. In the tLDAPInput Component view, set the connection details to the LDAP directory server as well as the filter as described in Scenario: Displaying LDAP directory's filtered content.

    Change the schema to make it simpler, by removing the unused fields: dc, ou, objectclass.

  2. Then open the mapper to set the edit to be carried out.

    Drag & drop the uid column from the input table to the output as no change is required on this column.

  3. In the Expression field of the dn column (output), fill in with the exact expression expected by the LDAP server to reach the target tree leaf and allow directory writing only if you haven't set it already in the Base DN field of the tLDAPOutput component.

  4. In this use case, the GetResultName global variable is used to retrieve this path automatically. Press Ctrl+Space bar to access the variable list and select tLDAPInput_1_RESULT_NAME.

  5. In the mail column's expression field, type in the new email that will overwrite the current data in the LDAP directory. In this example, we change to Pierre.Dupont@talend.com.

    Click OK to validate the changes.

  6. Then select the tLDAPOutput component to set the directory writing properties.

  7. Set the Port and Host details manually if they aren't stored in the Repository.

  8. In Base DN field, set the highest tree leaf you have the rights to access. If you have not set previously the exact and full path of the target DN you want to access, then fill in it here. In this use case, the full DN is provided by the dn output from the tMap component, therefore only the highest accessible leaf is given: o=directoryRoot.

  9. Select the relevant protocol to be used: LDAP for this example.

    Fill in the User and Password as expected by the LDAP directory.

    Fill in Multi-valued field separator with a comma as some fields may hold more than one value, separated by a comma.

  10. Use the default setting of Alias Dereferencing and Referral Handling fields, respectively Always and Ignore.

    The Insert mode for this use case is Update (the email address).

    The schema was provided by the previous component through the propagation operation.

  11. In the Advanced settings view, select the Use Attribute Options (for update mode) check box to show the Attribute Options table.

    Select the attribute mail under the Attribute Name part and the choose Replace under the Option part.

Executing the Job

  1. Press Ctrl+S to save the Job.

  2. Press F6 to run the Job.