[jboss-svn-commits] JBL Code SVN: r26707 - in labs/jbossesb/trunk/product: samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing and 4 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun May 24 06:54:01 EDT 2009


Author: tfennelly
Date: 2009-05-24 06:54:00 -0400 (Sun, 24 May 2009)
New Revision: 26707

Added:
   labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/
   labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/
   labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/
   labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd
   labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd-smooks.xml
Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-02_Low_Price_Service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-03_High_Price_Service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-04_Reptiles_notify_webservice_proxy.xml
   labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/README.html
Log:
https://jira.jboss.org/jira/browse/JBESB-2588
XSD based configuration namespace for the Smooks ESB FragmentRouter components

Modified: labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-02_Low_Price_Service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-02_Low_Price_Service.xml	2009-05-23 21:24:21 UTC (rev 26706)
+++ labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-02_Low_Price_Service.xml	2009-05-24 10:54:00 UTC (rev 26707)
@@ -1,22 +1,15 @@
 <?xml version="1.0"?>
 <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
-                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
+                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
+                     xmlns:esbr="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd">
 
     <!--
         At the end of every order-item, route the order item XML ("02_XML_OrderItem") to the
         "02_Low_Price" Service, if the total is 20 or less...
     -->
-    <resource-config selector="order-item">
-        <resource>org.jboss.soa.esb.smooks.FragmentRouter</resource>
-        <condition>
-            <!--
-            product.LISTPRICE * orderItem.quantity <= 17.00
-            -->
-        </condition>
-        <param name="beanId">02_XML_OrderItem</param> <!-- Populated and bound below... -->
-        <param name="serviceCategory">HugeQS</param>
-        <param name="serviceName">02_Low_Price</param>
-    </resource-config>
+    <esbr:routeBean beanIdRef="02_XML_OrderItem" toServiceCategory="HugeQS" toServiceName="02_Low_Price" routeOnElement="order-item">
+        <condition><!-- product.LISTPRICE * orderItem.quantity <= 17.00 --></condition>
+    </esbr:routeBean>
     
     <!--
         At the end of every order-item, generate an <ord> split message for the "02_XML" Service

Modified: labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-03_High_Price_Service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-03_High_Price_Service.xml	2009-05-23 21:24:21 UTC (rev 26706)
+++ labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-03_High_Price_Service.xml	2009-05-24 10:54:00 UTC (rev 26707)
@@ -1,21 +1,14 @@
 <?xml version="1.0"?>
 <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
-                      xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.1.xsd">
+                      xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.1.xsd"
+                      xmlns:esbr="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd">
     <!--
         At the end of every order-item, route the order item Java Objects ("03_order") to the
         "03_High_Price" Service, if the price per item is 190 or more...
     -->
-    <resource-config selector="order-item">
-        <resource>org.jboss.soa.esb.smooks.FragmentRouter</resource>
-        <condition>
-            <!--
-            product.LISTPRICE > 190.00
-            -->
-        </condition>
-        <param name="beanId">03_order</param>
-        <param name="serviceCategory">HugeQS</param>
-        <param name="serviceName">03_High_Price</param>
-    </resource-config>
+    <esbr:routeBean beanIdRef="03_order" toServiceCategory="HugeQS" toServiceName="03_High_Price" routeOnElement="order-item">
+        <condition><!-- product.LISTPRICE > 190.00 --></condition>
+    </esbr:routeBean>
     
     <!--
         At the end of every order-item, bind together the orderDetail with the current

Modified: labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-04_Reptiles_notify_webservice_proxy.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-04_Reptiles_notify_webservice_proxy.xml	2009-05-23 21:24:21 UTC (rev 26706)
+++ labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/01_split_enrich_transform_route/smooks_configs/routing/route-to-04_Reptiles_notify_webservice_proxy.xml	2009-05-24 10:54:00 UTC (rev 26707)
@@ -1,22 +1,15 @@
 <?xml version="1.0"?>
 <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
-                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
+                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
+                     xmlns:esbr="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd">
 
     <!--
         At the end of every order-item, route the "Reptiles Notification" SOAP message ("04_SOAP_OrderItem") to the
         "04_Reptiles_notify_webservice_proxy" Service, if the order item product.CATEGORY is "REPTILES"...
     -->
-    <resource-config selector="order-item">
-        <resource>org.jboss.soa.esb.smooks.FragmentRouter</resource>
-        <condition>
-            <!--
-            product.CATEGORY == "REPTILES"
-            -->
-        </condition>
-        <param name="beanId">04_SOAP_OrderItem</param>
-        <param name="serviceCategory">HugeQS</param>
-        <param name="serviceName">04_Reptiles_notify_webservice_proxy</param>
-    </resource-config>
+    <esbr:routeBean beanIdRef="04_SOAP_OrderItem" toServiceCategory="HugeQS" toServiceName="04_Reptiles_notify_webservice_proxy" routeOnElement="order-item">
+        <condition><!-- product.CATEGORY == "REPTILES" --></condition>
+    </esbr:routeBean>
     
     <!--
         At the end of every order-item, generate an <ord> split message for the "02_XML" Service

Modified: labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/README.html
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/README.html	2009-05-23 21:24:21 UTC (rev 26706)
+++ labs/jbossesb/trunk/product/samples/quickstarts/huge-split-enrich-transform-route/README.html	2009-05-24 10:54:00 UTC (rev 26707)
@@ -470,23 +470,20 @@
 <pre>
 &lt;?xml version="1.0"?&gt;
 &lt;smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
-                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"&gt;
+                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
+                     xmlns:esbr="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd"&gt;
 
     &lt;!--
         At the end of every order-item, route the order item XML ("02_XML_OrderItem") to the
         "02_Low_Price" Service, if the total is 20 or less...
     --&gt;
-    &lt;resource-config selector="order-item"&gt;
-        &lt;resource&gt;org.jboss.soa.esb.smooks.FragmentRouter&lt;/resource&gt;
+    &lt;esbr:routeBean beanIdRef="02_XML_OrderItem" toServiceCategory="HugeQS" toServiceName="02_Low_Price" routeOnElement="order-item"&gt;
         &lt;condition&gt;
             &lt;!--<i class="commentedcode">
             product.LISTPRICE * orderItem.quantity &lt;= 17.00
             </i>--&gt;
         &lt;/condition&gt;
-        &lt;param name="beanId"&gt;<span style="color: crimson;">02_XML_OrderItem</span>&lt;/param&gt; &lt;!-- Populated and bound below... --&gt;
-        &lt;param name="serviceCategory"&gt;HugeQS&lt;/param&gt;
-        &lt;param name="serviceName"&gt;02_Low_Price&lt;/param&gt;
-    &lt;/resource-config&gt;
+    &lt;/esbr:routeBean&gt;
 
     &lt;!--
         At the end of every order-item, generate an &lt;ord&gt; split message for the "02_XML" Service
@@ -542,22 +539,19 @@
 <pre>
 &lt;?xml version="1.0"?&gt;
 &lt;smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
-                      xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.1.xsd"&gt;
+                      xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.1.xsd"
+                      xmlns:esbr="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd"&gt;
     &lt;!--
         At the end of every order-item, route the order item Java Objects ("03_order") to the
         "03_High_Price" Service, if the price per item is 190 or more...
     --&gt;
-    &lt;resource-config selector="order-item"&gt;
-        &lt;resource&gt;org.jboss.soa.esb.smooks.FragmentRouter&lt;/resource&gt;
+    &lt;esbr:routeBean beanIdRef="03_order" toServiceCategory="HugeQS" toServiceName="03_High_Price" routeOnElement="order-item"&gt;
         &lt;condition&gt;
             &lt;!--<i class="commentedcode">
             product.LISTPRICE &gt; 190.00
             </i>--&gt;
         &lt;/condition&gt;
-        &lt;param name="beanId"&gt;<span style="color: crimson;">03_order</span>&lt;/param&gt;
-        &lt;param name="serviceCategory"&gt;HugeQS&lt;/param&gt;
-        &lt;param name="serviceName"&gt;03_High_Price&lt;/param&gt;
-    &lt;/resource-config&gt;
+    &lt;/esbr:routeBean&gt;
 
     &lt;!--
         At the end of every order-item, bind together the orderDetail with the current
@@ -618,23 +612,20 @@
 <pre>
 &lt;?xml version="1.0"?&gt;
 &lt;smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
-                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"&gt;
+                     xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
+                     xmlns:esbr="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd"&gt;
 
     &lt;!--
         At the end of every order-item, route the "Reptiles Notification" SOAP message ("04_SOAP_OrderItem") to the
         "04_Reptiles_notify_webservice_proxy" Service, if the order item product.CATEGORY is "REPTILES"...
     --&gt;
-    &lt;resource-config selector="order-item"&gt;
-        &lt;resource&gt;org.jboss.soa.esb.smooks.FragmentRouter&lt;/resource&gt;
+    &lt;esbr:routeBean beanIdRef="04_SOAP_OrderItem" toServiceCategory="HugeQS" toServiceName="04_Reptiles_notify_webservice_proxy" routeOnElement="order-item"&gt;
         &lt;condition&gt;
             &lt;!--
             product.CATEGORY == "REPTILES"
             --&gt;
         &lt;/condition&gt;
-        &lt;param name="beanId"&gt;<span style="color: crimson;">04_SOAP_OrderItem</span>&lt;/param&gt;
-        &lt;param name="serviceCategory"&gt;HugeQS&lt;/param&gt;
-        &lt;param name="serviceName"&gt;04_Reptiles_notify_webservice_proxy&lt;/param&gt;
-    &lt;/resource-config&gt;
+    &lt;/esbr:routeBean&gt;
 
     &lt;!--
         At the end of every order-item, generate an &lt;ord&gt; split message for the "02_XML" Service

Added: labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd
===================================================================
--- labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd	2009-05-24 10:54:00 UTC (rev 26707)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd"
+           elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:smooks="http://www.milyn.org/xsd/smooks-1.1.xsd"
+           xmlns:routing="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd">
+
+    <xs:import namespace="http://www.milyn.org/xsd/smooks-1.1.xsd"/>
+
+    <xs:annotation>
+        <xs:documentation xml:lang="en">JBoss ESB Smooks Routing Components</xs:documentation>
+    </xs:annotation>
+
+    <xs:element name="routeBean" type="routing:routeBean" substitutionGroup="smooks:abstract-resource-config">
+        <xs:annotation>
+            <xs:documentation xml:lang="en">JBoss ESB Async Router.</xs:documentation>
+        </xs:annotation>
+    </xs:element>
+
+    <xs:complexType name="routeBean">
+        <xs:annotation>
+            <xs:documentation xml:lang="en">JBoss ESB Async Router.</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+            <xs:extension base="smooks:element-visitor">
+                <xs:attribute name="beanIdRef" type="xs:string" use="required">
+                    <xs:annotation>
+                        <xs:documentation xml:lang="en">Bean ID reference of the bean to be routed to the target Service.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+                <xs:attribute name="toServiceCategory" type="xs:string" use="required">
+                    <xs:annotation>
+                        <xs:documentation xml:lang="en">Target Service Category.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+                <xs:attribute name="toServiceName" type="xs:string" use="required">
+                    <xs:annotation>
+                        <xs:documentation xml:lang="en">Target Service Name.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+                <xs:attribute name="routeOnElement" type="xs:string" use="required">
+                    <xs:annotation>
+                        <xs:documentation xml:lang="en">Route on Element.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+                <xs:attribute name="routeOnElementNS" type="xs:string">
+                    <xs:annotation>
+                        <xs:documentation xml:lang="en">Route on Element Namespace.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+                <xs:attribute name="messagePayloadLocation" type="xs:string" default="">
+                    <xs:annotation>
+                        <xs:documentation xml:lang="en">ESB Message.Body location on which the routed bean will be set.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+                <xs:attribute name="routeBefore" type="xs:boolean" default="false">
+                    <xs:annotation>
+                        <xs:documentation xml:lang="en">Route on visitBefore of the routeOnElement.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+
+</xs:schema>

Added: labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd-smooks.xml
===================================================================
--- labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd-smooks.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/smooks/src/main/resources/META-INF/xsd/jbossesb/smooks/routing-1.0.xsd-smooks.xml	2009-05-24 10:54:00 UTC (rev 26707)
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" default-selector-namespace="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd">
+
+    <!--
+        Create Resource config...
+    -->
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.NewResourceConfig</resource>
+        <param name="resource">org.jboss.soa.esb.smooks.FragmentRouter</param>
+    </resource-config>
+
+    <!--
+        Map Config attributes onto current Resource config...
+    -->
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.MapToResourceConfigFromAttribute</resource>
+        <param name="attribute">beanIdRef</param>
+        <param name="mapTo">beanId</param>
+    </resource-config>
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.MapToResourceConfigFromAttribute</resource>
+        <param name="attribute">toServiceCategory</param>
+        <param name="mapTo">serviceCategory</param>
+    </resource-config>
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.MapToResourceConfigFromAttribute</resource>
+        <param name="attribute">toServiceName</param>
+        <param name="mapTo">serviceName</param>
+    </resource-config>
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.MapToResourceConfigFromAttribute</resource>
+        <param name="attribute">routeOnElement</param>
+        <param name="mapTo">selector</param>
+    </resource-config>
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.MapToResourceConfigFromAttribute</resource>
+        <param name="attribute">routeOnElementNS</param>
+        <param name="mapTo">selector-namespace</param>
+    </resource-config>
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.MapToResourceConfigFromAttribute</resource>
+        <param name="attribute">routeBefore</param>
+        <param name="default">false</param>
+    </resource-config>
+
+    <resource-config selector="routeBean">
+        <resource>org.milyn.cdr.extension.MapToResourceConfigFromAttribute</resource>
+        <param name="attribute">messagePayloadLocation</param>
+        <param name="mapTo">set-payload-location</param>
+        <param name="default">org.jboss.soa.esb.message.defaultEntry</param>
+    </resource-config>
+
+</smooks-resource-list>
\ No newline at end of file




More information about the jboss-svn-commits mailing list