[jboss-svn-commits] JBL Code SVN: r6465 - in labs/jbossesb/trunk/product: core/listeners/src/org/jboss/soa/esb/actions docs docs/samples/trailblazer/bankloanbrokerdemo/conf docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Sep 29 06:59:08 EDT 2006
Author: tfennelly
Date: 2006-09-29 06:59:00 -0400 (Fri, 29 Sep 2006)
New Revision: 6465
Added:
labs/jbossesb/trunk/product/docs/MessageTransformation.doc
Modified:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/SmooksTransformer.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/from__loanbroker.cdrl
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/to____jmsbank.cdrl
Log:
Added doc for Message Transformation in JBoss ESB.
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/SmooksTransformer.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/SmooksTransformer.java 2006-09-28 22:41:22 UTC (rev 6464)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/SmooksTransformer.java 2006-09-29 10:59:00 UTC (rev 6465)
@@ -139,12 +139,14 @@
transformedMessage = smooks.filterAndSerialize(messageUseragent, new ByteArrayInputStream(messageBytes));
if(logger.isDebugEnabled()) {
long timeTaken = System.currentTimeMillis() - start;
- logger.debug("Transformed message [" + message + "] for useragent [" + messageUseragent + "]. Time taken: " + timeTaken + ". Result:\n" + transformedMessage);
+ logger.debug("Transformed message for useragent [" + messageUseragent + "]. Time taken: "
+ + timeTaken + ". Message in:\n[" + message + "]. \nMessage out:\n[" + transformedMessage + "].");
}
return transformedMessage;
} else {
- logger.warn("String message types only supported. Input message was [" + message.getClass().getName() + "]. Returning message untransformed.");
+ logger.warn("String message types only supported. Input message was ["
+ + message.getClass().getName() + "]. Returning message untransformed.");
return message;
}
}
@@ -176,7 +178,7 @@
InputStream configListStream = getClass().getResourceAsStream(cpPrefix + SMOOKS_CDR_LST);
if(configListStream == null) {
- throw new ConfigurationException("Failed to locate Smooks configuration list file [" + SMOOKS_CDR_LST + "]. This file must be located at " + cpPrefix + " relative to the root of the classpath.");
+ throw new ConfigurationException("Failed to locate Smooks configuration list file [" + SMOOKS_CDR_LST + "]. The folder containing this file must be located at " + cpPrefix + " relative to the root of the classpath.");
}
// TODO: There's a potential issue here if two SmooksTransformer action configs specify and require
Added: labs/jbossesb/trunk/product/docs/MessageTransformation.doc
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/docs/MessageTransformation.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template 2006-09-28 22:41:22 UTC (rev 6464)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template 2006-09-29 10:59:00 UTC (rev 6465)
@@ -113,7 +113,7 @@
</target>
</NotificationList>
</BanksFilePoller>
-
+
<Actions>
<Action name="ProcessCreditCheckRequest" processor="CreditRequestProcessor" />
@@ -136,7 +136,7 @@
<property name="message-prop:sample_loanbroker_servicecode" value="BankQuoteCSV" />
</Action>
<Action name="BankQuote-CSV-To-JMSBankXML" processor="SmooksTransformer">
- <property name="message-type" value="BankQuote" />
+ <property name="message-type" value="BankQuote-CSV" />
<property name="message-from" value="LoanBroker" />
<property name="message-to" value="JMSBank" />
</Action>
@@ -179,4 +179,4 @@
org.jboss.soa.esb.mail.smtp.auth="@smtp.auth@"
/>
-</JBossESB-LoanBroker-TrailBlazer>
\ No newline at end of file
+</JBossESB-LoanBroker-TrailBlazer>
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/from__loanbroker.cdrl
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/from__loanbroker.cdrl 2006-09-28 22:41:22 UTC (rev 6464)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/from__loanbroker.cdrl 2006-09-29 10:59:00 UTC (rev 6465)
@@ -9,8 +9,8 @@
See: http://milyn.codehaus.org/javadoc/smooks-cartridges/csv/org/milyn/csv/CSVParser.html
-->
- <smooks-resource useragent="type:BankQuote AND from:LoanBroker" selector="org.xml.sax.driver" path="org.milyn.csv.CSVParser" >
+ <smooks-resource useragent="type:BankQuote-CSV AND from:LoanBroker" selector="org.xml.sax.driver" path="org.milyn.csv.CSVParser" >
<param name="fields" type="string-list">ssn,creditScore,creditHistoryLen,amount,term,customerUniqueId</param>
</smooks-resource>
-</smooks-resource-list>
\ No newline at end of file
+</smooks-resource-list>
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/to____jmsbank.cdrl
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/to____jmsbank.cdrl 2006-09-28 22:41:22 UTC (rev 6464)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/transform/smooks/to____jmsbank.cdrl 2006-09-29 10:59:00 UTC (rev 6465)
@@ -10,11 +10,15 @@
modifications:
i) A general restructuring of the <csv-record> elements to fit the format requirements of the JMSBank.
(See http://milyn.codehaus.org/javadoc/smooks-cartridges/templating/org/milyn/templating/xslt/XslContentDeliveryUnitCreator.html)
- ii) Remove the root <csv-set>. We know that there's only on CVS record in this set and the JMSBank
+ ii) Remove the root <csv-set>. We know that there's only one CSV record in this set and the JMSBank
expects the root to be "org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest".
(See http://milyn.codehaus.org/javadoc/smooks-cartridges/misc/org/milyn/cdres/trans/RemoveElementTU.html)
+ Note of course that this particular transformation could be easily avoided by simply targeting the XSLT
+ transformation at the <csv-set> element. However, if multiple <csv-record> elements were present and
+ supported by the JMS Bank, a configuration like this would be more appropriate - the only difference being
+ that the <csv-set> would more like get renamed than removed.
-->
- <smooks-resource useragent="type:BankQuote AND from:LoanBroker AND to:JMSBank" selector="csv-record">
+ <smooks-resource useragent="type:BankQuote-CSV AND from:LoanBroker AND to:JMSBank" selector="csv-record">
<param name="restype">xsl</param>
<param name="resdata">
<![CDATA[
@@ -29,8 +33,8 @@
]]>
</param>
</smooks-resource>
- <smooks-resource useragent="type:BankQuote AND from:LoanBroker AND to:JMSBank" selector="csv-set" path="org.milyn.cdres.trans.RemoveElementTU">
+ <smooks-resource useragent="type:BankQuote-CSV AND from:LoanBroker AND to:JMSBank" selector="csv-set" path="org.milyn.cdres.trans.RemoveElementTU">
<param name="keepChildContent">true</param>
</smooks-resource>
-</smooks-resource-list>
\ No newline at end of file
+</smooks-resource-list>
More information about the jboss-svn-commits
mailing list