camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r967479 - in /websites/production/camel/content: cache/main.pageCache rest-dsl.html swagger-java.html swagger.html
Date Fri, 02 Oct 2015 06:18:48 GMT
Author: buildbot
Date: Fri Oct  2 06:18:47 2015
New Revision: 967479

Log:
Production update by buildbot for camel

Added:
    websites/production/camel/content/swagger-java.html
Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/rest-dsl.html
    websites/production/camel/content/swagger.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 Fri Oct  2 06:18:47 2015
@@ -289,7 +289,7 @@ public class UserPojo {
     .setBody().constant("Invalid json data");
 
 ]]></script>
-</div></div><p>&#160;</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.htm
 l">Swagger</a>&#160;and the&#160;<code>camel-example-servlet-rest-tomcat</code> example from the Apache Camel distribution.</p><p>From&#160;<strong>Camel 2.16</strong> onwards you can define each parameter fine grained with details such as name, description, data type, parameter type and so on, using the &lt;param&gt;. For example to define the id path parameter you can do as shown below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>&#160;</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-java.html">Swagger Java</a>&#160;by the&#160;<code>camel-swagger-java</code> module. See more details at &#160;<a shape="rect" hr
 ef="swagger-java.html">Swagger</a>&#160;and the&#160;<code>camel-swagger-java</code>&#160;example from the Apache Camel distribution.</p><p>From&#160;<strong>Camel 2.16</strong> onwards you can define each parameter fine grained with details such as name, description, data type, parameter type and so on, using the &lt;param&gt;. For example to define the id path parameter you can do as shown below:</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;!-- this is a rest GET to view an user by the given id --&gt;
 &lt;get uri=&quot;/{id}&quot; outType=&quot;org.apache.camel.example.rest.User&quot;&gt;
   &lt;description&gt;Find user by id&lt;/description&gt;
@@ -311,7 +311,7 @@ public class UserPojo {
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.put().description(&quot;Updates or create a user&quot;).type(User.class)
     .param().name(&quot;body&quot;).type(body).description(&quot;The user to update or create&quot;).endParam()
     .to(&quot;bean:userService?method=updateUser&quot;)]]></script>
-</div></div><p>&#160;</p><p>For an example see the&#160;<code>examples/camel-example-servlet-rest-tomcat</code>&#160;of 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>
+</div></div><p>&#160;</p><p>For an example see the&#160;<code>examples/camel-example-servlet-rest-tomcat</code>&#160;of 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-java.html">Swagger Java</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">

Added: websites/production/camel/content/swagger-java.html
==============================================================================
--- websites/production/camel/content/swagger-java.html (added)
+++ websites/production/camel/content/swagger-java.html Fri Oct  2 06:18:47 2015
@@ -0,0 +1,250 @@
+<!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 type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+
+    <title>
+    Apache Camel: Swagger Java
+    </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="components.html">Components</a>&nbsp;&gt;&nbsp;<a href="swagger-java.html">Swagger Java</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="SwaggerJava-SwaggerJavaComponent">Swagger Java Component</h2><p><strong>Available as of Camel 2.16</strong></p><p>The &#160;<a shape="rect" href="rest-dsl.html">Rest DSL</a>&#160;can be integrated with the&#160;<code>camel-swagger-java</code>&#160;module which is used for exposing the REST services and their APIs using <a shape="rect" class="external-link" href="http://swagger.wordnik.com/" rel="nofollow">Swagger</a>.</p><p>Maven users will need to add the following dependency to their&#160;<code>pom.xml</code>&#160;for this component:</p><p>From&#160;<strong>Camel 2.16</strong> onwards the swagger component is purely Java based, and its&#160;</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[&lt;dependency&gt;
+    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
+    &lt;artifactId&gt;camel-swagger-java&lt;/artifactId&gt;
+    &lt;version&gt;x.x.x&lt;/version&gt;
+    &lt;!-- use the same version as your Camel core version --&gt;
+&lt;/dependency&gt;
+]]></script>
+</div></div><p>&#160;</p><p>The camel-swagger-java module can be used as a Servlet or directly from the REST components (without the need for servlet)</p><p>&#160;For an example see the&#160;<code style="line-height: 1.42857;">camel-example-swagger-cdi</code> in the examples directory of the Apache Camel distribution.</p><p>&#160;</p><h3 id="SwaggerJava-UsingSwaggerasaServlet">Using Swagger as a Servlet</h3><p>You configure the swagger in the web.xml as shown below:</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[  &lt;servlet&gt;
+ 
+    &lt;servlet-name&gt;SwaggerServlet&lt;/servlet-name&gt;
+    &lt;servlet-class&gt;org.apache.camel.swagger.servlet.RestSwaggerServlet&lt;/servlet-class&gt;
+
+    &lt;init-param&gt;
+      &lt;!-- we specify the base.path using relative notation, that means the actual path will be calculated at runtime as
+           http://server:port/contextpath/rest --&gt;
+      &lt;param-name&gt;base.path&lt;/param-name&gt;
+      &lt;param-value&gt;rest&lt;/param-value&gt;
+    &lt;/init-param&gt;
+    &lt;init-param&gt;
+      &lt;!-- we specify the api.path using relative notation, that means the actual path will be calculated at runtime as
+           http://server:port/contextpath/api-docs --&gt;
+      &lt;param-name&gt;api.path&lt;/param-name&gt;
+      &lt;param-value&gt;api-docs&lt;/param-value&gt;
+    &lt;/init-param&gt;
+
+    &lt;init-param&gt;
+      &lt;param-name&gt;api.version&lt;/param-name&gt;
+      &lt;param-value&gt;1.2.3&lt;/param-value&gt;
+    &lt;/init-param&gt;
+    &lt;init-param&gt;
+      &lt;param-name&gt;api.title&lt;/param-name&gt;
+      &lt;param-value&gt;User Services&lt;/param-value&gt;
+    &lt;/init-param&gt;
+    &lt;init-param&gt;
+      &lt;param-name&gt;api.description&lt;/param-name&gt;
+      &lt;param-value&gt;Camel Rest Example with Swagger that provides an User REST service&lt;/param-value&gt;
+    &lt;/init-param&gt;
+    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
+  &lt;/servlet&gt;
+
+  &lt;!-- swagger api --&gt;
+  &lt;servlet-mapping&gt;
+    &lt;servlet-name&gt;SwaggerServlet&lt;/servlet-name&gt;
+    &lt;url-pattern&gt;/api-docs/*&lt;/url-pattern&gt;
+  &lt;/servlet-mapping&gt;]]></script>
+</div></div><h3 id="SwaggerJava-UsingSwaggerinrest-dsl">Using Swagger in rest-dsl</h3><p>You can enable the swagger api from the rest-dsl by configuring the <code>apiContextPath</code>&#160;dsl as shown below:</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[public class UserRouteBuilder extends RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+        // configure we want to use servlet as the component for the rest DSL
+        // and we enable json binding mode
+        restConfiguration().component(&quot;netty4-http&quot;).bindingMode(RestBindingMode.json)
+            // and output using pretty print
+            .dataFormatProperty(&quot;prettyPrint&quot;, &quot;true&quot;)
+            // setup context path and port number that netty will use
+            .contextPath(&quot;/&quot;).port(8080)
+            // add swagger api-doc out of the box
+            .apiContextPath(&quot;/api-doc&quot;)
+                .apiProperty(&quot;api.title&quot;, &quot;User API&quot;).apiProperty(&quot;api.version&quot;, &quot;1.2.3&quot;)
+                // and enable CORS
+                .apiProperty(&quot;cors&quot;, &quot;true&quot;);
+
+        // this user REST service is json only
+        rest(&quot;/user&quot;).description(&quot;User rest service&quot;)
+            .consumes(&quot;application/json&quot;).produces(&quot;application/json&quot;)
+            .get(&quot;/{id}&quot;).description(&quot;Find user by id&quot;).outType(User.class)
+                .param().name(&quot;id&quot;).type(path).description(&quot;The id of the user to get&quot;).dataType(&quot;int&quot;).endParam()
+                .to(&quot;bean:userService?method=getUser(${header.id})&quot;)
+            .put().description(&quot;Updates or create a user&quot;).type(User.class)
+                .param().name(&quot;body&quot;).type(body).description(&quot;The user to update or create&quot;).endParam()
+                .to(&quot;bean:userService?method=updateUser&quot;)
+            .get(&quot;/findAll&quot;).description(&quot;Find all users&quot;).outTypeList(User.class)
+                .to(&quot;bean:userService?method=listUsers&quot;);
+    }
+}]]></script>
+</div></div><p>&#160;</p><h3 id="SwaggerJava-Options">Options</h3><p>The swagger module can be configured using the following options. To configure using a servlet you use the init-param as shown above. When configuring directly in the rest-dsl, you use the&#160;<code>apiProperty</code> dsl.</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</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">cors</td><td colspan="1" rowspan="1" class="confluenceTd">Boolean</td><td colspan="1" rowspan="1" class="confluenceTd">Whether to enable CORS. Notice this only enables CORS for the api browser, and not the actual access to the REST services. Is default false.<br clear="none">Instead of using this option is recommended to use the CorsFilt
 e, see further below.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">swagger.version</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">Swagger spec version. Is default 2.0.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">host</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">To setup the hostname. If not configured camel-swagger-java will calculate the name as localhost based.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">schemas</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">The protocol schemas to use. Multiple values can be separated by comma such as "http,https". The default value is "http".</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">base.path<p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td cols
 pan="1" rowspan="1" class="confluenceTd"><p><strong>Required</strong>: To setup the base path where the REST services is available. The path is relative (eg do not start with http/https) and camel-swagger-java will calculate the absolute base path at runtime, which will be</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[protocol://host:port/context-path/base.path]]></script>
+</div></div></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.path</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>To setup the path where the API is available (eg /api-docs). The path is relative <span>(eg do not start with http/https) and camel-swagger-java will calculate the absolute base path at runtime, which will be </span></span></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[protocol://host:port/context-path/api.path]]></script>
+</div></div><p><span><span>So using relative paths is much easier. See above for an example.</span></span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.version</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd"><span>The version of the api. Is default 0.0.0.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.title</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd"><span>The title of the application.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.description</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd"><span>A short description of the application.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.<span>termsOfService</span></td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1
 " rowspan="1" class="confluenceTd"><span>A URL to the Terms of Service of the API.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.contact.name</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">Name of person or organization to contact</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.contact.email</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd"><span>An email to be used for API-related correspondence.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.contact.url</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">A URL to a website for more contact information.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.license.name</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" clas
 s="confluenceTd"><span>The license name used for the API.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">api.license.url</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd"><span>A URL to the license used for the API.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">apiContextIdListing</td><td colspan="1" rowspan="1" class="confluenceTd">boolean</td><td colspan="1" rowspan="1" class="confluenceTd">Whether to allow listing all the CamelContext names in the JVM that has REST services. When enabled then the root path of the api-doc will list all the contexts. When disabled then no context ids is listed and the root path of the api-doc lists the current CamelContext. Is default false.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">apiContextIdPattern</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">A pattern
  that allows to filter which CamelContext names is shown in the context listing. The pattern is using regular expression and * as wildcard. Its the same pattern matching as used by <a shape="rect" href="intercept.html">Intercept</a></td></tr></tbody></table></div></div><h3 id="SwaggerJava-CorsFilter">CorsFilter</h3><p>If you use the swagger ui to view the REST api then you likely need to enable support for CORS. This is needed if the swagger ui is hosted and running on another hostname/port than the actual REST apis. When doing this the swagger ui needs to be allowed to access the REST resources across the origin (CORS). The CorsFilter adds the necessary HTTP headers to enable CORS.</p><p>To use CORS adds the following filter <code>org.apache.camel.swagger.servlet.RestSwaggerCorsFilter</code> to your web.xml.</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[  &lt;!-- enable CORS filter so people can use swagger ui to browse and test the apis --&gt;
+  &lt;filter&gt;
+    &lt;filter-name&gt;RestSwaggerCorsFilter&lt;/filter-name&gt;
+    &lt;filter-class&gt;org.apache.camel.swagger.rest.RestSwaggerCorsFilter&lt;/filter-class&gt;
+  &lt;/filter&gt;
+
+
+  &lt;filter-mapping&gt;
+    &lt;filter-name&gt;RestSwaggerCorsFilter&lt;/filter-name&gt;
+    &lt;url-pattern&gt;/api-docs/*&lt;/url-pattern&gt;
+    &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
+  &lt;/filter-mapping&gt;]]></script>
+</div></div><p>The CorsFilter sets the following headers for all requests</p><ul><li>Access-Control-Allow-Origin = *</li><li>Access-Control-Allow-Methods =&#160;GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH</li><li>Access-Control-Max-Age = 3600</li><li>Access-Control-Allow-Headers =&#160;Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers</li></ul><p><span style="color: rgb(52,48,45);">Notice this is a very simple CORS filter. You may need to use a more sophisticated filter to set the header values differently for a given client. Or block certain clients etc.</span></p><h3 id="SwaggerJava-ContextIdListingenabled">ContextIdListing enabled</h3><p>When contextIdListing is enabled then its detecting all the running CamelContexts in the same JVM. These contexts are listed in the root path, eg `/api-docs` as a simple list of names in json format. To access the swagger documentation then the context-path must be appen
 ded with the Camel context id, such as `api-docs/myCamel`. The option&#160;apiContextIdPattern can be used to filter the names in this list.</p><h3 id="SwaggerJava-Examples">Examples</h3><p>In the Apache Camel distribution we ship the&#160;<code>camel-example-swagger-cdi</code>&#160;and <code>camel-example-swagger-java</code>&#160;which demonstrates using this Swagger component.</p><div><span style="white-space: pre-wrap;"><br clear="none"></span></div></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=61321758">edit page</a>)
+   	 (<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61321758&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>
+
+

Modified: websites/production/camel/content/swagger.html
==============================================================================
--- websites/production/camel/content/swagger.html (original)
+++ websites/production/camel/content/swagger.html Fri Oct  2 06:18:47 2015
@@ -84,23 +84,14 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="Swagger-SwaggerComponent">Swagger Component</h2><p><strong>Available as of Camel 2.14</strong></p><p>The &#160;<a shape="rect" href="rest-dsl.html">Rest DSL</a>&#160;can be integrated with the&#160;<code>camel-swagger</code> module which is used for exposing the REST services and their APIs using <a shape="rect" class="external-link" href="http://swagger.wordnik.com/" rel="nofollow">Swagger</a>.</p><p>Maven users will need to add the following dependency to their&#160;<code>pom.xml</code>&#160;for this component:</p><p>From&#160;<strong>Camel 2.16</strong> onwards the swagger component is purely Java based, and its&#160;</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[&lt;dependency&gt;
-    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
-    &lt;artifactId&gt;camel-swagger-java&lt;/artifactId&gt;
-    &lt;version&gt;x.x.x&lt;/version&gt;
-    &lt;!-- use the same version as your Camel core version --&gt;
-&lt;/dependency&gt;
-]]></script>
-</div></div><p>And the old Scala based camel-swagger module is deprecated, and to be removed in a future release.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2 id="Swagger-SwaggerScalaComponent(deprecated)">Swagger Scala Component (deprecated)</h2><p><strong>Available as of Camel 2.14</strong></p><p>The &#160;<a shape="rect" href="rest-dsl.html">Rest DSL</a>&#160;can be integrated with the&#160;<code>camel-swagger</code> module which is used for exposing the REST services and their APIs using <a shape="rect" class="external-link" href="http://swagger.wordnik.com/" rel="nofollow">Swagger</a>.</p><p>Maven users will need to add the following dependency to their&#160;<code>pom.xml</code>&#160;for this component:</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This component is deprecated. From Camel 2.16 onwards use the new Java based swagger module <a shape="rect" href="swagger-java.html">Swagger Java</a></p></div></div><
 p>The Scala based camel-swagger module is deprecated, and to be removed in a future release.</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[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-swagger&lt;/artifactId&gt;
     &lt;version&gt;x.x.x&lt;/version&gt;
     &lt;!-- use the same version as your Camel core version --&gt;
-&lt;/dependency&gt;
-]]></script>
-</div></div><h3 id="Swagger-UsingwithCamel2.16onwards">Using with Camel 2.16 onwards</h3><p>The name of the servlet is&#160;<code>org.apache.camel.swagger.servlet.RestSwaggerServlet</code>.</p><p>However some of the Camel components is able to support Swagger API documentation out of the box without having to use a servlet container. For example these components: <a shape="rect" href="jetty.html">Jetty</a>,&#160;<a shape="rect" href="netty-http.html">Netty HTTP</a>,&#160;<a shape="rect" href="netty-http.html">Netty HTTP</a>,&#160;<a shape="rect" href="undertow.html">Undertow</a>. This allows to provide Swagger API in standalone containers that has no servlet container. For an example see the&#160;<code>camel-example-swagger-cdi</code> in the examples directory of the Apache Camel distribution.</p><h3 id="Swagger-UsingwithCamel2.15onwards">Using with Camel 2.15 onwards</h3><p>The default servlet supports any environment using JMX to discover the CamelContext(s) to use.</p><p>The name
  of the servlet is&#160;<code>org.apache.camel.component.swagger.DefaultCamelSwaggerServlet</code>.</p><h3 id="Swagger-UsingwithCamel2.14.x">Using with Camel 2.14.x</h3><p>The Swagger servlet is integrated with Spring or&#160;<a shape="rect" href="servletlistener-component.html">ServletListener Component</a>.&#160;</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Component</th><th colspan="1" rowspan="1" class="confluenceTh">Servlet ClassName</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">spring</td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServlet</code>&#160;</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">servletlistener</td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.apache.camel.component.swagger.servletlistener.ServletListenerRestSwaggerApiDeclarationServlet</code></td></tr></tbody
 ></table></div><p>The servlet support the same options when using spring or servletlistener.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The servlets above from Camel 2.14.x is deprecated and replaced with a single default servlet from Camel 2.15 onwards.</p></div></div><p>&#160;</p><p>For example when using Spring you need to configure the&#160;<code>org.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServlet</code>&#160;in the&#160;<code>WEB-INF/web.xml</code>&#160;file as shown below:</p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If you use Camel 2.15 onwards then just use the default servlet in an
 y kind of environment.</p></div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+&lt;/dependency&gt;]]></script>
+</div></div><h3 id="Swagger-UsingwithCamel2.15.x">Using with Camel 2.15.x</h3><p>The default servlet supports any environment using JMX to discover the CamelContext(s) to use.</p><p>The name of the servlet is&#160;<code>org.apache.camel.component.swagger.DefaultCamelSwaggerServlet</code>.</p><h3 id="Swagger-UsingwithCamel2.14.x">Using with Camel 2.14.x</h3><p>The Swagger servlet is integrated with Spring or&#160;<a shape="rect" href="servletlistener-component.html">ServletListener Component</a>.&#160;</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Component</th><th colspan="1" rowspan="1" class="confluenceTh">Servlet ClassName</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">spring</td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServlet</code>&#160;</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">servlet
 listener</td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.apache.camel.component.swagger.servletlistener.ServletListenerRestSwaggerApiDeclarationServlet</code></td></tr></tbody></table></div><p>The servlet support the same options when using spring or servletlistener.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The servlets above from Camel 2.14.x is deprecated and replaced with a single default servlet from Camel 2.15 onwards.</p></div></div><p>&#160;</p><p>For example when using Spring you need to configure the&#160;<code>org.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServlet</code>&#160;in the&#160;<code>WEB-INF/web.xml</code>&#160;file as shown below:</p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-ico
 n-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If you use Camel 2.15 onwards then just use the default servlet in any kind of environment.</p></div></div><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[  &lt;!-- to setup Camel Swagger api servlet when using Spring --&gt;
   &lt;servlet&gt;
  
@@ -174,7 +165,7 @@
     &lt;url-pattern&gt;/api-docs/*&lt;/url-pattern&gt;
     &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
   &lt;/filter-mapping&gt;]]></script>
-</div></div><p>The CorsFilter sets the following headers for all requests</p><ul><li>Access-Control-Allow-Origin = *</li><li>Access-Control-Allow-Methods =&#160;GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH</li><li>Access-Control-Max-Age = 3600</li><li>Access-Control-Allow-Headers =&#160;Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers</li></ul><p><span style="color: rgb(52,48,45);">Notice this is a very simple CORS filter. You may need to use a more sophisticated filter to set the header values differently for a given client. Or block certain clients etc.</span></p><h3 id="Swagger-MultipleCamelContexts">Multiple CamelContexts</h3><p><strong>Available as of Camel 2.16</strong></p><p>When using camel-swagger from Camel 2.16 onwards then it supports detecting all the running CamelContexts in the same JVM. These contexts are listed in the root path, eg `/api-docs` as a simple list of names in json format. To ac
 cess the swagger documentation then the context-path must be appended with the Camel context id, such as `api-docs/myCamel`.</p><p>&#160;</p><h3 id="Swagger-Examples">Examples</h3><p>In the Apache Camel distribution we ship the&#160;<code>camel-example-servlet-rest-tomcat</code> which demonstrates using this Swagger component.</p><div><span style="white-space: pre-wrap;"><br clear="none"></span></div></div>
+</div></div><p>The CorsFilter sets the following headers for all requests</p><ul><li>Access-Control-Allow-Origin = *</li><li>Access-Control-Allow-Methods =&#160;GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH</li><li>Access-Control-Max-Age = 3600</li><li>Access-Control-Allow-Headers =&#160;Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers</li></ul><p><span style="color: rgb(52,48,45);">Notice this is a very simple CORS filter. You may need to use a more sophisticated filter to set the header values differently for a given client. Or block certain clients etc.</span></p><h3 id="Swagger-MultipleCamelContexts">Multiple CamelContexts</h3><p><strong>Available as of Camel 2.16</strong></p><p>When using camel-swagger from Camel 2.16 onwards then it supports detecting all the running CamelContexts in the same JVM. These contexts are listed in the root path, eg `/api-docs` as a simple list of names in json format. To ac
 cess the swagger documentation then the context-path must be appended with the Camel context id, such as `api-docs/myCamel`.</p><h3 id="Swagger-Examples">Examples</h3><p>In the Apache Camel distribution we ship the&#160;<code>camel-example-servlet-rest-tomcat</code> which demonstrates using this Swagger component.</p><h3 id="Swagger-SeeAlso">See Also</h3><ul style="list-style-type: square;"><li><a shape="rect" href="swagger-java.html">Swagger Java</a></li></ul><p>&#160;</p><div><span style="white-space: pre-wrap;"><br clear="none"></span></div></div>
         </td>
         <td valign="top">
           <div class="navigation">




Mime
View raw message