July 30, 2023

tLDAPOutput – Docs for ESB 7.x

tLDAPOutput

Executes an LDAP query based on the given filter and corresponding to the schema
definition. Then it passes on the field list to the next component via a Row > Main link.

tLDAPOutput Standard properties

These properties are used to configure tLDAPOutput running in the Standard Job framework.

The Standard
tLDAPOutput component belongs to the Databases family.

The component in this framework is available in all Talend
products
.

Basic settings

Property type

Either Built-in or
Repository
.

 

Built-in: No property data stored
centrally.

 

Repository: Select the repository
file in which the properties are stored. The fields that follow are
completed automatically using the data retrieved.

tLDAPOutput_1.png

Click this icon to open a database connection wizard and store the
database connection parameters you set in the component Basic settings view.

For more information about setting up and storing database
connection parameters, see
Talend Studio User Guide
.

Use an existing connection

Select this check box and in the Component List click the relevant connection component to
reuse the connection details you already defined.

Note that when a Job contains the parent Job and the child Job,
Component List presents only the
connection components in the same Job level.

Host

LDAP Directory server IP address.

Port

Listening port number of server.

Base DN

Path to user’s authorized tree leaf.

Protocol

Select the protocol type on the list.

LDAP : no encryption is used

LDAPS: secured LDAP. When this
option is chosen, the Advanced CA
check box appears. Once selected, the advanced mode allows you to
specify the directory and the keystore password of the certificate
file for storing a specific CA. However, you can still deactivate
this certificate validation by selecting the Trust all certs check box.

TLS: certificate is used When this
option is chosen, the Advanced CA
check box appears and is used the same way as that of the LDAPS type.

User and Password

Fill in the User and Password as required by the
directory

Note that the login must match the LDAP syntax requirement to be
valid. e.g.: “cn=Directory Manager”.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Multi valued field separator

Type in the value separator in multi-value fields.

Alias dereferencing

Select the option on the list. Never improves search performance if you are sure
that no aliases is to be dereferenced. By default, Always is to be used:

Always: Always dereference
aliases

Never: Never dereferences
aliases.

Searching:Dereferences aliases only
after name resolution.

Finding: Dereferences aliases only
during name resolution

Referral handling

Select the option on the list:

Ignore: does not handle request
redirections

Follow:does handle request
redirections

Insert mode

Select the editing mode on the list:

Add: add a value in a multi-value
attribute,

Insert: insert new data,

Update: updates the existing
data,

Delete: remove the selected data
from the directory,

Insert or update: Insert a new record. If
the record with the given reference already exists, an update would be made.

Warning:

When Update is selected, you
must go to the Advanced
settings
view, and select the Use Attribute Options (for update
mode)
check box to show the Attribute Options table. Then, select the
attribute to update under the Attribute
name
part and the choose Replace under the Option part.

DN Column Name

Select in the list the type of the LDAP input entity used.

Schema and Edit
schema

A schema is a row description. It defines the number of fields
(columns) to be processed and passed on to the next component. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

 

Built-In: You create and store the schema locally for this component
only.

 

Repository: You have already created the schema and stored it in the
Repository. You can reuse it in various projects and Job designs.

When the schema to be reused has default values that are
integers or functions, ensure that these default values are not enclosed within
quotation marks. If they are, you must remove the quotation marks manually.

You can find more details about how to
verify default values in retrieved schema in Talend Help Center (https://help.talend.com).

 

Click Edit
schema
to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this
    option to view the schema only.

  • Change to built-in property:
    choose this option to change the schema to Built-in for local changes.

  • Update repository connection:
    choose this option to change the schema stored in the repository and decide whether
    to propagate the changes to all the Jobs upon completion. If you just want to
    propagate the changes to the current Job, you can select No upon completion and choose this schema metadata
    again in the Repository Content
    window.

Die on error

This check box is selected by default. Clear the check box to skip
the row on error and complete the process for error-free rows. If
needed, you can retrieve the rows on error via a Row > Reject link.

Advanced settings

Use Attribute Options (for update mode)

Select this check box to choose the desired attribute (including
dn, dc, ou, objectClass, mail and uid) and the corresponding
operation (including Add, Replace, Remove Attribute and Remove
Value).

tStatCatcher Statistics

Select this check box to gather the job processing metadata at a
job level as well as at each component level.

Global Variables

Global Variables 

NB_LINE: the number of rows processed. This is an After
variable and it returns an integer.

NB_LINE_REJECTED: the number of rows rejected. This is an
After variable and it returns an integer.

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see
Talend Studio

User Guide.

Usage

Usage rule

This component covers all possible LDAP queries.

Note: Press Ctrl + Space bar to
access the global variable list, including the GetResultName variable to retrieve the relevant DN
Base automatically. This component allows you to carry out actions
on a table or on the data of a table in an database. It also allows
you to create a reject flow using a Row >
Rejects
link to filter data in error. For an example
of tMySqlOutput in use, see Retrieving data in error with a Reject link.

Editing data in a LDAP directory

Note:

All of the database output components have the Parallelize option in their Advanced
settings
tab. This option allows you to improve data processing
performances by handling several data flows simultaneously. For more information, see
Talend Studio User Guide
.

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 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.

    tLDAPOutput_2.png

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 Displaying LDAP directory’s filtered content.

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

  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.
    tLDAPOutput_4.png

  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.

    tLDAPOutput_5.png

  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.
    tLDAPOutput_6.png

Executing the Job

  1. Press Ctrl+S to save the Job.
  2. Press F6 to run the Job.

    tLDAPOutput_7.png


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x