Author: chirino
Date: Fri Jan 5 15:34:34 2007
New Revision: 493242
URL: http://svn.apache.org/viewvc?view=rev&rev=493242
Log:
Latest export from confluence
Modified:
incubator/servicemix/site/features.html
incubator/servicemix/site/xpath-router.html
Modified: incubator/servicemix/site/features.html
URL:
http://svn.apache.org/viewvc/incubator/servicemix/site/features.html?view=diff&rev=493242&r1=493241&r2=493242
==============================================================================
--- incubator/servicemix/site/features.html (original)
+++ incubator/servicemix/site/features.html Fri Jan 5 15:34:34 2007
@@ -154,10 +154,7 @@
<a href="javascript:hideChildren()">Hide Children</a></span>
</div>
<div class="greybox" id="children" style="display: none;">
- <a
href="http://goopen.org/confluence/display/SM/BeanFlow"
title="BeanFlow">BeanFlow</a>
- <span class="smalltext">(ServiceMix)</span>
- <br>
- <a
href="http://goopen.org/confluence/display/SM/Client+API" title="Client
API">Client API</a>
+ <a
href="http://goopen.org/confluence/display/SM/Client+API" title="Client
API">Client API</a>
<span class="smalltext">(ServiceMix)</span>
<br>
<a
href="http://goopen.org/confluence/display/SM/Visualisation"
title="Visualisation">Visualisation</a>
@@ -170,6 +167,9 @@
<span class="smalltext">(ServiceMix)</span>
<br>
<a
href="http://goopen.org/confluence/display/SM/Transformation"
title="Transformation">Transformation</a>
+ <span class="smalltext">(ServiceMix)</span>
+ <br>
+ <a
href="http://goopen.org/confluence/display/SM/BeanFlow"
title="BeanFlow">BeanFlow</a>
<span class="smalltext">(ServiceMix)</span>
<br>
</div>
Modified: incubator/servicemix/site/xpath-router.html
URL:
http://svn.apache.org/viewvc/incubator/servicemix/site/xpath-router.html?view=diff&rev=493242&r1=493241&r2=493242
==============================================================================
--- incubator/servicemix/site/xpath-router.html (original)
+++ incubator/servicemix/site/xpath-router.html Fri Jan 5 15:34:34 2007
@@ -140,19 +140,66 @@
<!--
<div class="pagetitle">XPath Router</div>
-->
- <DIV class="wiki-content">
-<P>Its often a requirement to perform <EM>content based routing</EM> in an
ESB. This means you route messages around your service bus based on the message
properties or the content of the messages. When integrating systems across
language boundaries its common to use XML as a universal message format; so
XPath is an ideal tool to perform content based routing and transformation.</P>
+ <DIV class="wiki-content"><P>Its often a requirement to perform
<EM>content based routing</EM> in an ESB. This means you route messages around
your service bus based on the message properties or the content of the
messages. When integrating systems across language boundaries its common to use
XML as a universal message format; so XPath is an ideal tool to perform content
based routing and transformation.</P>
<P>We support a XPath based routing and transformation mechanism designed for
high performance and power.</P>
<H3><A name="XPathRouter-Example"></A>Example</H3>
<P>The following is an example routing and transformation template. Firstly we
reuse the XSLT basd transform component.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><SPAN class="code-tag"><sm:activationSpec
componentName=<SPAN class="code-quote">"transformer"</SPAN>
service=<SPAN class="code-quote">"foo:transformer"</SPAN>></SPAN>
+ <SPAN class="code-tag"><sm:component></SPAN><SPAN
class="code-tag"><bean class=<SPAN
class="code-quote">"org.apache.servicemix.components.xslt.XsltComponent"</SPAN>></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"xsltResource"</SPAN> value=<SPAN
class="code-quote">"classpath:org/apache/servicemix/components/xslt/router.xsl"</SPAN>/></SPAN>
+
+ <!-- lets disable automatic output of the result of the transform; only
if we perform
+ an invoke in the XSLT will we invoke another endpoint -->
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"disableOutput"</SPAN> value=<SPAN
class="code-quote">"true"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN><SPAN
class="code-tag"></sm:component></SPAN>
+<SPAN class="code-tag"></sm:activationSpec></SPAN></PRE>
+</DIV></DIV>
<P> </P>
<P>Then we provide a file in XSLT format, with some JBI extensions</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><<SPAN class="code-keyword">xsl:stylesheet</SPAN>
<SPAN class="code-keyword">xmlns:xsl</SPAN>=<SPAN
class="code-quote">"http://www.w3.org/1999/XSL/Transform"</SPAN>
+ <SPAN class="code-keyword">xmlns:jbi</SPAN>=<SPAN
class="code-quote">"xalan://org.apache.servicemix.components.xslt.XalanExtension"</SPAN>
+ extension-element-prefixes=<SPAN class="code-quote">"jbi"</SPAN>
+
+ <SPAN class="code-keyword">xmlns:foo</SPAN>=<SPAN
class="code-quote">"http://servicemix.org/cheese/"</SPAN>
+ version=<SPAN class="code-quote">"1.0"</SPAN>>
+
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:template</SPAN>
match=<SPAN class="code-quote">"/*"</SPAN>></SPAN>
+ <SPAN class="code-tag"><<SPAN
class="code-keyword">xsl:choose</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- lets forward
the inbound message to a service --></SPAN></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:when</SPAN>
test=<SPAN class="code-quote">"@id = '4'"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:forward service=<SPAN
class="code-quote">"foo:trace"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:when</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- lets generate
the output XML to use as input, copy the input properties and define some new
propertes --></SPAN></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:when</SPAN>
test=<SPAN class="code-quote">"@id = '12'"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:script"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:copyProperties/></SPAN>
+ <SPAN class="code-tag"><jbi:setOutProperty name=<SPAN
class="code-quote">"foo"</SPAN> select=<SPAN
class="code-quote">"@sent"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><cheese code=<SPAN
class="code-quote">"[EMAIL PROTECTED]"</SPAN>></SPAN>
+ <SPAN class="code-tag"><description></SPAN>This is some
content generated from the routing XSL<SPAN
class="code-tag"></description></SPAN>
+ <SPAN class="code-tag"></cheese></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:when</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:when</SPAN>
test=<SPAN class="code-quote">"@id != '2'"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:forward service=<SPAN
class="code-quote">"foo:receiver"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:when</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><<SPAN
class="code-keyword">xsl:otherwise</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:forward service=<SPAN
class="code-quote">"foo:trace"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:otherwise</SPAN>></SPAN>
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:choose</SPAN>></SPAN>
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:template</SPAN>></SPAN>
+<SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:stylesheet</SPAN>></SPAN></PRE>
+</DIV></DIV>
<P> </P>
<P>In the above example, depending on the value of the @id attribute, we
invoke different services.</P>
@@ -180,13 +227,88 @@
<H3><A name="XPathRouter-Invokingmultipleserviceendpoints"></A>Invoking
multiple service endpoints</H3>
<P>The following example shows a number of services being invoked one after
the other, using optionally different properties. In each case the original XML
message is used as the body of the new inbound request.</P>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><<SPAN class="code-keyword">xsl:stylesheet</SPAN>
<SPAN class="code-keyword">xmlns:xsl</SPAN>=<SPAN
class="code-quote">"http://www.w3.org/1999/XSL/Transform"</SPAN>
+ <SPAN class="code-keyword">xmlns:jbi</SPAN>=<SPAN
class="code-quote">"xalan://org.apache.servicemix.components.xslt.XalanExtension"</SPAN>
+ extension-element-prefixes=<SPAN
class="code-quote">"jbi"</SPAN>
+
+ <SPAN class="code-keyword">xmlns:foo</SPAN>=<SPAN
class="code-quote">"http://servicemix.org/cheese/"</SPAN>
+ version=<SPAN class="code-quote">"1.0"</SPAN>>
+
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:strip-space</SPAN>
elements=<SPAN class="code-quote">"*"</SPAN>/></SPAN>
+
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:template</SPAN>
match=<SPAN class="code-quote">"/"</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- lets invoke a
number of services one after the other --></SPAN></SPAN>
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:service1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:copyProperties/></SPAN>
+ <SPAN class="code-tag"><jbi:setOutProperty name=<SPAN
class="code-quote">"foo"</SPAN> select=<SPAN
class="code-quote">"/sample"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:copy-of</SPAN>
select=<SPAN class="code-quote">"/"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:service2"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:copyProperties/></SPAN>
+ <SPAN class="code-tag"><jbi:setOutProperty name=<SPAN
class="code-quote">"bar"</SPAN> select=<SPAN
class="code-quote">"/sample/@id"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:copy-of</SPAN>
select=<SPAN class="code-quote">"/"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:service3"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:copyProperties/></SPAN>
+ <SPAN class="code-tag"><jbi:setOutProperty name=<SPAN
class="code-quote">"foo"</SPAN> select=<SPAN
class="code-quote">"string(/sample)"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><jbi:setOutProperty name=<SPAN
class="code-quote">"bar"</SPAN> select=<SPAN
class="code-quote">"string(/sample/@id)"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:copy-of</SPAN>
select=<SPAN class="code-quote">"/"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:receiver"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:copyProperties/></SPAN>
+ <SPAN class="code-tag"><jbi:setOutProperty name=<SPAN
class="code-quote">"bar"</SPAN> select=<SPAN
class="code-quote">"/sample/@id"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:copy-of</SPAN>
select=<SPAN class="code-quote">"/"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:template</SPAN>></SPAN>
+<SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:stylesheet</SPAN>></SPAN></PRE>
+</DIV></DIV>
<P> </P>
<H3><A
name="XPathRouter-SplittingupanXMLmessageintomultipleserviceinvocations"></A>Splitting
up an XML message into multiple service invocations</H3>
<P>This example demonstrates a message being split into multiple different
sections of XML which are then invoked on different services.</P>
-
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-xml"><<SPAN class="code-keyword">xsl:stylesheet</SPAN>
<SPAN class="code-keyword">xmlns:xsl</SPAN>=<SPAN
class="code-quote">"http://www.w3.org/1999/XSL/Transform"</SPAN>
+ <SPAN class="code-keyword">xmlns:jbi</SPAN>=<SPAN
class="code-quote">"xalan://org.apache.servicemix.components.xslt.XalanExtension"</SPAN>
+ extension-element-prefixes=<SPAN
class="code-quote">"jbi"</SPAN>
+ <SPAN class="code-keyword">xmlns:foo</SPAN>=<SPAN
class="code-quote">"http://servicemix.org/cheese/"</SPAN>
version=<SPAN class="code-quote">"1.0"</SPAN>>
+
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:template</SPAN>
match=<SPAN class="code-quote">"/"</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- lets pass a new
message body --></SPAN></SPAN>
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:service1"</SPAN>></SPAN>
+ <SPAN class="code-tag"><cheese id=<SPAN
class="code-quote">"{/foo/@id}"</SPAN>></SPAN>Edam<SPAN
class="code-tag"></cheese></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- lets split the
message --></SPAN></SPAN>
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:service2"</SPAN>></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:copy-of</SPAN>
select=<SPAN class="code-quote">"/foo/beer"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- 1-many split
--></SPAN></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:for-each</SPAN>
select=<SPAN class="code-quote">"/foo/lineitem"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:service3"</SPAN>></SPAN>
+ <SPAN class="code-tag"><<SPAN
class="code-keyword">xsl:copy-of</SPAN> select=<SPAN
class="code-quote">"."</SPAN>/></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:for-each</SPAN>></SPAN>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- pass the
entire message to the final endpoint --></SPAN></SPAN>
+ <SPAN class="code-tag"><jbi:invoke service=<SPAN
class="code-quote">"foo:receiver"</SPAN>></SPAN>
+ <SPAN class="code-tag"><jbi:copyProperties/></SPAN>
+ <SPAN class="code-tag"><jbi:setOutProperty name=<SPAN
class="code-quote">"bar"</SPAN> select=<SPAN
class="code-quote">"/sample/@id"</SPAN>/></SPAN>
+ <SPAN class="code-tag"><<SPAN class="code-keyword">xsl:copy-of</SPAN>
select=<SPAN class="code-quote">"/"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></jbi:invoke></SPAN>
+
+ <SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:template</SPAN>></SPAN>
+<SPAN class="code-tag"></<SPAN
class="code-keyword">xsl:stylesheet</SPAN>></SPAN></PRE>
+</DIV></DIV>
<P> </P>
<H3><A name="XPathRouter-WhyuseXalan%3F"></A>Why use Xalan?</H3>
@@ -207,8 +329,8 @@
</DIV>
<DIV id="site-footer">
Added by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James
Strachan</A>,
- last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnt">gnt</A>
on Dec 30, 2005
- (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=2045&originalId=4125">view
change</A>)
+ last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=gnodet">Guillaume
Nodet</A> on Jan 07, 2007
+ (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=2045&originalId=15254">view
change</A>)
(<A
href="http://goopen.org/confluence/pages/editpage.action?pageId=2045">edit
page</A>)
</DIV>