Author: buildbot Date: Thu Dec 26 02:21:39 2013 New Revision: 891795 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/beanshell.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/book-languages-appendix.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/groovy.html websites/production/camel/content/javascript.html websites/production/camel/content/php.html websites/production/camel/content/python.html websites/production/camel/content/ruby.html websites/production/camel/content/scripting-languages-context.html websites/production/camel/content/scripting-languages.html Modified: websites/production/camel/content/beanshell.html ============================================================================== --- websites/production/camel/content/beanshell.html (original) +++ websites/production/camel/content/beanshell.html Thu Dec 26 02:21:39 2013 @@ -122,20 +122,7 @@ <p>You could follow the examples above to create an <a shape="rect" href="predicate.html">Predicate</a> in a <a shape="rect" href="message-filter.html">Message Filter</a> or as an <a shape="rect" href="expression.html">Expression</a> for a <a shape="rect" href="recipient-list.html">Recipient List</a></p> -<h3 id="BeanShell-ScriptContext">ScriptContext</h3> -<p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p> - -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Attribute </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Type </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Value </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> context </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>org.apache.camel.CamelContext</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The Camel Context </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> exchange </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>org.apache.camel.Exchange</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The current Exchange </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> request </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>org.apache.camel.Message</code> </p></td><td colspan="1" r owspan="1" class="confluenceTd"><p> The IN message </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> response </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>org.apache.camel.Message</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The OUT message </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> properties </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>org.apache.camel.builder.script.PropertiesFunction</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example. </p></td></tr></tbody></table></div> - - -<p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p> - -<h3 id="BeanShell-AdditionalargumentstoScriptingEngine">Additional arguments to ScriptingEngine</h3> -<p><strong>Available as of Camel 2.8</strong></p> - -<p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> -See this example:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<h3 id="BeanShell-ScriptContext">ScriptContext</h3><p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>context</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context ( It cannot be used in groovy)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">camelContext</td><td colspan="1" rowspan="1" class="confluenceTd">org.apache.camel.CamelContext</td><td colspan="1" rowspan="1" class="confluenceTd">The Camel Context</td></tr><tr><td colspan="1 " rowspan="1" class="confluenceTd"><p>exchange</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>request</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The IN message</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>response</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The OUT message</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>properties</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><str ong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BeanShell-AdditionalargumentstoScriptingEngine">Additional arguments to ScriptingEngine</h3><p><strong>Available as of Camel 2.8</strong></p><p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> See this example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ public void testArgumentsExample() throws Exception { if (!ScriptTestHelper.canRunTestOnThisPlatform()) { @@ -156,49 +143,17 @@ public void testArgumentsExample() throw assertMockEndpointsSatisfied(); } ]]></script> -</div></div> - - -<h3 id="BeanShell-Usingpropertiesfunction">Using properties function</h3> -<p><strong>Available as of Camel 2.9</strong></p> - -<p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> -For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -.setHeader("myHeader").groovy("context.resolvePropertyPlaceholders('{{' + request.headers.get('foo') + '}}')") +</div></div><h3 id="BeanShell-Usingpropertiesfunction">Using properties function</h3><p><strong>Available as of Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[.setHeader("myHeader").groovy("context.resolvePropertyPlaceholders('{{' + request.headers.get('foo') + '}}')") ]]></script> -</div></div> - -<p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -.setHeader("myHeader").groovy("properties.resolve(request.headers.get('foo'))") +</div></div><p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[.setHeader("myHeader").groovy("properties.resolve(request.headers.get('foo'))") ]]></script> -</div></div> - - -<h3 id="BeanShell-Loadingscriptfromexternalresource">Loading script from external resource</h3> -<p><strong>Available as of Camel 2.11</strong></p> - -<p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> -This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -.setHeader("myHeader").groovy("resource:classpath:mygroovy.groovy") +</div></div><h3 id="BeanShell-Loadingscriptfromexternalresource">Loading script from external resource</h3><p><strong>Available as of Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[.setHeader("myHeader").groovy("resource:classpath:mygroovy.groovy") ]]></script> -</div></div> - - -<h3 id="BeanShell-Dependencies">Dependencies</h3> - -<p>To use scripting languages in your camel routes you need to add the a dependency on <strong>camel-script</strong> which integrates the JSR-223 scripting engine. </p> - -<p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<dependency> +</div></div><h3 id="BeanShell-Dependencies">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong>camel-script</strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-script</artifactId> <version>x.x.x</version>