Author: gertv
Date: Tue Feb 1 21:27:31 2011
New Revision: 1066224
URL: http://svn.apache.org/viewvc?rev=1066224&view=rev
Log:
Adding some info about Blueprint XML to the Camel User Guide
Added:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/index.conf
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/osgi-bundle.conf
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-blueprint.conf
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-spring.conf
Removed:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/camel-deployment.conf
Modified:
servicemix/documentation/trunk/pom.xml
servicemix/documentation/trunk/src/main/scala/org/apache/servicemix/documentation/Helper.scala
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/camel-guide.pdf.conf
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/index.conf
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/toc.ssp
servicemix/documentation/trunk/src/test/scala/org/apache/servicemix/documentation/HelperTest.scala
Modified: servicemix/documentation/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/pom.xml?rev=1066224&r1=1066223&r2=1066224&view=diff
==============================================================================
--- servicemix/documentation/trunk/pom.xml (original)
+++ servicemix/documentation/trunk/pom.xml Tue Feb 1 21:27:31 2011
@@ -50,6 +50,7 @@
<scalate.mode>production</scalate.mode>
<scalate.workdir>${basedir}/target/scalateWorkDir</scalate.workdir>
+ <camel.version>2.6.0</camel.version>
<components.version>2011.01-SNAPSHOT</components.version>
<karaf.version>2.1.99-SNAPSHOT</karaf.version>
<servicemix.version>4.3.0-SNAPSHOT</servicemix.version>
Modified:
servicemix/documentation/trunk/src/main/scala/org/apache/servicemix/documentation/Helper.scala
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/scala/org/apache/servicemix/documentation/Helper.scala?rev=1066224&r1=1066223&r2=1066224&view=diff
==============================================================================
---
servicemix/documentation/trunk/src/main/scala/org/apache/servicemix/documentation/Helper.scala
(original)
+++
servicemix/documentation/trunk/src/main/scala/org/apache/servicemix/documentation/Helper.scala
Tue Feb 1 21:27:31 2011
@@ -29,17 +29,21 @@ object Helper {
val SEPARATOR = "/"
/**
- * Determine the right toc file to include for a given uri
+ * No TOCs can be found in subfolders of the folders listed here
*/
- def toc(uri: String): String = toc(uri, !uri.startsWith("/jbi"))
+ val PATH_LIMITS = Array("/jbi", "/users-guide/camel")
- def toc(uri: String, recursive: Boolean) = {
- val elements = uri.substring(1).split(SEPARATOR).toSeq
- val include = recursive match {
- case true => elements.take(elements.size - 1)
- case false => elements.take(1)
+ /**
+ * Determine the right toc file to include for a given uri
+ */
+ def toc(uri: String): String = {
+ PATH_LIMITS.find(limit => uri.startsWith(limit)) match {
+ case Some(limit) => limit + TOC
+ case None => {
+ val elements = uri.substring(1).split(SEPARATOR).toSeq
+ elements.take(elements.size - 1).mkString(SEPARATOR, SEPARATOR, TOC)
+ }
}
- include.mkString(SEPARATOR, SEPARATOR, TOC)
}
/**
Modified:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/camel-guide.pdf.conf
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/webapp/users-guide/camel/camel-guide.pdf.conf?rev=1066224&r1=1066223&r2=1066224&view=diff
==============================================================================
---
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/camel-guide.pdf.conf
(original)
+++
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/camel-guide.pdf.conf
Tue Feb 1 21:27:31 2011
@@ -1,5 +1,11 @@
{attributes:layout=/WEB-INF/scalate/layouts/print.ssp}
-{attributes:title=User's Manual}
+{attributes:title=Camel User Guide}
+h1. Introduction
{include:users-guide/camel/index.conf}
-{include:users-guide/camel/camel-deployment.conf}
+
+h1. Deployment options
+{include:users-guide/camel/deployment/index.conf}
+{include:users-guide/camel/deployment/plain-spring.conf}
+{include:users-guide/camel/deployment/plain-blueprint.conf}
+{include:users-guide/camel/deployment/osgi-bundle.conf}
Added:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/index.conf
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/index.conf?rev=1066224&view=auto
==============================================================================
---
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/index.conf
(added)
+++
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/index.conf
Tue Feb 1 21:27:31 2011
@@ -0,0 +1,8 @@
+There are a few different ways to deploy Camel routes on ServiceMix
${servicemix.version}:
+* deploy routes in a plain Blueprint XML file
+* deploy routes in a plain Spring XML file
+* deploy a bundle containing a Blueprint XML file
+* deploy a bundle containing a Spring XML file
+
+Camel routes can also be deployed as part of a JBI SA, allowing you use Camel
for routing between JBI endpoints - this option will be discussed later when we
are talking about using JBI inside ServiceMix 4.
+
Added:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/osgi-bundle.conf
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/osgi-bundle.conf?rev=1066224&view=auto
==============================================================================
---
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/osgi-bundle.conf
(added)
+++
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/osgi-bundle.conf
Tue Feb 1 21:27:31 2011
@@ -0,0 +1,60 @@
+h2. Deploy as an OSGi bundle
+
+Using an OSGi bundle to deploy your Camel routes allows you to use the Java or
Scala DSL for defining your routes. The routes are still being started by a
Spring or Blueprint XML file, which is included inside the OSGi bundle.
+
+h3. Using Spring
+When using Spring to start your Camel routes, you include your Spring XML file
(e.g. {{camel-context.xml}}) in the {{META-INF/spring}} folder inside your
bundle. After the bundle has been activated, the Spring DM extender will find,
create and start your Spring ApplicationContexts.
+{noformat}
++ <bundle classes, incl. your RouteBuilder>
+\- META-INF
+ |- MANIFEST.MF
+ \- spring
+ \- camel-context.xml
+{noformat}
+
+Example: If your RouteBuilder classes have been defined in the
{{org.apache.servicemix.manual.camel}} package, the file would look like this:
+{pygmentize:lang=xml}
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://camel.apache.org/schema/spring
+
http://camel.apache.org/schema/spring/camel-spring-${camel-version}.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <package>org.apache.servicemix.manual.camel</package>
+ </camelContext>
+
+</beans>
+{pygmentize}
+
+h3. Using Blueprint
+When using Blueprint to start your Camel routes, the Blueprint XML files have
to be included in the bundle inside the {{OSGI-INF/blueprint}} directory.
+{noformat}
++ <bundle classes, incl. your RouteBuilder>
+|- META-INF
+| |- MANIFEST.MF
+\- OSGI-INF
+ \- blueprint
+ \- camel-context.xml
+{noformat}
+
+Example: If your RouteBuilder classes have been defined in the
{{org.apache.servicemix.manual.camel}} package, the file would look like this:
+{pygmentize:lang=xml}
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint
+ xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0
+ http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <package>org.apache.servicemix.manual.camel</package>
+ </camelContext>
+
+</blueprint>
+{pygmentize}
\ No newline at end of file
Added:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-blueprint.conf
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-blueprint.conf?rev=1066224&view=auto
==============================================================================
---
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-blueprint.conf
(added)
+++
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-blueprint.conf
Tue Feb 1 21:27:31 2011
@@ -0,0 +1,41 @@
+h2. Deploy as a plain Blueprint XML file
+ServiceMix ${servicemix.version} supports the deployment of plain Blueprint
XML files, automatically creating and starting the Blueprint container from the
XML file.
+
+In order to leverage this feature to create and start Camel routes, drop a
file with this syntax in the {{$SERVICEMIX_HOME/deploy}} folder:
+{pygmentize:lang=xml}
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint
+ xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0
+ http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <!-- add Camel routes, interceptors,... here -->
+ </camelContext>
+
+</blueprint>
+{pygmentize}
+
+h3. An example
+Just create a new XML file in the deploy folder with the code below to start a
route to copy files from one directory to another.
+{pygmentize:lang=xml}
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint
+ xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0
+ http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <route>
+ <from uri="file:input"/>
+ <log message="Copying ${file:name} to the output directory"/>
+ <to uri="file:output"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+{pygmentize}
\ No newline at end of file
Added:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-spring.conf
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-spring.conf?rev=1066224&view=auto
==============================================================================
---
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-spring.conf
(added)
+++
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/deployment/plain-spring.conf
Tue Feb 1 21:27:31 2011
@@ -0,0 +1,45 @@
+h2. Deploy as a plain Spring XML file
+ServiceMix ${servicemix.version} supports the deployment of plain Spring XML
files, automatically creating and starting the Spring ApplicationContext from
the XML file.
+
+In order to leverage this feature to create and start Camel routes, drop a
file with this syntax in the {{$SERVICEMIX_HOME/deploy}} folder:
+{pygmentize:lang=xml}
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://camel.apache.org/schema/spring
+
http://camel.apache.org/schema/spring/camel-spring-${camel.version}.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <!-- add Camel routes, interceptors,... here -->
+ </camelContext>
+
+</beans>
+{pygmentize}
+
+h3. An example
+Just create a new XML file in the deploy folder with the code below to start a
route to copy files from one directory to another.
+{pygmentize:lang=xml}
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://camel.apache.org/schema/spring
+
http://camel.apache.org/schema/spring/camel-spring-${camel.version}.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="file:input"/>
+ <log message="Copying ${file:name} to the output directory"/>
+ <to uri="file:output"/>
+ </route>
+ </camelContext>
+
+</beans>
+{pygmentize}
\ No newline at end of file
Modified:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/index.conf
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/webapp/users-guide/camel/index.conf?rev=1066224&r1=1066223&r2=1066224&view=diff
==============================================================================
--- servicemix/documentation/trunk/src/main/webapp/users-guide/camel/index.conf
(original)
+++ servicemix/documentation/trunk/src/main/webapp/users-guide/camel/index.conf
Tue Feb 1 21:27:31 2011
@@ -1 +1,20 @@
-h1. Using Camel
\ No newline at end of file
+Apache Camel is a powerful open source integration framework based on known
Enterprise Integration Patterns with powerful Bean Integration.
+
+h2. Camel in ServiceMix
+In ServiceMix, Apache Camel is like our swiss army knife for creating
integration solutions. It allows using XML or a Java/Scala-based DSL to
express your routes, comes with over 70 optional components, has powerful and
versatile Java bean integration, error handling, ... and tons of other features.
+
+Apache Camel is installed by default if you first start the container. We
also have out-of-the-box hot-deployment support for both Spring and Blueprint
to make it easy to deploy your own Camel routes, as well as optionally
installable features for all the available Camel components.
+
+h2. Goal of this guide
+
+The goal of this guide is to look into the details for using Camel inside
ServiceMix:
+* deployment options
+* installing additional components
+
+h2. More information about Camel
+
+More information about Camel itself, can be found on http://camel.apache.org.
+
+There's also a great book available about Camel:
+* Ibsen, Claus, and Anstey, Jonathan. (December 2010). _Camel in Action_.
Greenwich, CT: Manning. ISBN: 9781935182368.
+
Modified:
servicemix/documentation/trunk/src/main/webapp/users-guide/camel/toc.ssp
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/main/webapp/users-guide/camel/toc.ssp?rev=1066224&r1=1066223&r2=1066224&view=diff
==============================================================================
--- servicemix/documentation/trunk/src/main/webapp/users-guide/camel/toc.ssp
(original)
+++ servicemix/documentation/trunk/src/main/webapp/users-guide/camel/toc.ssp
Tue Feb 1 21:27:31 2011
@@ -2,7 +2,13 @@
<li id="camel">
<a href="${uri("/users-guide/camel/index.html")}">Using Camel</a>
<ul>
- <li id="camel-deploy"><a
href="${uri("/users-guide/camel/camel-deployment.html")}">Deployment
options</a></li>
+ <li id="camel-deploy"><a
href="${uri("/users-guide/camel/deployment/index.html")}">Deployment options</a>
+ <ul>
+ <li id="plain-blueprint"><a
href="${uri("/users-guide/camel/deployment/plain-blueprint.html")}">Plain
Blueprint XML</a></li>
+ <li id="plain-spring"><a
href="${uri("/users-guide/camel/deployment/plain-spring.html")}">Plain Spring
XML</a></li>
+ <li id="osgi-bundle"><a
href="${uri("/users-guide/camel/deployment/osgi-bundle.html")}">OSGi
Bundle</a></li>
+ </ul>
+ </li>
</ul>
</li>
</ul>
\ No newline at end of file
Modified:
servicemix/documentation/trunk/src/test/scala/org/apache/servicemix/documentation/HelperTest.scala
URL:
http://svn.apache.org/viewvc/servicemix/documentation/trunk/src/test/scala/org/apache/servicemix/documentation/HelperTest.scala?rev=1066224&r1=1066223&r2=1066224&view=diff
==============================================================================
---
servicemix/documentation/trunk/src/test/scala/org/apache/servicemix/documentation/HelperTest.scala
(original)
+++
servicemix/documentation/trunk/src/test/scala/org/apache/servicemix/documentation/HelperTest.scala
Tue Feb 1 21:27:31 2011
@@ -33,7 +33,7 @@ class HelperTest {
assertValidToc("/users-guide/toc.ssp", "/users-guide/index.conf")
assertValidToc("/users-guide/camel/toc.ssp",
"/users-guide/camel/index.conf")
assertValidToc("/jbi/toc.ssp", "/jbi/components/index.html")
-
+ assertValidToc("/users-guide/camel/toc.ssp",
"/users-guide/camel/deployment/osgi-bundle.conf")
}
@Test