On 17/11/2009 11:35, Laurent wrote:
 >

 > You need to edit etc/sql-map-config.d/*.xml and change the SQL requests

 > there to work on your database.

 >

 > You don't need to do anything with the files under src/impl. Just add

 > their names to the etc/lsc.properties file like this:

 >

 > lsc.tasks.oracle_2_ldap.object = org.lsc.objects.posixAccount

 > -or-

 > lsc.tasks.oracle_2_ldap.object = org.lsc.objects.inetOrgPerson

 > (depending on which one you want to use)

 >

 > Hope this helps,

 > Jonathan

 >

Hi,

* Just a reminder of the context:
- My plan is to synchronize data from an Oracle database to an OpenLDAP
- For "ou = people" all my data from a single table "V_OU_PEOPLE_TEST"
- My "ou = people" contains 11 objectClass
lsc.syncoptions.oracle_2_ldap.objectClass.force_value = "top",
"organizationalPerson", "inetOrgPerson", "posixAccount";
"sambaSamAccount"; "eduPerson"; "supannPerson"; "radiusprofile";
"inetLocalMailRecipient"; "sambaGroupMapping"; "uboPersonne"
- The key to my "ou = people" is the field "uid" (so, DN is like
"uid=toto, dc=domain,dc=fr")
- And I want people to synchronize all the "objectClass" at the same time

- Attached my 2 files *.xml : InetOrgPerson.xml PosixAccount.xml



*
 You do not need to do anything with the files under src / impl. Just add
 Their names to the etc / lsc.properties file like this:
 Lsc.tasks.oracle_2_ldap.object = org.lsc.objects.posixAccount
 >-Or -
 Lsc.tasks.oracle_2_ldap.object = org.lsc.objects.inetOrgPerson
 (Depending on which one you want to use)

That's why I do not understand "or" in your reply
I want org.lsc.objects.posixAccount AND org.lsc.objects.inetOrgPerson at
the same time (which I add my other "objectClass").
How org.lsc.objects.posixAccount AND org.lsc.objects.inetOrgPerson at
the same time?


And I think I still have not understood the philosophy of LSC.
Is there a complete documentation of LSC?
Or a practical example to BDD/openLDAP with several "objectClass"?

Hi again,

I understand your confusion now. It is related to the link between LSC tasks and objectClasses. In the past, we always used one task to sync one objectClass. This is not strictly the case anymore, but the file names still reflect that.

So what you want, to read all types in one go, is different from usual, so my previous advice is probably not the best. I would normally recommend to set up one synchronization task per objectClass type. However, if you want, you can set up one task that does them all, but it's more complicated with the current version of LSC, 1.1. (The next version, 1.2, will make this easier, but it's not ready yet).

So, here is an explanation, which is hope will clarify the philosophy.

LSC runs a synchronization "task", which is defined by a "srcService", a "dstService", an "object" (source format), a "bean" and some "syncoptions".

The process is:

1) The task connects to the source (database properties database.* defined in etc/lsc.properties)

2) Using the task's "srcService", it gets a list of all keys in the source.

3) For each key, it :
a) uses the srcService to read the record identified by that key from the database and put it in an "object" of any type you like. b) uses the dstService to read the record identified by that key from the directory and put it in a "bean"

4) The source "object" is transformed into a "bean", with transformations (defined by syncoptions)

5) The two beans (source and destination) are compared, and any difference are written to the directory.

So, to better define some of the terms used here:

The "srcService" is a simple Java class in src/impl/java/org/lsc/service/. All it does is give the names of the SQL requests like "getInetOrgPersonList", that are then read from the etc/sql-map-config.d/<srcServiceName>.xml file.

In your case, if all your people accounts can be returned in one simple request, you only need ONE srcService, ONE etc/sql-map-config.d/name.xml and ONE object and ONE flat object. For example, rename files so they all contain the name "people". You should have something like this:
- src/impl/java/org/lsc/objects/people.java
- src/impl/java/org/lsc/objects/flat/fPeople.java
- etc/sql-map-config.d/People.xml
- src/impl/java/org/lsc/service/PeopleJdbcService.java

Then, change your lsc.properties to have only one task, let's call it "people". Put these properties in lsc.properties:
lsc.tasks.people.object=org.lsc.objects.people
lsc.tasks.people.srcService=org.lsc.service.PeopleJdbcService

Also, change the file etc/sql-map-config.d/People.xml so that it has a line like:
<typeAlias alias="InetOrgPerson" type="org.lsc.objects.flat.fPeople"/>
(the alias name may be whatever you like, if you change it, change it also in the resultMap line in the same file)

Now, for the complicated part: change the files src/impl/java/org/lsc/objects/flat/fPeople.java and src/impl/java/org/lsc/objects/people.java to have an attribute and get<attribute name> and set<attribute name> functions for EVERY field you read from your database. (This is boring, and this file is normally generated from the objectClass in the directory, which is why we only do one objectClass per task).

Don't worry about the bean class. It can contain any attributes, and you don't need to change it.

I realize this is complicated. I hope it helps. If you try this, please post back and attach the files you changed, so we can debug easily.

Good luck,
Jonathan
--
--------------------------------------------------------------
Jonathan Clarke - [email protected]
--------------------------------------------------------------
Ldap Synchronization Connector (LSC) - http://lsc-project.org
--------------------------------------------------------------
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to