Discussion:
[lsc-changes] [Ldap Synchronization...] page changed: documentation:2.1:scripting:start
webmaster
2014-05-15 13:32:17 UTC
Permalink
A page in your DokuWiki was added or changed. Here are the details:

Date : 2014/05/15 15:32
Browser : Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
IP-Address : 88.173.78.196
Hostname : mne69-10-88-173-78-196.fbx.proxad.net
Old Revision: http://lsc-project.org/wiki/documentation/2.1/scripting/start?rev=1398420369
New Revision: http://lsc-project.org/wiki/documentation/2.1/scripting/start
Edit Summary:
User : coudot

@@ -5,9 +5,10 @@
* <conditions>
* <dataset>

Supported scripting language are:
- * Javascript (''js:'')
+ * Javascript (JVM interpretor) (''js:'')
+ * Javascript (Rhino interpretor) (''rjs:''), also with debugger (''rdjs:'')
* Groovy (''gr:'')

===== LSC objects =====

@@ -22,4 +23,12 @@
* noupdate: dry run flag for update
* nodelete: dry run flag for delete
* nomodrdn: dry run flag for modrdn

+
+ ===== Debugger =====
+
+ You can launch Rhino debugger by using ''rdjs:'' instead of ''rjs:'' or ''js:''. This will open this window:
+
+ {{ :documentation:lsc_js_debugger.png?direct&400 |}}
+
+ <note tip>Launch LSC in a single thread (option ''-t 1'') to avoid multiple debug windows.</note>
--
This mail was generated by DokuWiki at
http://lsc-project.org/wiki/
webmaster
2014-05-15 13:43:35 UTC
Permalink
A page in your DokuWiki was added or changed. Here are the details:

Date : 2014/05/15 15:43
Browser : Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
IP-Address : 88.173.78.196
Hostname : mne69-10-88-173-78-196.fbx.proxad.net
Old Revision: http://lsc-project.org/wiki/documentation/2.1/scripting/start?rev=1400160737
New Revision: http://lsc-project.org/wiki/documentation/2.1/scripting/start
Edit Summary:
User : coudot

@@ -23,12 +23,57 @@
* noupdate: dry run flag for update
* nodelete: dry run flag for delete
* nomodrdn: dry run flag for modrdn

+
+ ===== External files =====
+
+ You can load an external file and used functions inside your LSC script, thanks to ''<scriptInclude>'' markup.
+
+ For example, at the end of a task definition, insert:
+ <file xml>
+ <task>
+
+ ...
+
+ <scriptInclude>
+ <string>test.js</string>
+ </scriptInclude>
+
+ </task>
+ </file>
+
+ <note tip>You can add several files, by adding other <string> values</note>
+
+ The file ''test.js'' must be in the configuration directory, else you should set the relative path (for example ''../test.js'') if the file is in another location.
+
+ Dummy example:
+ <file js>
+ function test() {
+ return "test-->";
+ }
+ </file>
+
+ Then this method can be used in a dataset, for example:
+ <file xml>
+ <dataset>
+ <name>carLicense</name>
+ <policy>FORCE</policy>
+ <forceValues>
+ <string>
+ js:test()+srcBean.getDatasetFirstValueById(carLicense)
+ </string>
+ </forceValues>
+ </dataset>
+ </file>
+
+ <note>
+ If the extension is .js, it is assumed to be a javascript file.
+ It the extension is .groovy, .gvy .gy or .gsh, it is assumed to be a groovy file.</note>

===== Debugger =====

You can launch Rhino debugger by using ''rdjs:'' instead of ''rjs:'' or ''js:''. This will open this window:

{{ :documentation:lsc_js_debugger.png?direct&400 |}}

<note tip>Launch LSC in a single thread (option ''-t 1'') to avoid multiple debug windows.</note>
--
This mail was generated by DokuWiki at
http://lsc-project.org/wiki/
Loading...