On Tuesday 22 November 2011 15:24:16 Natan Sanson wrote:
> Hi, this is my first post. I'm new to LSC project and I'm implementing it
> to do one of the most used connections, db2ldap. I'm running lsc-1.2.1
> after have tried in a lot of ways to make works the 2.0 beta version
> without success. With 1.2.1 all is working fine. I have a question about
> lsc data transformations. I read it is possible to manipulate data using
> javascript expressions. What I have to achieve is a data value mapping
>
> For example, if inside the database field "department" i found "Information
> technology", I have to transform it to "IT". So what i need is to write a
> mapping table to transform source values in destination values. I've seen
> the force_value options on the lsc documentation, but I don't believe that
> is possible to reach my goal with simple data manipulation. Can I do such
> things with lsc? If yes, is it possible to do them without modifying the
> standard Java beans?
Whatever datasource you use, you can manipulate the values inside the
lsc.properties file with JS code. To force the value of the "department"
attribute (*if* the database field is available with the same name), you can
write something like :
lsc.syncoptions.my_task.department.force_value = \
var dpt = srcBean.getAttributeFirstValueById("department"); \
if (dpt == "Information technology") \
dpt = "IT"; \
dpt
Be careful, the ";" must *not* be the delimiter for multi-valued attributes,
otherwise the javascript ";" will be misunderstood.
I.e you have to change the delimiter with something like :
lsc.syncoptions.my_task.default.delimiter = $
And change other attributes accordingly.
Or perhaps you can also play with the SQL request to change the string ? But I
don't know SQL enough for that.
>
> During my tests with 2.0 I've seen how difficult it is to build the project
> (due to old repositories and failing unit tests... maybe due to a wrong
> project configuration, I don't know)
>
> Thanks in advance, any help would be really appreciated
>
> Natan
--
Xavier Montagutelli
http://twitter.com/#!/XMontagutelli
Service Commun Informatique - Universite de Limoges
123, avenue Albert Thomas - 87060 Limoges cedex
Tel : +33 (0)5 55 45 77 20 / Fax : +33 (0)5 55 45 75 95
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users