[jboss-svn-commits] JBL Code SVN: r15946 - in labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service: src/org/jboss/soa/esb/dvdstore and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Oct 19 11:51:30 EDT 2007
Author: tfennelly
Date: 2007-10-19 11:51:30 -0400 (Fri, 19 Oct 2007)
New Revision: 15946
Removed:
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java
Modified:
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml
labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
Log:
cleanup
Modified: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2007-10-19 15:13:29 UTC (rev 15945)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2007-10-19 15:51:30 UTC (rev 15946)
@@ -55,11 +55,6 @@
value="/smooks-res.xml" />
</action>
- <action name="fixUpMessage"
- class="org.jboss.soa.esb.samples.quickstart.businessrules.SetupMessage">
- <property name="status" value="60" /><!-- status was not in order XML -->
- </action>
-
<!-- Use the BRP to calculate the order priority -->
<action
class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
@@ -68,8 +63,8 @@
value="MyBusinessRules.drl" />
<property name="ruleReload" value="true" />
<property name="object-paths">
- <object-path esb="body.TheOrderHeader" />
- <object-path esb="body.TheCustomer" />
+ <object-path esb="body.orderHeader" />
+ <object-path esb="body.customer" />
</property>
</action>
@@ -86,8 +81,8 @@
value="MyBusinessRulesDiscount.drl" />
<property name="ruleReload" value="true" />
<property name="object-paths">
- <object-path esb="body.TheOrderHeader" />
- <object-path esb="body.TheCustomer" />
+ <object-path esb="body.orderHeader" />
+ <object-path esb="body.customer" />
</property>
</action>
@@ -114,8 +109,8 @@
service-category="BasicShipping" service-name="ShipperService" />
</property>
<property name="object-paths">
- <object-path esb="body.TheOrderHeader" />
- <object-path esb="body.TheCustomer" />
+ <object-path esb="body.orderHeader" />
+ <object-path esb="body.customer" />
</property>
</action>
</actions>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml 2007-10-19 15:13:29 UTC (rev 15945)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml 2007-10-19 15:51:30 UTC (rev 15946)
@@ -44,10 +44,6 @@
</param>
</resource-config>
- <resource-config selector="order orderlines orderline">
- <resource>/org/jboss/soa/esb/dvdstore/orderitem.st</resource>
- </resource-config>
-
<resource-config selector="decoder:LongDate">
<resource>org.milyn.javabean.decoders.CalendarDecoder</resource>
<param name="format">EEE MMM dd HH:mm:ss z yyyy</param>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java 2007-10-19 15:13:29 UTC (rev 15945)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java 2007-10-19 15:51:30 UTC (rev 15946)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.dvdstore;
-
-import java.util.HashMap;
-import java.util.List;
-
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * DVD Store action.
- * <p/>
- * This action uses bean value objects that were prepopulated by Smooks in an earlier action on the pipline.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class DVDStoreAction extends AbstractActionPipelineProcessor {
-
- public DVDStoreAction(ConfigTree configTree) {
-
- }
-
- public Message process(Message message) throws ActionProcessingException {
- HashMap beanHash = (HashMap) message.getBody().get("EXTRACTED_BEANS_HASH");
-
- StringBuffer results = new StringBuffer();
- if(beanHash != null) {
- OrderHeader header = (OrderHeader) beanHash.get("orderHeader");
- Customer customer = (Customer) beanHash.get("customer");
- List orderItems = (List) beanHash.get("orderItemList");
- results.append("Demonstrates Smooks ability to rip the XML into Objects\n");
- results.append("********* DVDStoreAction - Order Value Objects Populated *********\n");
- results.append("Header: " + header + "\n");
- results.append("Customer: " + customer + "\n");
- if(orderItems != null) {
- results.append("Order Items (" + orderItems.size() + "):\n");
- for(int i = 0; i < orderItems.size(); i++) {
- results.append("\t" + i + ": " + orderItems.get(i) + "\n");
- }
- }
- results.append("\n****************************************************************** ");
- } else {
- results.append("\n*** No beanhash found!");
- }
-
- // Take this "parsed" output and make it a new message
- message.getBody().setByteArray(results.toString().getBytes());
- return message;
- }
-}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st 2007-10-19 15:13:29 UTC (rev 15945)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st 2007-10-19 15:51:30 UTC (rev 15946)
@@ -1,7 +0,0 @@
- <order-item>
- <index>$orderItem.position$</index>
- <quantity>$orderItem.quantity$</quantity>
- <product>$orderItem.productId$</product>
- <title>$orderItem.title$</title>
- <price>$orderItem.price$</price>
- </order-item>
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java 2007-10-19 15:13:29 UTC (rev 15945)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java 2007-10-19 15:51:30 UTC (rev 15946)
@@ -33,15 +33,15 @@
public Message process(Message message) throws ActionProcessingException {
- OrderHeader order = (OrderHeader) message.getBody().get("TheOrderHeader");
- Customer customer = (Customer) message.getBody().get("TheCustomer");
- System.out.println("{ ================ " + input);
+ OrderHeader order = (OrderHeader) message.getBody().get("orderHeader");
+ Customer customer = (Customer) message.getBody().get("customer");
+
+ System.out.println("{ ================ " + input);
System.out.println("Customer: " + customer);
System.out.println("Order Priority: " + order.getOrderPriority());
System.out.println("Order Discount: " + order.getOrderDiscount());
System.out.println("Order Total: " + order.getTotalAmount());
System.out.println("} ================ " + input);
- // System.out.println("Order: " + order);
return message;
}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java 2007-10-19 15:13:29 UTC (rev 15945)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java 2007-10-19 15:51:30 UTC (rev 15946)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.businessrules;
-
-import java.util.HashMap;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.dvdstore.Customer;
-import org.jboss.soa.esb.dvdstore.OrderHeader;
-import org.apache.log4j.Logger;
-
-public class SetupMessage extends AbstractActionPipelineProcessor {
- private Logger logger = Logger.getLogger(SetupMessage.class);
- private int status = 0;
-
- public Message process(Message message) throws ActionProcessingException {
- HashMap transformedBeans = (HashMap) message.getBody().get("EXTRACTED_BEANS_HASH");
- if(transformedBeans != null) {
- OrderHeader header = (OrderHeader) transformedBeans.get("orderHeader");
- Customer customer = (Customer) transformedBeans.get("customer");
- customer.setStatus(status); // demo purposes, passed in from the jboss-esb.xml
- message.getBody().add("TheOrderHeader",header);
- message.getBody().add("TheCustomer",customer);
- logger.info("Moved the transformed Order Header and Customer");
- }
- return message;
- }
-
- public SetupMessage(ConfigTree configTree) {
- status = Integer.parseInt(configTree.getAttribute("status"));
- }
-
-}
\ No newline at end of file
More information about the jboss-svn-commits
mailing list