You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2015/07/11 11:20:26 UTC

svn commit: r957864 [6/6] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache camel-2160-release.html eip.html enterprise-integration-patterns.html language.html script.html

Modified: websites/production/camel/content/language.html
==============================================================================
--- websites/production/camel/content/language.html (original)
+++ websites/production/camel/content/language.html Sat Jul 11 09:20:25 2015
@@ -87,30 +87,30 @@
         <tr>
         <td valign="top" width="100%">
 <div class="wiki-content maincontent"><h2 id="Language-Language">Language</h2><p><strong>Available as of Camel 2.5</strong></p><p>The language component allows you to send <a shape="rect" href="exchange.html">Exchange</a> to an endpoint which executes a script by any of the supported <a shape="rect" href="languages.html">Languages</a> in Camel.<br clear="none"> By having a component to execute language scripts, it allows more dynamic routing capabilities. For example by using the <a shape="rect" href="routing-slip.html">Routing Slip</a> or <a shape="rect" href="dynamic-router.html">Dynamic Router</a> EIPs you can send messages to <code>language</code> endpoints where the script is dynamic defined as well.</p><p>This component is provided out of the box in <code>camel-core</code> and hence no additional JARs is needed. You only have to include additional Camel components if the language of choice mandates it, such as using <a shape="rect" href="groovy.html">Groovy</a> or <a shape="re
 ct" href="javascript.html">JavaScript</a> languages.</p><h3 id="Language-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">language://languageName[:script][?options]
-</pre>
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[language://languageName[:script][?options]
+]]></script>
 </div></div><p>And from Camel 2.11 onwards you can refer to an external resource for the script using same notation as supported by the other <a shape="rect" href="language.html">Language</a>s in Camel</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">language://languageName:resource:scheme:location][?options]
-</pre>
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[language://languageName:resource:scheme:location][?options]
+]]></script>
 </div></div><h3 id="Language-URIOptions">URI Options</h3><p>The component supports the following options.</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>languageName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The name of the <a shape="rect" href="languages.html">Language</a> to use, such as <code>simple</code>, <code>groovy</code>, <code>javascript</code> etc. This option is mandatory.</p></td></tr><tr><td colspa
 n="1" rowspan="1" class="confluenceTd"><p><code>script</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The script to execute.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transform</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether or not the result of the script should be used as the new message body. By setting to <code>false</code> the script is executed but the result of the script is discarded.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan
 ="1" class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Whether to cache the script if loaded from a resource.<br clear="none"> Note: from <strong>Camel 2.10.3</strong> a cached script can be forced to reload at runtime via JMX using the clearContentCache operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>cacheScript</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.13/2.12.2/2.11.3:</strong> Whether to cache the compiled script. Turning this option on can gain performance as the script is only compiled/created once, and reuse when processing Camel messages. But this may cause side-effects with data left from previous evaluation spills into the next, and concurrency issues as we
 ll. If the script being evaluated is idempotent then this option can be turned on.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>binary</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.14.1:</strong> Whether the script is binary content. This is intended to be used for loading resources using the Constant language, such as loading binary files.</p></td></tr></tbody></table></div></div><h3 id="Language-MessageHeaders">Message Headers</h3><p>The following message headers can be used to affect the behavior of the component</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><
 tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelLanguageScript</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The script to execute provided in the header. Takes precedence over script configured on the endpoint.</p></td></tr></tbody></table></div></div><h3 id="Language-Examples">Examples</h3><p>For example you can use the <a shape="rect" href="simple.html">Simple</a> language to <a shape="rect" href="message-translator.html">Message Translator</a> a message:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 String script = URLEncoder.encode(&quot;Hello ${body}&quot;, &quot;UTF-8&quot;);
 from(&quot;direct:start&quot;).to(&quot;language:simple:&quot; + script).to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p>In case you want to convert the message body type you can do this as well:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>In case you want to convert the message body type you can do this as well:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 String script = URLEncoder.encode(&quot;${mandatoryBodyAs(String)}&quot;, &quot;UTF-8&quot;);
 from(&quot;direct:start&quot;).to(&quot;language:simple:&quot; + script).to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p>You can also use the <a shape="rect" href="groovy.html">Groovy</a> language, such as this example where the input message will by multiplied with 2:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>You can also use the <a shape="rect" href="groovy.html">Groovy</a> language, such as this example where the input message will by multiplied with 2:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 String script = URLEncoder.encode(&quot;request.body * 2&quot;, &quot;UTF-8&quot;);
 from(&quot;direct:start&quot;).to(&quot;language:groovy:&quot; + script).to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p>You can also provide the script as a header as shown below. Here we use <a shape="rect" href="xpath.html">XPath</a> language to extract the text from the <code>&lt;foo&gt;</code> tag.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">Object out = producer.requestBodyAndHeader("language:xpath", "&lt;foo&gt;Hello World&lt;/foo&gt;", Exchange.LANGUAGE_SCRIPT, "/foo/text()");
-assertEquals("Hello World", out);
-</pre>
+</div></div>You can also provide the script as a header as shown below. Here we use <a shape="rect" href="xpath.html">XPath</a> language to extract the text from the <code>&lt;foo&gt;</code> tag.<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Object out = producer.requestBodyAndHeader(&quot;language:xpath&quot;, &quot;&lt;foo&gt;Hello World&lt;/foo&gt;&quot;, Exchange.LANGUAGE_SCRIPT, &quot;/foo/text()&quot;);
+assertEquals(&quot;Hello World&quot;, out);
+]]></script>
 </div></div><h3 id="Language-Loadingscriptsfromresources">Loading scripts from resources</h3><p><strong>Available as of Camel 2.9</strong></p><p>You can specify a resource uri for a script to load in either the endpoint uri, or in the <code>Exchange.LANGUAGE_SCRIPT</code> header.<br clear="none"> The uri must start with one of the following schemes: file:, classpath:, or http:</p><p>For example to load a script from the classpath:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 from(&quot;direct:start&quot;)
@@ -118,28 +118,28 @@ from(&quot;direct:start&quot;)
     .to(&quot;language:simple:classpath:org/apache/camel/component/language/mysimplescript.txt&quot;)
     .to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p>By default the script is loaded once and cached. However you can disable the <code>contentCache</code> option and have the script loaded on each evaluation.<br clear="none"> For example if the file myscript.txt is changed on disk, then the updated script is used:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>By default the script is loaded once and cached. However you can disable the <code>contentCache</code> option and have the script loaded on each evaluation.<br clear="none"> For example if the file myscript.txt is changed on disk, then the updated script is used:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 from(&quot;direct:start&quot;)
     // the script will be loaded on each message, as we disabled cache
     .to(&quot;language:simple:file:target/script/myscript.txt?contentCache=false&quot;)
     .to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p>From <strong>Camel 2.11</strong> onwards you can refer to the resource similar to the other <a shape="rect" href="language.html">Language</a>s in Camel by prefixing with <code>"resource:"</code> as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>From <strong>Camel 2.11</strong> onwards you can refer to the resource similar to the other <a shape="rect" href="language.html">Language</a>s in Camel by prefixing with <code>"resource:"</code> as shown below:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 from(&quot;direct:start&quot;)
     // load the script from the classpath
     .to(&quot;language:simple:resource:classpath:org/apache/camel/component/language/mysimplescript.txt&quot;)
     .to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p></p><h3 id="Language-SeeAlso">See Also</h3>
-<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="languages.html">Languages</a></li><li><a shape="rect" href="routing-slip.html">Routing Slip</a></li><li><a shape="rect" href="dynamic-router.html">Dynamic Router</a></li></ul></div>
+</div></div><h3 id="Language-SeeAlso">See Also</h3>
+<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="languages.html">Languages</a></li><li><a shape="rect" href="routing-slip.html">Routing Slip</a></li><li><a shape="rect" href="dynamic-router.html">Dynamic Router</a></li><li><a shape="rect" href="script.html">Script</a></li></ul></div>
         </td>
         <td valign="top">
           <div class="navigation">
             <div class="navigation_top">
                 <!-- NavigationBar -->
-<div class="navigation_bottom" id="navigation_bottom"><h3 id="Navigation-Overviewhttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=49132"><a shape="rect" href="overview.html">Overview</a></h3><ul class="alternate"><li><a shape="rect" href="index.html">Home</a></li><li><a shape="rect" href="download.html">Download</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li><li><a shape="rect" href="faq.html">FAQ</a></li></ul><h3 id="Navigation-Documentationhttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=49534"><a shape="rect" href="documentation.html">Documentation</a></h3><ul class="alternate"><li><a shape="rect" href="user-guide.html">User Guide</a></li><li><a shape="rect" href="manual.html">Manual</a></li><li><a shape="rect" href="books.html">Books</a></li><li><a shape="rect" href="tutorials.html">Tutorials</a></li><li><a shape="rect" href="examples.html">Examples</a></li><li><a shape="rect" href="cookbook.html">Cookbook</a></li>
 <li><a shape="rect" href="architecture.html">Architecture</a></li><li><a shape="rect" href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a></li><li><a shape="rect" href="dsl.html">DSL</a></li><li><a shape="rect" href="components.html">Components</a></li><li><a shape="rect" href="data-format.html">Data Format</a></li><li><a shape="rect" href="languages.html">Languages</a></li><li><a shape="rect" href="security.html">Security</a></li><li><a shape="rect" href="security-advisories.html">Security Advisories</a></li></ul><h3 id="Navigation-Search">Search</h3><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
+<div class="navigation_bottom" id="navigation_bottom"><h3 id="Navigation-Overview"><a shape="rect" href="overview.html">Overview</a></h3><ul class="alternate"><li><a shape="rect" href="index.html">Home</a></li><li><a shape="rect" href="download.html">Download</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li><li><a shape="rect" href="faq.html">FAQ</a></li></ul><h3 id="Navigation-Documentation"><a shape="rect" href="documentation.html">Documentation</a></h3><ul class="alternate"><li><a shape="rect" href="user-guide.html">User Guide</a></li><li><a shape="rect" href="manual.html">Manual</a></li><li><a shape="rect" href="books.html">Books</a></li><li><a shape="rect" href="tutorials.html">Tutorials</a></li><li><a shape="rect" href="examples.html">Examples</a></li><li><a shape="rect" href="cookbook.html">Cookbook</a></li><li><a shape="rect" href="architecture.html">Architecture</a></li><li><a shape="rect" href="enterprise-integration-patterns.html">Enterprise
  Integration Patterns</a></li><li><a shape="rect" href="dsl.html">DSL</a></li><li><a shape="rect" href="components.html">Components</a></li><li><a shape="rect" href="data-format.html">Data Format</a></li><li><a shape="rect" href="languages.html">Languages</a></li><li><a shape="rect" href="security.html">Security</a></li><li><a shape="rect" href="security-advisories.html">Security Advisories</a></li></ul><h3 id="Navigation-Search">Search</h3><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
   <div>
     <input type="hidden" name="cx" value="007878419884033443453:m5nhvy4hmyq">
     <input type="hidden" name="ie" value="UTF-8">
@@ -147,7 +147,7 @@ from(&quot;direct:start&quot;)
     <input type="submit" name="sa" value="Search">
   </div>
 </form>
-<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script><h3 id="Navigation-Communityhttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=49115"><a shape="rect" href="community.html">Community</a></h3><ul class="alternate"><li><a shape="rect" href="support.html">Support</a></li><li><a shape="rect" href="contributing.html">Contributing</a></li><li><a shape="rect" href="discussion-forums.html">Discussion Forums</a></li><li><a shape="rect" href="mailing-lists.html">Mailing Lists</a></li><li><a shape="rect" href="user-stories.html">User Stories</a></li><li><a shape="rect" href="news.html">News</a></li><li><a shape="rect" href="articles.html">Articles</a></li><li><a shape="rect" href="site.html">Site</a></li><li><a shape="rect" href="team.html">Team</a></li><li><a shape="rect" class="external-link" href="http://camel-extra.googlecode.com/" rel="nofollow">Camel Extra</a></li></ul><h3 id="Navigation-Developershttps://cwi
 ki.apache.org/confluence/pages/viewpage.action?pageId=49124"><a shape="rect" href="developers.html">Developers</a></h3><ul class="alternate"><li><a shape="rect" href="developers.html">Developer Guide</a></li><li><a shape="rect" href="source.html">Source</a></li><li><a shape="rect" href="building.html">Building</a></li><li><a shape="rect" href="javadoc.html">JavaDoc</a></li><li><a shape="rect" href="irc-room.html">IRC Room</a></li></ul><h3 id="Navigation-ApacheSoftwareFoundation">Apache Software Foundation</h3><ul class="alternate"><li><a shape="rect" class="external-link" href="http://www.apache.org/licenses/">License</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/thanks.html">Thanks</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/security/">Security</a></li></ul></div>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script><h3 id="Navigation-Community"><a shape="rect" href="community.html">Community</a></h3><ul class="alternate"><li><a shape="rect" href="support.html">Support</a></li><li><a shape="rect" href="contributing.html">Contributing</a></li><li><a shape="rect" href="discussion-forums.html">Discussion Forums</a></li><li><a shape="rect" href="mailing-lists.html">Mailing Lists</a></li><li><a shape="rect" href="user-stories.html">User Stories</a></li><li><a shape="rect" href="news.html">News</a></li><li><a shape="rect" href="articles.html">Articles</a></li><li><a shape="rect" href="site.html">Site</a></li><li><a shape="rect" href="team.html">Team</a></li><li><a shape="rect" class="external-link" href="http://camel-extra.googlecode.com/" rel="nofollow">Camel Extra</a></li></ul><h3 id="Navigation-Developers"><a shape="rect" href="developers.html">Developers</a></h3><ul class="alternate"
 ><li><a shape="rect" href="developers.html">Developer Guide</a></li><li><a shape="rect" href="source.html">Source</a></li><li><a shape="rect" href="building.html">Building</a></li><li><a shape="rect" href="javadoc.html">JavaDoc</a></li><li><a shape="rect" href="irc-room.html">IRC Room</a></li></ul><h3 id="Navigation-ApacheSoftwareFoundation">Apache Software Foundation</h3><ul class="alternate"><li><a shape="rect" class="external-link" href="http://www.apache.org/licenses/">License</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/thanks.html">Thanks</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/security/">Security</a></li></ul></div>
                 <!-- NavigationBar -->
             </div>
           </div>

Added: websites/production/camel/content/script.html
==============================================================================
--- websites/production/camel/content/script.html (added)
+++ websites/production/camel/content/script.html Sat Jul 11 09:20:25 2015
@@ -0,0 +1,184 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+<head>
+    <link href="//camel.apache.org/styles/site.css" rel="stylesheet" type="text/css">
+    <link href="//camel.apache.org/styles/type-settings.css" rel="stylesheet" type="text/css">
+    <script src="//camel.apache.org/styles/prototype.js" type="text/javascript"></script>
+    <script src="//camel.apache.org/styles/rico.js" type="text/javascript"></script>    
+    <script src="//camel.apache.org/styles/site.js" type="text/javascript"></script>
+
+    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
+
+    <style type="text/css">
+      .maincontent { overflow:hidden; }
+    </style>
+    <!--[if IE]>
+    <style type="text/css">
+      .maincontent { width:100%; }
+    </style>
+    <![endif]-->
+
+
+  <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css' rel='stylesheet' type='text/css' />
+  <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css' rel='stylesheet' type='text/css' />
+  <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+  
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+
+    <title>
+    Apache Camel: Script
+    </title>
+</head>
+<body>
+<div class="white_box">
+<div class="header">
+  <div class="header_l">
+    <div class="header_r">
+    </div>
+  </div>
+</div>
+<div class="content">
+  <div class="content_l">
+    <div class="content_r">
+      <div>
+          <!-- Banner -->
+<div id="banner-content"><div id="asf_logo">
+	<div id="activemq_logo" style="height:108px; background:transparent url(banner.data/apache-camel-7.png) no-repeat scroll left top;">
+            <a shape="rect" style="float:left; width:310px;display:block;text-indent:-5000px;text-decoration:none;line-height:140px; margin-top:20px; margin-left:18px;" href="http://camel.apache.org/">Camel</a>
+            <a shape="rect" style="float:right; width:180px;display:block;text-indent:-5000px;text-decoration:none;line-height:80px; margin-top:45px; margin-right:10px;" href="http://www.apache.org">Apache</a>
+	</div>
+</div></div>
+          <!-- Banner -->
+        <div class="top_red_bar">
+          <div id="site-breadcrumbs">
+                <!-- Breadcrumbs -->
+<a href="index.html">Apache Camel</a>&nbsp;&gt;&nbsp;<a href="documentation.html">Documentation</a>&nbsp;&gt;&nbsp;<a href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a>&nbsp;&gt;&nbsp;<a href="script.html">Script</a>
+          </div>
+          <!-- Quicklinks -->
+<div id="site-quicklinks"><p><a shape="rect" href="download.html">Download</a> | <a shape="rect" href="javadoc.html">JavaDoc</a> | <a shape="rect" href="source.html">Source</a> | <a shape="rect" href="discussion-forums.html">Forums</a> | <a shape="rect" href="support.html">Support</a></p></div>
+          <!-- Quicklinks -->
+        </div>
+
+	<table border="0">
+	<tbody>
+        <tr>
+        <td valign="top" width="100%">
+<div class="wiki-content maincontent"><h2 id="Script-Script">Script</h2><p><strong>Available as of Camel 2.16</strong></p><p>&#160;</p><p>Is used to execute a script which does not change the message (by default). This is useful when you need to invoke some logic that are not in Java code such as JavaScript, Groovy or any of the other&#160;<a shape="rect" href="languages.html">Languages</a>. The message body is not changed (by default) however the scripting context has access to the current Exchange and can essentially change the message or headers directly. But the return value from the script is discarded and not used. If the return value should be used as a changed message body then use&#160;<a shape="rect" href="message-translator.html">Message Translator</a> EIP instead.</p><h3 id="Script-UsingfromJavaDSL">Using from Java DSL</h3><p>The route below will read the file contents and validate them against a regular expression.</p><div class="code panel pdl" style="border-width: 1px
 ;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;file://inbox&quot;)
+  .script().groovy(&quot;// some groovy code goes here&quot;)
+  .to(&quot;bean:MyServiceBean.processLine&quot;);]]></script>
+</div></div><h3 id="Script-UsingfromSpringDSL">Using from Spring DSL</h3><p>And from XML its easy as well</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
+  &lt;from uri=&quot;file://inbox&quot;/&gt;
+  &lt;script&gt;
+    &lt;groovy&gt;// some groovy code goes here&lt;/groovy&gt;
+  &lt;/script&gt;
+  &lt;beanRef ref=&quot;myServiceBean&quot; method=&quot;processLine&quot;/&gt;
+&lt;/route&gt;
+
+&lt;bean id=&quot;myServiceBean&quot; class=&quot;com.mycompany.MyServiceBean&quot;/&gt;
+]]></script>
+</div></div><p>Mind that you can use CDATA in XML if the groovy scrip uses &lt; &gt; etc</p><p>&#160;</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
+  &lt;from uri=&quot;file://inbox&quot;/&gt;
+  &lt;script&gt;
+    &lt;groovy&gt;&lt;![CDATA[ some groovy script here that can be multiple lines and whatnot ]]&gt;&lt;/groovy&gt;
+  &lt;/script&gt;
+  &lt;beanRef ref=&quot;myServiceBean&quot; method=&quot;processLine&quot;/&gt;
+&lt;/route&gt;
+
+&lt;bean id=&quot;myServiceBean&quot; class=&quot;com.mycompany.MyServiceBean&quot;/&gt;]]></script>
+</div></div><p></p><h4 id="Script-UsingThisPattern">Using This Pattern</h4>
+
+<p>If you would like to use this EIP Pattern then please read the <a shape="rect" href="getting-started.html">Getting Started</a>, you may also find the <a shape="rect" href="architecture.html">Architecture</a> useful particularly the description of <a shape="rect" href="endpoint.html">Endpoint</a> and <a shape="rect" href="uris.html">URIs</a>. Then you could try out some of the <a shape="rect" href="examples.html">Examples</a> first before trying this pattern out.</p></div>
+        </td>
+        <td valign="top">
+          <div class="navigation">
+            <div class="navigation_top">
+                <!-- NavigationBar -->
+<div class="navigation_bottom" id="navigation_bottom"><h3 id="Navigation-Overview"><a shape="rect" href="overview.html">Overview</a></h3><ul class="alternate"><li><a shape="rect" href="index.html">Home</a></li><li><a shape="rect" href="download.html">Download</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li><li><a shape="rect" href="faq.html">FAQ</a></li></ul><h3 id="Navigation-Documentation"><a shape="rect" href="documentation.html">Documentation</a></h3><ul class="alternate"><li><a shape="rect" href="user-guide.html">User Guide</a></li><li><a shape="rect" href="manual.html">Manual</a></li><li><a shape="rect" href="books.html">Books</a></li><li><a shape="rect" href="tutorials.html">Tutorials</a></li><li><a shape="rect" href="examples.html">Examples</a></li><li><a shape="rect" href="cookbook.html">Cookbook</a></li><li><a shape="rect" href="architecture.html">Architecture</a></li><li><a shape="rect" href="enterprise-integration-patterns.html">Enterprise
  Integration Patterns</a></li><li><a shape="rect" href="dsl.html">DSL</a></li><li><a shape="rect" href="components.html">Components</a></li><li><a shape="rect" href="data-format.html">Data Format</a></li><li><a shape="rect" href="languages.html">Languages</a></li><li><a shape="rect" href="security.html">Security</a></li><li><a shape="rect" href="security-advisories.html">Security Advisories</a></li></ul><h3 id="Navigation-Search">Search</h3><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
+  <div>
+    <input type="hidden" name="cx" value="007878419884033443453:m5nhvy4hmyq">
+    <input type="hidden" name="ie" value="UTF-8">
+    <input type="text" name="q" size="21">
+    <input type="submit" name="sa" value="Search">
+  </div>
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script><h3 id="Navigation-Community"><a shape="rect" href="community.html">Community</a></h3><ul class="alternate"><li><a shape="rect" href="support.html">Support</a></li><li><a shape="rect" href="contributing.html">Contributing</a></li><li><a shape="rect" href="discussion-forums.html">Discussion Forums</a></li><li><a shape="rect" href="mailing-lists.html">Mailing Lists</a></li><li><a shape="rect" href="user-stories.html">User Stories</a></li><li><a shape="rect" href="news.html">News</a></li><li><a shape="rect" href="articles.html">Articles</a></li><li><a shape="rect" href="site.html">Site</a></li><li><a shape="rect" href="team.html">Team</a></li><li><a shape="rect" class="external-link" href="http://camel-extra.googlecode.com/" rel="nofollow">Camel Extra</a></li></ul><h3 id="Navigation-Developers"><a shape="rect" href="developers.html">Developers</a></h3><ul class="alternate"
 ><li><a shape="rect" href="developers.html">Developer Guide</a></li><li><a shape="rect" href="source.html">Source</a></li><li><a shape="rect" href="building.html">Building</a></li><li><a shape="rect" href="javadoc.html">JavaDoc</a></li><li><a shape="rect" href="irc-room.html">IRC Room</a></li></ul><h3 id="Navigation-ApacheSoftwareFoundation">Apache Software Foundation</h3><ul class="alternate"><li><a shape="rect" class="external-link" href="http://www.apache.org/licenses/">License</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/thanks.html">Thanks</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/security/">Security</a></li></ul></div>
+                <!-- NavigationBar -->
+            </div>
+          </div>
+        </td>
+        </tr>
+	</tbody>
+        </table>
+
+
+        <div class="bottom_red_bar"></div>
+      </div>
+    </div>
+  </div>
+</div>
+<div class="black_box">
+<div class="footer">
+  <div class="footer_l">
+    <div class="footer_r">
+      <div>
+        <a href="$base/privacy-policy.html">Privacy Policy</a> -
+        (<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=59690414">edit page</a>)
+   	 (<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=59690414&amp;showComments=true&amp;showCommentArea=true#addcomment">add comment</a>)
+      </div>
+    </div>
+  </div>
+</div>
+</div>
+</div>
+<div class="design_attribution">
+&copy; 2004-2015 The Apache Software Foundation.
+<br>          
+Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation.  All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+<br>
+<a href="http://hiramchirino.com">Graphic Design By Hiram</a>
+</div>
+
+<!-- Camel committers that would like access to the Analytics, send a note to private@camel.apache.org -->
+<script type="text/javascript">
+
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-25976253-1']);
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+
+</script>
+
+</body>
+</html>
+
+