camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r931165 - in /websites/production/camel/content: cache/main.pageCache rest-dsl.html spark-rest.html
Date Mon, 01 Dec 2014 12:18:48 GMT
Author: buildbot
Date: Mon Dec  1 12:18:48 2014
New Revision: 931165

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/rest-dsl.html
    websites/production/camel/content/spark-rest.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/rest-dsl.html
==============================================================================
--- websites/production/camel/content/rest-dsl.html (original)
+++ websites/production/camel/content/rest-dsl.html Mon Dec  1 12:18:48 2014
@@ -249,7 +249,7 @@ public class UserPojo {
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[restConfiguration().component(&quot;spark-rest&quot;).port(9091).componentProperty(&quot;foo&quot;,
&quot;123&quot;);]]></script>
 </div></div><p><span style="line-height: 1.4285715;"><br clear="none"></span></p><p><span
style="line-height: 1.4285715;">And with XML DSL</span></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[&lt;restConfiguration
component=&quot;spark-rest&quot; port=&quot;9091&quot;&gt; &lt;componentProperty
key=&quot;foo&quot; value=&quot;123&quot;/&gt; &lt;/restConfiguration&gt;]]></script>
-</div></div><p><span style="line-height: 1.4285715;"><br clear="none"></span></p><p>You
can configure properties on these levels.&#160;</p><ul><li>component
- Is used to set any options on the Component class. You can also configure these directly
on the component.</li><li>endpoint - Is used set any option on the endpoint level.
Many of the Camel components has many options you can set on endpoint level.</li><li>consumer
- Is used to set any option on the consumer level. Some components has consumer options, which
you can also configure from endpoint level by prefixing the option with "consumer."&#160;</li><li>data
format - Is used to set any option on the data formats. For example to enable pretty print
in the json data format.</li></ul><p>You can set multiple options of the
same level, so you can can for example configure 2 component options, and 3 endpoint options
etc.</p><h3 id="RestDSL-IntegrationaCamelcomponentwithRestDSL">Integration a Camel
component with Rest DSL</h3><p>Any
  Apache Camel component can integrate with the Rest DSL if they can be used as a REST service
(eg as a REST consumer in Camel lingo). To integrate with the Rest DSL, then the component
should implement the&#160;<code>org.apache.camel.spi.RestConsumerFactory</code>.
The Rest DSL will then invoke the&#160;<code>createConsumer</code> method
when it setup the Camel routes from the defined DSL. The component should then implement logic
to create a Camel consumer that exposes the REST services based on the given parameters, such
as path, verb, and other options. For example see the source code for camel-restlet, camel-spark-rest.</p><h3
id="RestDSL-SwaggerAPI">Swagger API</h3><p>The Rest DSL supports <a shape="rect"
href="swagger.html">Swagger</a>&#160;by the&#160;<code>camel-swagger</code>
module. See more details at &#160;<a shape="rect" href="swagger.html">Swagger</a>&#160;and
the&#160;<code>camel-example-servlet-rest-tomcat</code> example from the Apache
Camel distribution.</p><h3 id=
 "RestDSL-SeeAlso">See Also</h3><p><a shape="rect" href="dsl.html">DSL</a></p><p><a
shape="rect" href="rest.html">Rest</a></p><p><a shape="rect" href="swagger.html">Swagger</a></p><p><a
shape="rect" href="spark-rest.html">Spark-rest</a></p><p><a shape="rect"
href="how-do-i-import-rests-from-other-xml-files.html">How do I import rests from other
XML files</a></p></div>
+</div></div><p><span style="line-height: 1.4285715;"><br clear="none"></span></p><p>You
can configure properties on these levels.&#160;</p><ul><li>component
- Is used to set any options on the Component class. You can also configure these directly
on the component.</li><li>endpoint - Is used set any option on the endpoint level.
Many of the Camel components has many options you can set on endpoint level.</li><li>consumer
- Is used to set any option on the consumer level. Some components has consumer options, which
you can also configure from endpoint level by prefixing the option with "consumer."&#160;</li><li>data
format - Is used to set any option on the data formats. For example to enable pretty print
in the json data format.</li></ul><p>You can set multiple options of the
same level, so you can can for example configure 2 component options, and 3 endpoint options
etc.</p><h3 id="RestDSL-IntegrationaCamelcomponentwithRestDSL">Integration a Camel
component with Rest DSL</h3><p>Any
  Apache Camel component can integrate with the Rest DSL if they can be used as a REST service
(eg as a REST consumer in Camel lingo). To integrate with the Rest DSL, then the component
should implement the&#160;<code>org.apache.camel.spi.RestConsumerFactory</code>.
The Rest DSL will then invoke the&#160;<code>createConsumer</code> method
when it setup the Camel routes from the defined DSL. The component should then implement logic
to create a Camel consumer that exposes the REST services based on the given parameters, such
as path, verb, and other options. For example see the source code for camel-restlet, camel-spark-rest.</p><h3
id="RestDSL-SwaggerAPI">Swagger API</h3><p>The Rest DSL supports <a shape="rect"
href="swagger.html">Swagger</a>&#160;by the&#160;<code>camel-swagger</code>
module. See more details at &#160;<a shape="rect" href="swagger.html">Swagger</a>&#160;and
the&#160;<code>camel-example-servlet-rest-tomcat</code> example from the Apache
Camel distribution.</p><h3 id=
 "RestDSL-SeeAlso">See Also</h3><ul><li><a shape="rect" href="dsl.html">DSL</a></li><li><a
shape="rect" href="rest.html">Rest</a></li><li><a shape="rect" href="swagger.html">Swagger</a></li><li><a
shape="rect" href="spark-rest.html">Spark-rest</a></li><li><a shape="rect"
href="how-do-i-import-rests-from-other-xml-files.html">How do I import rests from other
XML files</a></li></ul></div>
         </td>
         <td valign="top">
           <div class="navigation">

Modified: websites/production/camel/content/spark-rest.html
==============================================================================
--- websites/production/camel/content/spark-rest.html (original)
+++ websites/production/camel/content/spark-rest.html Mon Dec  1 12:18:48 2014
@@ -101,8 +101,7 @@
 </div></div><h3 id="Spark-rest-URIformat">URI format</h3><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[
 spark-rest://verb:path?[options]
 ]]></script>
-</div></div><h3 id="Spark-rest-URIOptions"><span style="line-height:
1.5625;font-size: 16.0px;">URI Options</span></h3><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>
Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
verb </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> get, post, put, patch, delete, head,
trace, connect, or options. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> path </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> the content path which support Spark syntax. See further
below for examples. </p></td></tr><tr><td colspan="1" rowspan="1"
class=
 "confluenceTd"><p> accept </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> accept type such as: 'text/xml',
or 'application/json'. By default we accept all kinds of types. </p></td></tr></tbody></table></div>
-<h3 id="Spark-rest-PathusingSparksyntax">Path using Spark syntax</h3><p>The
path option is defined using a Spark REST syntax where you define the REST context path using
support for parameters and splat. See more details at the <a shape="rect" class="external-link"
href="http://sparkjava.com/readme.html#title1" rel="nofollow">Spark Java Route</a>
documentation.</p><p>The following is a Camel route using a fixed path</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+</div></div><h3 id="Spark-rest-URIOptions"><span style="line-height:
1.5625;font-size: 16.0px;">URI Options</span></h3><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>Description</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>verb</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>get, post, put, patch, delete, head, trace, connect,
or options.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>path</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>the content path which support Spark
syntax. See further below for examples.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"
 ><p>accept</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>accept type such as: 'text/xml',
or 'application/json'. By default we accept all kinds of types.</p></td></tr></tbody></table></div><h3
id="Spark-rest-PathusingSparksyntax">Path using Spark syntax</h3><p>The path
option is defined using a Spark REST syntax where you define the REST context path using support
for parameters and splat. See more details at the <a shape="rect" class="external-link"
href="http://sparkjava.com/readme.html#title1" rel="nofollow">Spark Java Route</a>
documentation.</p><p>The following is a Camel route using a fixed path</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[
 from(&quot;spark-rest:get:hello&quot;)
     .transform().constant(&quot;Bye World&quot;);]]></script>
 </div></div><p>And the following route uses a parameter which is mapped
to a Camel header with the key "me".</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
@@ -111,7 +110,11 @@
 </div></div><h3 id="Spark-rest-MappingtoCamelMessage">Mapping to Camel
Message</h3><p>The Spark Request object is mapped to a Camel Message as a&#160;<code>org.apache.camel.component.sparkrest.SparkMessage</code>
which has access to the raw Spark request using the getRequest method. By default the Spark
body is mapped to Camel message body, and any HTTP headers / Spark parameters is mapped to
Camel Message headers. There is special support for the Spark splat syntax, which is mapped
to the Camel message header with key splat.</p><p>For example the given route
below uses Spark splat (the asterisk sign)&#160;in the context path which we can access
as a header form the Simple language to construct a response message.</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[
 from(&quot;spark-rest:get:/hello/*/to/*&quot;)
     .transform().simple(&quot;Bye big ${header.splat[1]} from ${header.splat[0]}&quot;);]]></script>
-</div></div><h3 id="Spark-rest-RestDSL"><span style="font-size: 16.0px;line-height:
1.5625;">Rest DSL</span></h3><p><span style="font-size: 16.0px;line-height:
1.5625;">Apache Camel provides a new Rest DSL that allow to define the REST services in
a nice REST style.</span></p><p><span style="font-size: 16.0px;line-height:
1.5625;">For example we can define a REST hello service in Java DSL as shown below:</span></p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+</div></div><h3 id="Spark-rest-RestDSL"><span style="font-size: 16.0px;line-height:
1.5625;">Rest DSL</span></h3><p>Apache Camel provides a new Rest DSL
that allow to define the REST services in a nice REST style. For example we can define a REST
hello service as shown below:</p>    
+<div class="contentf aui-tabs horizontal-tabs" id="RestDslTabs" title="Rest DSL">
+    <ul class="tabs-menu"></ul>
+    <div class="tabs-pane" id="RestDslTabsJava" data-pane-title="Java">
+    <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[
 return new RouteBuilder() {
       @Override
       public void configure() throws Exception {
@@ -119,7 +122,10 @@
                 .route().transform().simple(&quot;Bye ${header.me}&quot;);
         }
     };]]></script>
-</div></div><p>&#160;</p><p>And the same example in XML
DSL would be</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div>
+</div>
+<div class="tabs-pane" id="RestDslTabsXml" data-pane-title="XML">
+    <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[
 &lt;camelContext xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
     &lt;rest uri=&quot;/hello/{me}&quot;&gt;
       &lt;get&gt;
@@ -131,7 +137,11 @@
       &lt;/get&gt;
     &lt;/rest&gt;
   &lt;/camelContext&gt;]]></script>
-</div></div><p><span style="line-height: 1.4285715;"><br clear="none"></span></p><p><span
style="line-height: 1.4285715;">See more details at the&#160;</span><a shape="rect"
href="rest-dsl.html">Rest DSL</a><span style="line-height: 1.4285715;">.</span></p><h3
id="Spark-rest-Moreexamples"><span style="font-size: 16.0px;line-height: 1.5625;">More
examples</span></h3><p>There is a <strong>camel-example-spark-rest-tomcat</strong>
example in the Apache Camel distribution, that demonstrates how to use camel-spark-rest in
a web application that can be deployed on Apache Tomcat, or similar web containers.</p><p></p><h3
id="Spark-rest-SeeAlso">See Also</h3>
+</div></div>
+</div>
+</div>
+<div style="clear:both"><p> </p></div>
+<p><span style="line-height: 1.4285715;">See more details at the&#160;</span><a
shape="rect" href="rest-dsl.html">Rest DSL</a><span style="line-height: 1.4285715;">.</span></p><h3
id="Spark-rest-Moreexamples"><span style="font-size: 16.0px;line-height: 1.5625;">More
examples</span></h3><p>There is a <strong>camel-example-spark-rest-tomcat</strong>
example in the Apache Camel distribution, that demonstrates how to use camel-spark-rest in
a web application that can be deployed on Apache Tomcat, or similar web containers.</p><p></p><h3
id="Spark-rest-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 style="list-style-type: square;"><li><a
shape="rect" href="rest.html">Rest</a></li></ul></div>
         </td>
         <td valign="top">



Mime
View raw message