On Wednesday 23 November 2011 18:01:18 Natan Sanson wrote:
> Thank you Xavier, I've tried with success to do a lot of things. I have a
> question about ecmascript inside lsc. Does it support Rhino? It would be
> great to import custom java classes and make something more tricky during
> the merge phase

I don't know java / ecmascript enough to help you beyond that point. But it 
looks like LSC *uses* Rhino :

lsc-1.2.1/lib/js-1.6R5.jar

http://grepcode.com/snapshot/repo1.maven.org/maven2/rhino/js/1.6R5

Or am I wrong ?


> 
> Thanks in advance
> 
>     Natan
> 
> On Tue, Nov 22, 2011 at 6:24 PM, Xavier Montagutelli <
> 
> [email protected]> wrote:
> > 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

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

Reply via email to