camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r981569 - in /websites/production/camel/content: cache/main.pageCache gridfs.html
Date Tue, 01 Mar 2016 22:18:54 GMT
Author: buildbot
Date: Tue Mar  1 22:18:54 2016
New Revision: 981569

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/gridfs.html

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

Modified: websites/production/camel/content/gridfs.html
==============================================================================
--- websites/production/camel/content/gridfs.html (original)
+++ websites/production/camel/content/gridfs.html Tue Mar  1 22:18:54 2016
@@ -36,6 +36,16 @@
     <![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: GridFS
@@ -75,7 +85,44 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"></div>
+<div class="wiki-content maincontent"><h2 id="GridFS-CamelGridFScomponent">Camel
GridFS component</h2><p><strong>Available as of Camel 2.17</strong></p><p>Maven
users will need to add the following dependency to their <code>pom.xml</code>
for this component:</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;dependency&gt;
+    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
+    &lt;artifactId&gt;camel-gridfs&lt;/artifactId&gt;
+    &lt;version&gt;x.y.z&lt;/version&gt;
+    &lt;!-- use the same version as your Camel core version --&gt;
+&lt;/dependency&gt;
+]]></script>
+</div></div><h2 id="GridFS-URIformat">URI format</h2><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[gridfs:connectionBean?database=databaseName&amp;bucket=bucketName[&amp;moreOptions...]
+]]></script>
+</div></div><h2 id="GridFS-Endpointoptions">Endpoint options</h2><p>GridFS
endpoints support the following options, depending on whether they are acting like a Producer
or as a Consumer (options vary based on the consumer type too).</p><p>&#160;</p><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><th colspan="1" rowspan="1"
class="confluenceTh"><p>Producer</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Consumer</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>database</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Required.</strong> The name
of the database to which this endpoint will be bound. All operations will be executed aga
 inst this database.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img
class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png"
data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png"
data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>bucket</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>fs</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>The name of the GridFS bucket within the Database.
The default is the GridFS.DEFAULT_BUCKET value ("fs").</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache
 .org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png"
data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png"
data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>operation</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>create</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The id of the operation this endpoint
will execute. Pick from the following:</p><ul><li>Query operations: <code>findOne</code>,
<code>listAll</code>, <code>count</code></li><li>Write
operations: <code>create</code></li><li>Delete operations: <code>remove</code></li></ul></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tic
 k" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png"
data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>&#160;</p></td></tr></tbody></table></div><h2
id="GridFS-ConfigurationofdatabaseinSpringXML">Configuration of database in Spring XML</h2><p>The
following Spring XML creates a bean defining the connection to a MongoDB instance.</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;beans
xmlns=&quot;http://www.springframework.org/schema/beans&quot;
+    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+    xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd&quot;&gt;
+    &lt;bean id=&quot;mongoBean&quot; class=&quot;com.mongodb.Mongo&quot;&gt;
+        &lt;constructor-arg name=&quot;host&quot; value=&quot;${mongodb.host}&quot;
/&gt;
+        &lt;constructor-arg name=&quot;port&quot; value=&quot;${mongodb.port}&quot;
/&gt;
+    &lt;/bean&gt;
+&lt;/beans&gt;]]></script>
+</div></div><h3 id="GridFS-Sampleroute">Sample route</h3><p>The
following route defined in Spring XML executes the operation <a shape="rect" href="#GridFS-findOne">
<strong>findOne</strong> </a> on a collection.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>Get a file from GridFS</b></div><div class="codeContent panelContent
pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
+  &lt;from uri=&quot;direct:start&quot; /&gt;
+  &lt;!-- using bean &#39;mongoBean&#39; defined above --&gt;
+  &lt;to uri=&quot;gridfs:mongoBean?database=${mongodb.database}&amp;amp;operation=findOne&quot;
/&gt;
+  &lt;to uri=&quot;direct:result&quot; /&gt;
+&lt;/route&gt;]]></script>
+</div></div><p>&#160;</p><h2 id="GridFS-GridFSoperations-producerendpoints">GridFS
operations - producer endpoints</h2><h3 id="GridFS-Queryoperations">Query operations</h3><h4
id="GridFS-count">count</h4><p>Returns the total number of file in the collection,
returning a Long as the OUT message body.<br clear="none"><br clear="none"></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:count&quot;).to(&quot;gridfs?database=tickets&amp;operation=count&quot;);
+Long result = template.requestBodyAndHeader(&quot;direct:count&quot;, &quot;irrelevantBody&quot;);
+assertTrue(&quot;Result is not of type Long&quot;, result instanceof Long);
+]]></script>
+</div></div><p>You can provide a filename header to provide a count of
files matching that filename.</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[Map&lt;String,
Object&gt; headers = new HashMap&lt;String, Object&gt;();
+headers.put(Exchange.FILE_NAME, &quot;filename.txt&quot;);
+Long count = template.requestBodyAndHeaders(&quot;direct:count&quot;, query, headers);
+]]></script>
+</div></div><h3 id="GridFS-GridFSConsumer">GridFS Consumer</h3><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>See
also</p><ul><li><a shape="rect" class="external-link" href="http://www.mongodb.org/"
rel="nofollow">MongoDB website</a></li><li><a shape="rect" class="external-link"
href="http://en.wikipedia.org/wiki/NoSQL" rel="nofollow">NoSQL Wikipedia article</a></li><li><a
shape="rect" class="external-link" href="http://api.mongodb.org/java/current/" rel="nofollow">MongoDB
Java driver API docs - current version</a></li><li><a shape="rect" class="external-link"
href="http://svn.apache.org/viewvc/camel/trunk/components/camel-mongodb/src/test/">Unit
tests</a> for more examples of usage</li></ul></div>
         </td>
         <td valign="top">
           <div class="navigation">



Mime
View raw message