Modified: websites/production/camel/content/book-languages-appendix.html ============================================================================== --- websites/production/camel/content/book-languages-appendix.html (original) +++ websites/production/camel/content/book-languages-appendix.html Thu Sep 14 19:25:46 2017 @@ -164,7 +164,7 @@ from("activemq:topic:OrdersTopic&qu ]]></script> </div></div><h3 id="BookLanguagesAppendix-Dependencies.1">Dependencies</h3><p>The Constant language is part of <strong><code>camel-core</code></strong>.</p> <h2 id="BookLanguagesAppendix-EL">EL</h2><p>Camel supports the unified JSP and JSF Expression Language via the <a shape="rect" class="external-link" href="http://juel.sourceforge.net/" rel="nofollow">JUEL</a> to allow an <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a> to be used in the <a shape="rect" href="dsl.html">DSL</a> or <a shape="rect" href="xml-configuration.html">Xml Configuration</a>.</p><p>For example you could use EL inside a <a shape="rect" href="message-filter.html">Message Filter</a> in XML</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[<route> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route> <from uri="seda:foo"/> <filter> <el>${in.headers.foo == 'bar'}</el> @@ -173,7 +173,7 @@ from("activemq:topic:OrdersTopic&qu </route> ]]></script> </div></div><p>You could also use slightly different syntax, e.g. if the header name is not a valid identifier:</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[<route> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route> <from uri="seda:foo"/> <filter> <el>${in.headers['My Header'] == 'bar'}</el> @@ -413,7 +413,7 @@ result = body * 2 + 1 <p>Or the something like this in your Spring XML:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <filter> <language language="beanshell">request.getHeaders().get("Foo") == null</language> ... @@ -466,7 +466,7 @@ result = body * 2 + 1 <p>And a Spring DSL sample 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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> <choice> @@ -515,7 +515,7 @@ result = body * 2 + 1 from("queue:foo").filter(groovy("request.lineItems.any { i -> i.value > 100 }")).to("queue:bar") ]]></script> </div></div><p>And the Spring DSL:</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[ <route> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="queue:foo"/> <filter> <groovy>request.lineItems.any { i -> i.value > 100 }</groovy> @@ -547,7 +547,7 @@ result = body * 2 + 1 .to("seda:regularQueue"); ]]></script> </div></div><p>And a Spring DSL sample 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[ <route> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> <choice> <when> @@ -628,7 +628,7 @@ result = body * 2 + 1 <p>And a Spring DSL sample 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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> <choice> @@ -806,7 +806,7 @@ simple("${in.header.type} == ${bean:orde <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[fileName="uniquefile-${bean:myguidgenerator.generateid}.txt" ]]></script> </div></div><p>And of course all this can be combined in one expression where you can use the <a shape="rect" href="file-language.html">File Language</a>, <a shape="rect" href="simple.html">Simple</a> and the <a shape="rect" href="bean.html">Bean</a> language in one combined expression. This is pretty powerful for those common file path patterns.</p><h3 id="BookLanguagesAppendix-UsingSpring'sPropertyPlaceholderConfigurerwiththeFileComponent">Using Spring's <code>PropertyPlaceholderConfigurer</code> with the <a shape="rect" href="file2.html">File</a> Component</h3><p>In Camel you can use the <a shape="rect" href="file-language.html">File Language</a> directly from the <a shape="rect" href="simple.html">Simple</a> language which makes a <a shape="rect" href="content-based-router.html">Content Based Router</a> easier to do in Spring XML, where we can route based on file extensions as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent pan elContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<from uri="file://input/orders"/> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<from uri="file://input/orders"/> <choice> <when> <simple>${file:ext} == 'txt'</simple> @@ -842,7 +842,7 @@ Could not resolve placeholder 'date: ]]></script> </div></div><h3 id="BookLanguagesAppendix-Dependencies.16">Dependencies</h3><p>The File language is part of <strong><code>camel-core</code></strong>.</p> <h2 id="BookLanguagesAppendix-SQLLanguage">SQL Language</h2><p>The SQL support is added by <a shape="rect" class="external-link" href="http://josql.sourceforge.net/" rel="nofollow">JoSQL</a> and is primarily used for performing SQL queries on in-memory objects. If you prefer to perform actual database queries then check out the <a shape="rect" href="jpa.html">JPA</a> component.</p><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Looking for the SQL component</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Camel has both a <a shape="rect" href="sql.html">SQL</a> language and a <a shape="rect" href="sql-component.html">SQL Component</a>. This page is about the SQL language. Click on <a shape="rect" href="sql-component.html">SQL Component</a> if you are looking for the component instead.</p></div></div><p>To use SQL in your camel routes you need to add the a dependency on <strong>camel-josql</strong> which implements the SQL language.</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="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-josql</artifactId> <version>x.x.x</version> @@ -853,7 +853,7 @@ Could not resolve placeholder 'date: <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("queue:foo").setBody().sql("select * from MyType").to("queue:bar") ]]></script> </div></div><p>And the spring DSL:</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"><