[jboss-svn-commits] JBL Code SVN: r19777 - in labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product: services/smooks/src/main/java/org/jboss/soa/esb/actions/smooks and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Apr 30 10:25:57 EDT 2008


Author: tfennelly
Date: 2008-04-30 10:25:57 -0400 (Wed, 30 Apr 2008)
New Revision: 19777

Modified:
   labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/docs/MessageActionGuide.odt
   labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/docs/MessageActionGuide.pdf
   labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/smooks/SmooksAction.java
Log:
Documentation for http://jira.jboss.com/jira/browse/JBESB-1680

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/docs/MessageActionGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/docs/MessageActionGuide.pdf
===================================================================
(Binary files differ)

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/smooks/SmooksAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/smooks/SmooksAction.java	2008-04-30 12:14:04 UTC (rev 19776)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_FP1/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/smooks/SmooksAction.java	2008-04-30 14:25:57 UTC (rev 19777)
@@ -28,11 +28,13 @@
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.MessagePayloadProxy;
 import org.milyn.Smooks;
+import org.milyn.event.report.HtmlReportGenerator;
 import org.milyn.container.ExecutionContext;
 import org.milyn.container.plugin.PayloadProcessor;
 import org.milyn.container.plugin.ResultType;
 
 import java.io.Serializable;
+import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
@@ -52,6 +54,7 @@
  * <property name="set-payload-location" value="ouput" />
  * <property name="excludeNonSerializables" value="false" />
  * <property name="resultType" value="STRING" />
+ * <property name="reportPath" value="/tmp/smooks-report.html" />
  * </pre>
  * 
  * Description of configuration properties:
@@ -61,6 +64,9 @@
  * <li><i>set-payload-location</i> - the body location where the transformed object will be placed.
  * <li><i>excludeNonSerializables</i> - if true, non serializable attributes from the Smooks ExecutionContext will no be included. Default is true.
  * <li><i>resultType</i> - type of result expected from Smooks ("STRING", "BYTES", "JAVA", "NORESULT"). Default is "STRING".
+ * <li><i>javaResultBeanId</i> - specifies the Smooks bean context beanId to be mapped as the result when the resultType is "JAVA".  If not specified,
+ *                               the whole bean context bean Map is mapped as the result. 
+ * <li><i>reportPath</i> - specifies the path and file name for generating a Smooks Execution Report.  This is a development tool.
  * </ul>
  * After Smooks has performed the filtering the process method will make the attributes that have been set in the
  * the ExecutionContext available for other actions in the ESB.
@@ -97,6 +103,8 @@
 
 	private boolean excludeNonSerializables;
 
+    private String reportPath;
+
     // public 
     
     public SmooksAction( final ConfigTree configTree ) throws ConfigurationException 
@@ -129,6 +137,8 @@
 
         payloadProxy = new MessagePayloadProxy( configTree );
         excludeNonSerializables = Boolean.valueOf( configTree.getAttribute( "excludeNonSerializables", "true" ) );
+
+        reportPath = configTree.getAttribute("reportPath");
     }
     
     /**
@@ -143,6 +153,14 @@
 	{
 		//	Create Smooks ExecutionContext.
         final ExecutionContext executionContext = createExecutionContext( smooks );
+
+        if(reportPath != null) {
+            try {
+                executionContext.setEventListener(new HtmlReportGenerator(reportPath));
+            } catch (IOException e) {
+                throw new ActionProcessingException("Failed to create HtmlReportGenerator instance.", e);
+            }
+        }
         
         //	Use the Smooks PayloadProcessor to execute the transformation....
         final Object newPayload = payloadProcessor.process( extractPayload( message), executionContext );




More information about the jboss-svn-commits mailing list