Transcript Tivoli Directory Integrator
IBM Tivoli Directory Integrator
Tivoli Directory Integrator
Exercise 2 – Mapping to inetOrgPerson Eddie Hartman
2005.04.12
IBM Tivoli Directory Integrator
Exercise 01: CSV to XML
1.
2.
Create AL (CSVtoXML) Add Connector to read CSV
(configure, discover & map)
NOTE: Semi-colon separator (;) XML Document FileSystem Connector
w/ CSV Parser
FileSystem Connector
w/ XML Parser
CSV File 3.
4.
Add Connector to write XML Run AL and view results
2
IBM Tivoli Directory Integrator
Kernel/component architecture
The kernel provides common, generic functionality for all Connectors. This is where all customization is carried out (like Attribute Maps and scripting).
This is the
AssemblyLine Connector
.
XML Document CSV File
Each Connector has its own
Connector Interface
that is built to handle a specific protocol, API, transport or format. These are interchangeable, making it fast and easy to point your AssemblyLine at different data sources.
3
IBM Tivoli Directory Integrator
The Entry object
The
Entry
object is the data carrier in an AssemblyLine.
The primary Entry is the
Work Entry
which is used to move data down the flow.
This object is accessed via the pre-registered script variable called
"work".
XML Document CSV File Flat Schema: Entries can hold Attributes.
Attributes can have values.
Attribute_1 value_a value_b Attribute_2 value_c ...
Attribute_n Each Connector has its own local
Java bucket
(called its
Conn Entry
) which is used as a local cache for reads & writes, and which available through the script variable
"conn"
.
4
IBM Tivoli Directory Integrator
AL Lifecycle
- Phase One: Initialization
All Connectors bind to their data sources.
CSV File
5
IBM Tivoli Directory Integrator
AL Lifecycle
- Phase Two: Cycling (Read)
AL automation powers the first Connector to read from the input file, passing the byte stream through the CSV Parser.
XML Document CSV File
The CSV Parser turns the byte stream into a series of Attributes, each with a single string value.
Attributes are put in the
Conn Entry
.
6
IBM Tivoli Directory Integrator
AL Lifecycle
- Phase Two: Cycling (Input Map)
The Input Map of our first Connector specifies which Attributes are to be created in the
Work Entry
.
XML Document CSV File
The Input Map also specifies how the values of these new
Work Entry
Attributes are copied or computed based on those stored in the
Conn Entry
.
7
IBM Tivoli Directory Integrator
AL Lifecycle
- Phase Two: Cycling (Output Map)
The
Work Entry
is passed to our output Connector, where the Attributes to write are specified in its Output Map.
XML Document CSV File
Attribute values are now copied/computed the opposite direction: from the
Work Entry
to the
Conn Entry
.
8
IBM Tivoli Directory Integrator
AL Lifecycle
- Phase Two: Cycling (Write)
The output Connector performs the write operation using the Attributes in its
Conn Entry
.
XML Document CSV File
9
IBM Tivoli Directory Integrator
AL Lifecycle
- Phase Two: Cycling (Repeat...)
When the end of the AssemblyLine is reached, AL automation empties the
Work Entry
and passes control back to the start again.
XML Document CSV File
Cycling repeats as long as there is data to process, or until the AL is terminated by command or aborts due to unhandled errors.
10
IBM Tivoli Directory Integrator
AL Lifecycle
- Phase Three: Shutdown
When the cycle phase stops, the Connectors close their connections.
XML Document CSV File
11
IBM Tivoli Directory Integrator
Exercise 01: CSV to XML
Address City Department Status FirstName LastName State Title EmployeeNumber Zip XML Document
Simple mapping
CSV File Address City Department Status FirstName LastName State Title EmployeeNumber Zip
12
IBM Tivoli Directory Integrator
Exercise 02: CSV to XML (inetOrgPerson)
Address City Department Status FirstName LastName State Title EmployeeNumber Zip
Simple mapping
CSV File XML Document l street ou employeeType givenName sn st title uid postalCode cn mail objectClass dn
Advanced mapping 13
IBM Tivoli Directory Integrator
Exercise 02: CSV to XML (Computed values)
cn FirstName + " " + LastName mail
cn
(minus ".", replace " " with ".") +
14
IBM Tivoli Directory Integrator
Exercise 02: CSV to XML (Advanced map)
cn mail objectClass ret.value = conn.getString("FirstName") + " " + conn.getString("LastName"); var mVal = system.trim(conn.getString(" cn ")); mVal = system.remove(".", mVal); ret.value = mVal.replace(' ', '.') + "@ewidgets.com"; ret.value = ["top","person","organizationalPerson", ”inetOrgPerson”]; dn ret.value = "uid=" + conn.getString("uid") + ",ou=employees,o=ewidgets,dc=com";
15