[jboss-svn-commits] JBL Code SVN: r8665 - in labs/jbossesb/trunk/product/samples/quickstarts: . transformation_string_manipulation transformation_string_manipulation/build transformation_string_manipulation/build/classes transformation_string_manipulation/build/classes/quickstart transformation_string_manipulation/build/classes/quickstart/helloworld transformation_string_manipulation/build/classes/quickstart/helloworld/test transformation_string_manipulation/src transformation_string_manipulation/src/quickstart transformation_string_manipulation/src/quickstart/helloworld transformation_string_manipulation/src/quickstart/helloworld/test
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jan 3 12:17:42 EST 2007
Author: tfennelly
Date: 2007-01-03 12:17:35 -0500 (Wed, 03 Jan 2007)
New Revision: 8665
Added:
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/README.txt
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/SampleOrder.xml
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/base-build.xml
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/test/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/test/OrderDate.class
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/test/SendJMSMessage.class
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/transformation-string-manipulation-quickstart.jar
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb.xml
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/lib/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-cdr.lst
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-res.xml
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/OrderDate.java
labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/SendJMSMessage.java
Log:
added
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/README.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/README.txt 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/README.txt 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,76 @@
+Overview:
+=========
+ This is another simple example of how to manually define and apply a Message Transformation within
+ within JBoss ESB 4.0GA.
+
+ This Quickstart is an extension of the "transformation_simple" Quickstart, demonstrating how
+ JBoss ESB Transformations can simplify your XSLT transformations by combining the
+ power of XSLT with Java. In this Quickstart, we use Java to perform the ugly string manipulation
+ on the SampleOrder date field (see OrderDate.java) and use XSLT for what it's good at i.e.
+ Templating. Again, the transformed SampleOrder.xml message is just printed to the Java
+ console (message before and after).
+
+ This Quickstart does not use the JBoss ESB Administration Console to manage the
+ message Transformation configurations to the ESB. See the end of this README for details on how
+ to manage this Quickstart's transformations vai the Console.
+
+
+Before Running:
+===============
+ 1. Update the "jbosshome.dir" property in the quickstarts.properties file in "../".
+ 2. Make sure the jbossesb.sar is deployed on your JBoss Application Server.
+ 3. Make sure the JBoss Application server is running.
+ 4. It would be a great idea to read MessageTransformation.pdf to fully understand this
+ Quickstart. It is located in the docs/services folder.
+
+
+To Run:
+=======
+ 1. In a command terminal window in this folder ("Window1"), type "ant run".
+ 2. Open another command terminal window in this folder ("Window2"), type "ant runtest".
+ 3. Switch back to "Window1" to see the message transformation before and after.
+
+
+What to look at in this Quickstart:
+===================================
+ As stated above, a read of MessageTransformation.pdf would be of great benefit in understanding
+ JBoss ESB Transformations.
+
+ jbossesb.xml: The ESB configuration file in this Quickstart simply defines a JMS Listener for receiving
+ the contents of the SampleOrder.xml file located in this folder (line 31). The listener
+ configuration then executes the "SmooksTransformer" action for the Message Exchange between
+ "A" and "B".
+
+ smooks-cdr.lst: This file is used by the JBoss ESB Transformation Service to list the Transformation
+ resource configuration URIs. Out of the box, the smoooks-cdr.lst file in this Quickstart
+ refers to 2 resource URIs, both of which are classpath based. It also has a commented
+ out listing for accessing Transformation Configurations managed by the JBoss ESB
+ Administration Conosle (see below).
+
+ smooks-res.xml: This file defines the Transformations for the Quickstart. This time, there are a number of
+ transformation configurations, all "targeted" at the same message.
+
+ OrderDate.java: (In the src tree). This is just a simple POJO class. It gets populated by JBoss ESB
+ Transformation (via Smooks) and is used by the XSLT (defined in smooks-res.xml)
+ to generate the new OrderDate element in the output message. This class uses the standard
+ Java SimpleDateFormat class for decoding the orderDate value and extracting the components of
+ the date from it (day, month, zone etc). This means you avoid having to do this in your XSLT
+ code, which would be very ugly and difficult to maintain.
+
+
+Playing with this Transformation through the Administration Console:
+====================================================================
+ To load the Transformation Configurations defined in smooks-res.xml into the Admin Console, and have them
+ managed from the Admin Console, do the following:
+
+ 1. Deploy the console as outlined in MessageTransformation.pdf.
+ 2. Edit the smooks-cdr.lst file in this folder, commenting out both the classpath based listings and
+ uncommenting out the listing for the console HTTP URI.
+ 3. In the console:
+ a) Add "Message Exchange Participants" for "A" and "B" through the "Manage Message Exchange Participants" form.
+ b) Add new "Message Contract" against "A" and "B" for "text/xml:messageAtA" and "text/xml:messageAtB" respectively.
+ Note: "messageAtA" and "messageAtB" are the Message Namespace values and "text/xml" is the Message Mime in
+ both cases.
+ c) Import "smooks-res.xml" through the "Import Configurations" form.
+ 4. You are now ready to start managing the message transformations through the console. You can add more
+ transformations and modify the existing transformations. Be sure to read MessageTransformation.pdf!!!
\ No newline at end of file
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/SampleOrder.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/SampleOrder.xml 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/SampleOrder.xml 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,11 @@
+<Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" netAmount="59.97" totalAmount="64.92" tax="4.95">
+ <Customer userName="user1" firstName="Harry" lastName="Fletcher" state="SD"/>
+ <OrderLines>
+ <OrderLine position="1" quantity="1">
+ <Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+ </OrderLine>
+ <OrderLine position="2" quantity="1">
+ <Product productId="299" title="Pulp Fiction" price="29.99"/>
+ </OrderLine>
+ </OrderLines>
+</Order>
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/base-build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/base-build.xml 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/base-build.xml 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,52 @@
+<project name="Base" default="run" basedir=".">
+
+ <property file="../quickstarts.properties" />
+
+ <property name="classes" value="build/classes" />
+
+ <path id="compile-classpath">
+ <fileset dir="lib" includes="*.jar" /> <!-- Quickstart Specific Jars. -->
+ <fileset dir="../../../lib/ext" includes="*.jar" /> <!-- Product Dependencies. -->
+ <fileset dir="${esb.product.lib.dir}" includes="*.jar" /> <!-- Product Jars. -->
+ </path>
+ <path id="exec-classpath">
+ <pathelement location="." />
+ <fileset dir="build" includes="${ant.project.name}.jar" />
+ <path refid="compile-classpath" />
+ <fileset dir="${jbosshome.dir}/server/default/lib" includes="jboss-j2ee.jar" /> <!-- Required for JMS Client Code. -->
+ </path>
+
+ <target name="compile" depends="clean">
+ <mkdir dir="${classes}" />
+ <javac srcdir="src" destdir="${classes}">
+ <classpath refid="compile-classpath" />
+ </javac>
+ <jar basedir="${classes}" destfile="build/${ant.project.name}.jar" />
+ </target>
+
+ <target name="run" depends="compile">
+ <echo>Launching Quickstart in standalone mode...</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper" failonerror="true">
+ <arg value="jbossesb.xml" />
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+
+ <target name="deployToSAR">
+ <echo>Deploys the project to the JBoss Application Server ESB SAR</echo>
+ <copy file="build/${ant.project.name}.jar" overwrite="true" todir="${jbosshome.dir}/server/default/deploy/jbossesb.sar" />
+ <copy file="jbossesb.xml" overwrite="true" todir="${jbosshome.dir}/server/default/conf" />
+ <touch file="${jbosshome.dir}/server/default/deploy/jbossesb.sar/META-INF/jboss-service.xml" />
+ <echo>Check your AS console to see if everything deployed properly then run 'ant runtest'</echo>
+ </target>
+
+ <target name="echoCP">
+ <property name="cp" refid="exec-classpath" />
+ <echo message="Classpath is ${cp}" />
+ </target>
+
+ <target name="clean">
+ <delete dir="build" />
+ </target>
+
+</project>
\ No newline at end of file
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/test/OrderDate.class
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/test/OrderDate.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/test/SendJMSMessage.class
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/classes/quickstart/helloworld/test/SendJMSMessage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/transformation-string-manipulation-quickstart.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build/transformation-string-manipulation-quickstart.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build.xml 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/build.xml 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,17 @@
+<project name="transformation-string-manipulation-quickstart" default="run" basedir=".">
+
+ <!-- Import the base Ant build script... -->
+ <import file="base-build.xml"/>
+
+ <!-- The ESB itself is started by the default "run" target - defined in base-build.xml -->
+
+ <!-- Target for injecting the sample order message for transformation... -->
+ <target name="runtest">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="quickstart.helloworld.test.SendJMSMessage" failonerror="true">
+ <arg value="SampleOrder.xml" />
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+
+</project>
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb-properties.xml 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb-properties.xml 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb.xml 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jbossesb.xml 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,47 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+ xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd">
+
+ <providers>
+ <jms-provider name="JBossMQ"
+ connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-URL="localhost">
+
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/A" />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/B" />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service category="FirstServicesGW" name="SimpleJMSGateway"
+ description="Hello World(gateway)" is-gateway="true"
+ target-service-category="FirstServiceESB"
+ target-service-name="SimpleListener">
+ <listeners>
+ <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel" maxThreads="1" />
+ </listeners>
+ </service>
+
+ <service category="FirstServiceESB" name="SimpleListener"
+ description="Hello World" is-gateway="false">
+ <listeners>
+ <jms-listener name="quickstart" busidref="quickstartEsbChannel" maxThreads="1" />
+ </listeners>
+ <actions>
+ <action name="transform" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <property name="from" value="A" />
+ <property name="from-type" value="text/xml:messageAtA" />
+ <property name="to" value="B" />
+ <property name="to-type" value="text/xml:messageAtB" />
+ </action>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jndi.properties 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/jndi.properties 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/juddi.properties 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/juddi.properties 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/log4j.xml 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/log4j.xml 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-cdr.lst
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-cdr.lst 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-cdr.lst 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,16 @@
+########################################################################################################
+# Uncomment out to load config from local XML file
+########################################################################################################
+/smooks-res.xml
+/org/milyn/templating/templating-cdu-creators-0.1.cdrl
+
+########################################################################################################
+# Uncomment out to load config from the
+# ESB Administration Console.
+#
+# You must "import" smooks-res.xml into the console in order to view and manipulate the
+# transformations in this sample. You will also need to register the "Message Exchange Participants"
+# "A" and "B" as well as their supported message contracts "text/xml:messageAtA" and
+# "text/xml:messageAtB" respectively.
+########################################################################################################
+#http://localhost:8080/jboss-esb-console/transform/smooks-config.jsp
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-res.xml 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/smooks-res.xml 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,55 @@
+<?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>
+
+ <!--
+ Create an instance of the OrderDate bean and bind it to the beanId "orderDate". This ID is
+ used later in the XSLT to refer to this bean.
+ -->
+ <smooks-resource selector="Order" useragent="from-type:text/xml:messageAtA AND from:A AND to-type:text/xml:messageAtB AND to:B" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
+ <param name="RESERVED:RESOURCE_NAME_PARAM"><![CDATA[JavaBean Create - Processing Phase]]></param>
+ <param name="beanId"><![CDATA[orderDate]]></param>
+ <param name="beanClass"><![CDATA[quickstart.helloworld.test.OrderDate]]></param>
+ <param name="addToList"><![CDATA[false]]></param>
+
+ </smooks-resource>
+
+ <!--
+ Populate the "orderDate" bean with the orderDate attribute value from the Order element.
+ -->
+ <smooks-resource selector="Order" useragent="from-type:text/xml:messageAtA AND from:A AND to-type:text/xml:messageAtB AND to:B" path="org.milyn.javabean.ProcessingPhaseBeanPopulator" >
+ <param name="RESERVED:RESOURCE_NAME_PARAM"><![CDATA[JavaBean Populate - Processing Phase]]></param>
+ <param name="beanId"><![CDATA[orderDate]]></param>
+ <param name="attributeName"><![CDATA[orderDate]]></param>
+ </smooks-resource>
+
+ <!--
+ Generate the new "OrderDate" element from the date data in the orderDate bean and insert the result before
+ the OrderLines element.
+ -->
+ <smooks-resource selector="OrderLines" useragent="from-type:text/xml:messageAtA AND from:A AND to-type:text/xml:messageAtB AND to:B" path="See 'resdata' parameter value" >
+ <param name="RESERVED:RESOURCE_NAME_PARAM"><![CDATA[XSLT (Templatelet)]]></param>
+ <param name="encoding"><![CDATA[UTF-8]]></param>
+
+ <param name="visitBefore"><![CDATA[false]]></param>
+ <param name="is-xslt-templatelet"><![CDATA[true]]></param>
+ <param name="restype"><![CDATA[xsl]]></param>
+ <param name="action"><![CDATA[insertbefore]]></param>
+ <param name="resdata"><![CDATA[<OrderDate>
+ <day><smooks-bean:select ognl="orderDate.day"/></day>
+ <time><smooks-bean:select ognl="orderDate.time"/></time>
+ <zone><smooks-bean:select ognl="orderDate.zone"/></zone>
+ <month><smooks-bean:select ognl="orderDate.month"/></month>
+ <year><smooks-bean:select ognl="orderDate.year"/></year>
+</OrderDate>]]></param>
+ </smooks-resource>
+
+ <!--
+ Remove the orderDate attribute from the Order element - it's now in the message as an OrderDate element.
+ -->
+ <smooks-resource selector="Order" useragent="from-type:text/xml:messageAtA AND from:A AND to-type:text/xml:messageAtB AND to:B" path="org.milyn.cdres.trans.RemoveAttributeTU" >
+ <param name="RESERVED:RESOURCE_NAME_PARAM"><![CDATA[Remove Attribute]]></param>
+ <param name="attributeName"><![CDATA[orderDate]]></param>
+ </smooks-resource>
+
+</smooks-resource-list>
\ No newline at end of file
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/OrderDate.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/OrderDate.java 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/OrderDate.java 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,79 @@
+/*
+ * 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 quickstart.helloworld.test;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Sample bean for orderDate manipulation Using Java. This type of thing is a
+ * real pain in XSLT!!
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OrderDate {
+
+ private Date orderDate;
+
+ /**
+ * Formatter for decoding the date from the message.
+ */
+ private static SimpleDateFormat dateDecodeFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
+
+ /**
+ * Formatters for encoding the date in the transformation.
+ */
+ private static SimpleDateFormat dayFormat = new SimpleDateFormat("dd");
+ private static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm");
+ private static SimpleDateFormat monthFormat = new SimpleDateFormat("MM");
+ private static SimpleDateFormat yearFormat = new SimpleDateFormat("yy");
+ private static SimpleDateFormat timezoneFormat = new SimpleDateFormat("Z");
+
+ public void setOrderDate(String orderDate) {
+ try {
+ // "Wed Nov 15 13:45:28 EST 2006"
+ // "EEE MMM dd HH:mm:ss z yyyy"
+ this.orderDate = dateDecodeFormat.parse(orderDate);
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+ }
+ public Date getOrderDate() {
+ return orderDate;
+ }
+ public String getDay() {
+ return dayFormat.format(orderDate);
+ }
+ public String getTime() {
+ return timeFormat.format(orderDate);
+ }
+ public String getMonth() {
+ return monthFormat.format(orderDate);
+ }
+ public String getYear() {
+ return yearFormat.format(orderDate);
+ }
+ public String getZone() {
+ return timezoneFormat.format(orderDate);
+ }
+}
Added: labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/SendJMSMessage.java 2007-01-03 16:44:40 UTC (rev 8664)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transformation_string_manipulation/src/quickstart/helloworld/test/SendJMSMessage.java 2007-01-03 17:17:35 UTC (rev 8665)
@@ -0,0 +1,73 @@
+package quickstart.helloworld.test;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.milyn.io.StreamUtils;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/A");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String fileName) throws JMSException, FileNotFoundException, IOException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm;
+ File file = new File(fileName);
+
+ if(!file.exists()) {
+ throw new IllegalArgumentException("Input message file [" + file.getAbsolutePath() + "] not found.");
+ }
+
+ String message = new String(StreamUtils.readStream(new FileInputStream(file)));
+
+ tm = session.createObjectMessage(message);
+ send.send(tm);
+ send.close();
+
+ System.out.println("*** Switch back to the ESB Java console now to see '" + fileName + "' before and after the transformation...");
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+ }
+
+}
\ No newline at end of file
More information about the jboss-svn-commits
mailing list