[jboss-svn-commits] JBL Code SVN: r14583 - labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Aug 26 08:33:57 EDT 2007


Author: burrsutter
Date: 2007-08-26 08:33:56 -0400 (Sun, 26 Aug 2007)
New Revision: 14583

Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/smooks-res.xml
Log:
added transformation for greenservice

Modified: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml	2007-08-26 12:33:35 UTC (rev 14582)
+++ labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/jboss-esb.xml	2007-08-26 12:33:56 UTC (rev 14583)
@@ -131,11 +131,18 @@
   	         />
   	      </listeners>  	      
   	      <actions>
-  	          <!-- insert transformer here -->
+
+
+								 <!-- Inject the transformer actions here -->
+								           
+		 <action name="displayAfterTransformer" 
+		   class="org.jboss.soa.esb.samples.quickstart.funcbr.MyJMSListenerAction" process="displayMessage" />  
+
    	   		    <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
                		<property name="okMethod" value="notifyOK" />
                		<property name="notification-details">
    	 				   <NotificationList type="OK"> 
+   	 				   <target class="NotifyConsole" />
 				    	 <target class="NotifyQueues">
 				   	       <queue jndiName="queue/quickstart_Fun_CBR_Green_Alert">
 					         	<messageProp name="quickstart" value="Fun_CBR_Green_Alert" />

Modified: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/readme.txt	2007-08-26 12:33:35 UTC (rev 14582)
+++ labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/readme.txt	2007-08-26 12:33:56 UTC (rev 14583)
@@ -55,3 +55,28 @@
    0 - Blue
    1 - Red
    2 - Green
+   
+  Extra Credit: Open MyESBRules-XPath.drl and change the routes to the following:
+		Blue for statusCode="1"
+		Red for statusCode="0"
+		Green for statusCode="2"
+  Then "ant runtest" again, the rule changes are picked up on-the-fly due to the 
+  <property name="ruleReload" value="true"/> on the CBR Action in the jboss-esb.xml
+  
+  Extra Credit 2: Open jboss-esb.xml and find the GreenService
+  replace "<!-- Inject the transformer actions here -->"
+  with:
+      <action name="transform" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+         <property name="resource-config" value="/smooks-res.xml" />
+      </action>
+
+      <action name="convertPOJO2Message" class="org.jboss.soa.esb.dvdstore.DVDStoreAction"	/>
+      <!-- this will send everything to the console -->
+      <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
+       		<property name="printfull" value="true"/>
+      </action>
+      
+  Then "ant runtest".  The jboss-esb.xml changes will be picked up automatically assuming 
+  you are running with "bootstrapper" via "ant run".  If you are running as a .esb archive 
+  then you'll need to edit the jboss-esb.xml in the deploy folder of your ESB Server or your
+  Application Server.

Modified: labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/smooks-res.xml	2007-08-26 12:33:35 UTC (rev 14582)
+++ labs/jbossesb/trunk/product/samples/quickstarts/fun_cbr/smooks-res.xml	2007-08-26 12:33:56 UTC (rev 14583)
@@ -1,98 +1,56 @@
-<?xml version="1.0"?>
-<!DOCTYPE smooks-resource-list PUBLIC "-//MILYN//DTD SMOOKS 1.0//EN" "http://www.milyn.org/dtd/smooksres-list-1.0.dtd" >
-<smooks-resource-list>
-	<smooks-resource selector="cdu-creator" useragent="*" path="org.milyn.templating.xslt.XslContentDeliveryUnitCreator" >
-		<param name="restype"><![CDATA[xsl]]></param>
-	</smooks-resource>
-	<smooks-resource selector="cdu-creator" useragent="*" path="org.milyn.templating.stringtemplate.StringTemplateContentDeliveryUnitCreator" >
-		<param name="restype"><![CDATA[st]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
 
-		<param name="beanId"><![CDATA[orderHeader]]></param>
-		<param name="beanClass"><![CDATA[org.jboss.soa.esb.dvdstore.OrderHeader]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderHeader]]></param>
-		<param name="attributeName"><![CDATA[orderId]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderHeader]]></param>
+    <!-- Populate the OrderHeader -->
+	<resource-config selector="order">
+        <resource>org.milyn.javabean.BeanPopulator</resource>
+        <param name="beanId">orderHeader</param>
+		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderHeader</param>
+        <param name="bindings">
+            <binding property="orderId" selector="Order @orderId" />
+            <binding property="orderDate" selector="Order @orderDate" type="LongDate"/>
+            <binding property="statusCode" selector="Order @statusCode" type="Integer" />
+            <binding property="netAmount" selector="Order @netAmount" type="Double" />
+            <binding property="totalAmount" selector="Order @totalAmount" type="Double" />
+            <binding property="tax" selector="Order @tax" type="Double" />
+        </param>
+    </resource-config>
 
-		<param name="attributeName"><![CDATA[orderDate]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderHeader]]></param>
-		<param name="attributeName"><![CDATA[statusCode]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderHeader]]></param>
-		<param name="attributeName"><![CDATA[netAmount]]></param>
+    <!-- Populate the Customer -->
+    <resource-config selector="order customer">
+        <resource>org.milyn.javabean.BeanPopulator</resource>
+		<param name="beanId">customer</param>
+		<param name="beanClass">org.jboss.soa.esb.dvdstore.Customer</param>
+        <param name="bindings">
+            <binding property="userName" selector="order customer @userName" />
+            <binding property="firstName" selector="order customer @firstName" />
+            <binding property="lastName" selector="order customer @lastName" />
+            <binding property="state" selector="order customer @state" />
+        </param>
+	</resource-config>
 
-	</smooks-resource>
-	<smooks-resource selector="order" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderHeader]]></param>
-		<param name="attributeName"><![CDATA[totalAmount]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderHeader]]></param>
-		<param name="attributeName"><![CDATA[tax]]></param>
-	</smooks-resource>
+    <!-- Populate the OrderItem list -->
+	<resource-config selector="order orderlines orderline">
+        <resource>org.milyn.javabean.BeanPopulator</resource>
+		<param name="beanId">orderItem</param>
+		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderItem</param>
+		<param name="addToList">true</param>
+        <param name="bindings">
+            <binding property="position"  selector="order orderlines orderline @position" type="Integer" />
+            <binding property="quantity"  selector="order orderlines orderline @quantity" type="Integer" />
+            <binding property="productId" selector="order orderlines orderline product @productId" />
+            <binding property="title"     selector="order orderlines orderline product @title" />
+            <binding property="price"     selector="order orderlines orderline product @price" type="Double" />
+        </param>
+	</resource-config>
 
-	<smooks-resource selector="order customer" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[customer]]></param>
-		<param name="beanClass"><![CDATA[org.jboss.soa.esb.dvdstore.Customer]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order customer" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[customer]]></param>
-		<param name="attributeName"><![CDATA[userName]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order customer" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
+	<resource-config selector="order orderlines orderline">
+        <resource>/org/jboss/soa/esb/dvdstore/orderitem.st</resource>
+	</resource-config>
 
-		<param name="beanId"><![CDATA[customer]]></param>
-		<param name="attributeName"><![CDATA[firstName]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order customer" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[customer]]></param>
-		<param name="attributeName"><![CDATA[lastName]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order customer" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[customer]]></param>
-
-		<param name="attributeName"><![CDATA[state]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order orderlines orderline" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderItem]]></param>
-		<param name="beanClass"><![CDATA[org.jboss.soa.esb.dvdstore.OrderItem]]></param>
-		<param name="addToList"><![CDATA[true]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order orderlines orderline" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderItem]]></param>
-
-		<param name="attributeName"><![CDATA[position]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order orderlines orderline" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderItem]]></param>
-		<param name="attributeName"><![CDATA[quantity]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order orderlines orderline product" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderItem]]></param>
-		<param name="attributeName"><![CDATA[productId]]></param>
-
-	</smooks-resource>
-	<smooks-resource selector="order orderlines orderline product" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderItem]]></param>
-		<param name="attributeName"><![CDATA[title]]></param>
-	</smooks-resource>
-	<smooks-resource selector="order orderlines orderline product" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
-		<param name="beanId"><![CDATA[orderItem]]></param>
-		<param name="attributeName"><![CDATA[price]]></param>
-	</smooks-resource>
-
-	<smooks-resource selector="order orderlines orderline" useragent="from-type:text/xml:fullfillorder and from:dvdstore:orderdispatchservice and to-type:text/xml:shiporder and to:dvdwarehouse_1:orderhandlingservice" path="/org/jboss/soa/esb/dvdstore/orderitem.st" >
-		<param name="encoding"><![CDATA[UTF-8]]></param>
-		<param name="visitBefore"><![CDATA[false]]></param>
-		<param name="action"><![CDATA[replace]]></param>
-	</smooks-resource>
-
-</smooks-resource-list>
\ No newline at end of file
+    <resource-config selector="decoder:LongDate">
+        <resource>org.milyn.javabean.decoders.CalendarDecoder</resource>
+        <param name="format">EEE MMM dd HH:mm:ss z yyyy</param>
+    </resource-config>
+    
+</smooks-resource-list>




More information about the jboss-svn-commits mailing list