[lsc-changes] [Ldap Synchronization Connector (LSC)] page added: documentation:2.0:tutorials:csvtoldap

webmaster at lsc-project.org webmaster at lsc-project.org
Thu Sep 29 22:59:23 CEST 2011

A page in your DokuWiki was added or changed. Here are the details:

Date        : 2011/09/29 22:59
Browser     : Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.24 Safari/535.2
IP-Address  :
Hostname    : nsg93-4-82-235-239-71.fbx.proxad.net
Old Revision: none
New Revision: http://lsc-project.org/wiki/documentation/2.0/tutorials/csvtoldap
Edit Summary: created
User        : sbahloul

====== Synchronize from CSV to LDAP directory ======

The sample that is provided inside the distribution archive and sample/hsqldb will be used there.

This tutorial explains you can synchronize a CSV file to a LDAP directory. The idea is to use a database source service based on a HSQLDB instance (database on files or in memory). This HSQLDB instance will be previously populated with data contain in the CSV file.

===== Populate the HSQLDB database from CSV =====

You can achieve this by using the bin/lsc-sample script. It will look at your CSV file and first of all, at the first line, to create a table with the corresponding fields. Then it will format your CSV into a SQL file that will insert each line as a record.

To run this script, you need a bash environment (either through your favorite Unix OS or through Cygwin :
$ bin/lsc-sample --import sample.csv

For example, if you have a CSV file like the following:

jdoe;Doe;John;John Doe;jdoe at example.com

Then, HSQLDB will return something like that with a select query:

----  ---  ---------  --------  --------------
jdoe  Doe  John       John Doe  jdoe at example.com

===== Configure your HSQLDB source connector =====

===== Configure your LDAP destination connector =====

===== Specify the synchronization options =====

===== Manually configure LSC =====

==== Specify SQL mapping ====

LSC will be launch to synchronize data between an HSQLDB instance and an LDAP directory. So, you have to configure the SQL mapping to retrieve correct data from the database table.

The database table should be named "**csvdata**", and will contain all field defined in the CSV file to be synchronized.

The SQL mapping is achieved like any other file 

==== Complete lsc.properties ====

If your synchronization is based on the **inetOrgPerson** LDAP object class, the configuration file should contain something like the following:

lsc.tasks.application.type = db2ldap
lsc.tasks.application.srcService = \
lsc.tasks.application.object = org.lsc.objects.inetOrgPerson
lsc.tasks.application.bean = org.lsc.beans.inetOrgPersonBean

If synchronization is based on the UID database field, then you must define it in the //lsc.tasks.application.dstService.pivotAttrs// property.

This mail was generated by DokuWiki at

More information about the lsc-changes mailing list