diff --git a/getting-started/xml/.classpath b/getting-started/xml/.classpath index 24166ba5..dde3100b 100644 --- a/getting-started/xml/.classpath +++ b/getting-started/xml/.classpath @@ -1,6 +1,9 @@ + + + diff --git a/getting-started/xml/.gitignore b/getting-started/xml/.gitignore new file mode 100644 index 00000000..ea8c4bf7 --- /dev/null +++ b/getting-started/xml/.gitignore @@ -0,0 +1 @@ +/target diff --git a/getting-started/xml/.settings/com.springsource.sts.config.flow.prefs b/getting-started/xml/.settings/com.springsource.sts.config.flow.prefs new file mode 100644 index 00000000..eb28a0f5 --- /dev/null +++ b/getting-started/xml/.settings/com.springsource.sts.config.flow.prefs @@ -0,0 +1,3 @@ +#Thu Sep 16 19:13:50 EDT 2010 +//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/xml/src/main/resources/META-INF/spring/integration/orderProcessingSample.xml=\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n +eclipse.preferences.version=1 diff --git a/getting-started/xml/pom.xml b/getting-started/xml/pom.xml index c054a1fb..ec401621 100644 --- a/getting-started/xml/pom.xml +++ b/getting-started/xml/pom.xml @@ -2,34 +2,47 @@ 4.0.0 - - org.springframework.integration.samples - spring-integration-samples - 2.0.0.BUILD-SNAPSHOT - + org.springframework.integration.samples xml Spring Integration XML Sample + 2.0.0 + jar + + 2.0.0.M7 + 1.2.15 + 4.7 + org.springframework.integration spring-integration-xml + ${spring.integration.version} + + + log4j + log4j + ${log4j.version} + + + + junit + junit + ${junit.version} - - - repository.springframework.maven.release - Spring Framework Maven Release Repository - http://maven.springframework.org/release - - - repository.springframework.maven.milestone - Spring Framework Maven Milestone Repository - http://maven.springframework.org/milestone - - - repository.springframework.maven.snapshot - Spring Framework Maven Snapshot Repository - http://maven.springframework.org/snapshot - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + -Xlint:all + true + false + + + + + \ No newline at end of file diff --git a/getting-started/xml/readme.txt b/getting-started/xml/readme.txt new file mode 100644 index 00000000..083a5f3a --- /dev/null +++ b/getting-started/xml/readme.txt @@ -0,0 +1,25 @@ +This example demonstrates the following aspects of the XML support available with Spring Integration: +1. XPath Splitter - to split an order with multiple items into several order messages for separate processing. +2. XPath Router - to route messages according to the evaluation of an XPath expression which tests to see if the order item is in stock. +3. XPath Expression - which tests to see if the order item is in stock +3. XSLT Transformer - to transform the payload of the order message into a resupply message where the order item is found to be out of stock. + +To run sample simply execute BookOrderProcessingTest. You should see the following output: + +INFO : org.springframework.integration.samples.xml.WarehouseDispatch - Warehouse dispatching orderItem: + + + 0321200683 + 2 + + +INFO : org.springframework.integration.samples.xml.ExternalResupply - Placing resupply order: + + + + smallbooks + 5 + 1590596439 + + diff --git a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/ExternalResupply.java b/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/ExternalResupply.java index 3923057e..59cccfd8 100644 --- a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/ExternalResupply.java +++ b/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/ExternalResupply.java @@ -16,12 +16,17 @@ package org.springframework.integration.samples.xml; +import org.apache.log4j.Logger; import org.w3c.dom.Document; - +/** + * + * @author Jonas Partner + */ public class ExternalResupply { + private static Logger logger = Logger.getLogger(ExternalResupply.class); public void orderResupply(Document resupplyOrder) { - System.out.println("Placing resupply order: " + XmlUtil.docAsString(resupplyOrder)); + logger.info("Placing resupply order: \n" + XmlUtil.docAsString(resupplyOrder)); } } diff --git a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/WarehouseDispatch.java b/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/WarehouseDispatch.java index 832f8f7a..dc5a8b83 100644 --- a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/WarehouseDispatch.java +++ b/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/WarehouseDispatch.java @@ -16,12 +16,17 @@ package org.springframework.integration.samples.xml; +import org.apache.log4j.Logger; import org.w3c.dom.Document; - +/** + * + * @author Jonas Partner + */ public class WarehouseDispatch { - + private static Logger logger = Logger.getLogger(WarehouseDispatch.class); + public void dispatch(Document orderItem){ - System.out.println("Warehouse dispatching orderItem: " + XmlUtil.docAsString(orderItem)); + logger.info("Warehouse dispatching orderItem: \n" + XmlUtil.docAsString(orderItem)); } } diff --git a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/orderProcessingSample.xml b/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/orderProcessingSample.xml deleted file mode 100644 index 62f391c0..00000000 --- a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/orderProcessingSample.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/bigBooksSupplierTransformer.xsl b/getting-started/xml/src/main/resources/META-INF/spring/integration/bigBooksSupplierTransformer.xsl similarity index 100% rename from getting-started/xml/src/main/java/org/springframework/integration/samples/xml/bigBooksSupplierTransformer.xsl rename to getting-started/xml/src/main/resources/META-INF/spring/integration/bigBooksSupplierTransformer.xsl diff --git a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/order.xml b/getting-started/xml/src/main/resources/META-INF/spring/integration/order.xml similarity index 100% rename from getting-started/xml/src/main/java/org/springframework/integration/samples/xml/order.xml rename to getting-started/xml/src/main/resources/META-INF/spring/integration/order.xml diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/orderProcessingSample.xml b/getting-started/xml/src/main/resources/META-INF/spring/integration/orderProcessingSample.xml similarity index 97% rename from getting-started/xml/target/classes/org/springframework/integration/samples/xml/orderProcessingSample.xml rename to getting-started/xml/src/main/resources/META-INF/spring/integration/orderProcessingSample.xml index 62f391c0..d8111e6a 100644 --- a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/orderProcessingSample.xml +++ b/getting-started/xml/src/main/resources/META-INF/spring/integration/orderProcessingSample.xml @@ -61,7 +61,7 @@ + xsl-resource="classpath:/META-INF/spring/integration/bigBooksSupplierTransformer.xsl"/> diff --git a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/BookOrderProcessingSample.java b/getting-started/xml/src/test/java/org/springframework/integration/samples/xml/BookOrderProcessingTest.java similarity index 88% rename from getting-started/xml/src/main/java/org/springframework/integration/samples/xml/BookOrderProcessingSample.java rename to getting-started/xml/src/test/java/org/springframework/integration/samples/xml/BookOrderProcessingTest.java index a53ccd36..b407a537 100644 --- a/getting-started/xml/src/main/java/org/springframework/integration/samples/xml/BookOrderProcessingSample.java +++ b/getting-started/xml/src/test/java/org/springframework/integration/samples/xml/BookOrderProcessingTest.java @@ -49,13 +49,15 @@ import org.springframework.integration.message.GenericMessage; * * @author Jonas Partner */ -public class BookOrderProcessingSample { +public class BookOrderProcessingTest { public static void main(String[] args) throws Exception { - AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext("orderProcessingSample.xml", - BookOrderProcessingSample.class); + AbstractApplicationContext applicationContext = + new ClassPathXmlApplicationContext("/META-INF/spring/integration/orderProcessingSample.xml", + BookOrderProcessingTest.class); MessageChannel messageChannel = (MessageChannel) applicationContext.getBean("ordersChannel"); - GenericMessage orderMessage = createXmlMessageFromResource("org/springframework/integration/samples/xml/order.xml"); + GenericMessage orderMessage = + createXmlMessageFromResource("META-INF/spring/integration/order.xml"); messageChannel.send(orderMessage); applicationContext.close(); } diff --git a/getting-started/xml/src/main/java/log4j.xml b/getting-started/xml/src/test/resources/log4j.xml similarity index 79% rename from getting-started/xml/src/main/java/log4j.xml rename to getting-started/xml/src/test/resources/log4j.xml index da6411c7..f391e2ed 100644 --- a/getting-started/xml/src/main/java/log4j.xml +++ b/getting-started/xml/src/test/resources/log4j.xml @@ -15,12 +15,8 @@ - - - - - - + + @@ -28,5 +24,5 @@ - + \ No newline at end of file diff --git a/getting-started/xml/target/classes/log4j.xml b/getting-started/xml/target/classes/log4j.xml deleted file mode 100644 index da6411c7..00000000 --- a/getting-started/xml/target/classes/log4j.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/BookOrderProcessingSample.class b/getting-started/xml/target/classes/org/springframework/integration/samples/xml/BookOrderProcessingSample.class deleted file mode 100644 index ede83c60..00000000 Binary files a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/BookOrderProcessingSample.class and /dev/null differ diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/ExternalResupply.class b/getting-started/xml/target/classes/org/springframework/integration/samples/xml/ExternalResupply.class deleted file mode 100644 index 0feb94c4..00000000 Binary files a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/ExternalResupply.class and /dev/null differ diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/StockChecker.class b/getting-started/xml/target/classes/org/springframework/integration/samples/xml/StockChecker.class deleted file mode 100644 index 07d18e2a..00000000 Binary files a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/StockChecker.class and /dev/null differ diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/WarehouseDispatch.class b/getting-started/xml/target/classes/org/springframework/integration/samples/xml/WarehouseDispatch.class deleted file mode 100644 index 28bc4383..00000000 Binary files a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/WarehouseDispatch.class and /dev/null differ diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/XmlUtil.class b/getting-started/xml/target/classes/org/springframework/integration/samples/xml/XmlUtil.class deleted file mode 100644 index 45854e3c..00000000 Binary files a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/XmlUtil.class and /dev/null differ diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/bigBooksSupplierTransformer.xsl b/getting-started/xml/target/classes/org/springframework/integration/samples/xml/bigBooksSupplierTransformer.xsl deleted file mode 100644 index 0791aff4..00000000 --- a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/bigBooksSupplierTransformer.xsl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - smallbooks - 5 - - - - - - - - \ No newline at end of file diff --git a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/order.xml b/getting-started/xml/target/classes/org/springframework/integration/samples/xml/order.xml deleted file mode 100644 index cb4c48cb..00000000 --- a/getting-started/xml/target/classes/org/springframework/integration/samples/xml/order.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - 0321200683 - 2 - - - 1590596439 - 1 - - \ No newline at end of file diff --git a/getting-started/xml/target/maven-archiver/pom.properties b/getting-started/xml/target/maven-archiver/pom.properties deleted file mode 100644 index eb873c1a..00000000 --- a/getting-started/xml/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Sat Sep 04 08:22:37 EDT 2010 -version=2.0.0.BUILD-SNAPSHOT -groupId=org.springframework.integration.samples -artifactId=xml diff --git a/getting-started/xml/target/xml-2.0.0.BUILD-SNAPSHOT.jar b/getting-started/xml/target/xml-2.0.0.BUILD-SNAPSHOT.jar deleted file mode 100644 index b12fabb4..00000000 Binary files a/getting-started/xml/target/xml-2.0.0.BUILD-SNAPSHOT.jar and /dev/null differ