Author: DartPeng
Date: 2009-10-28 04:39:20 -0400 (Wed, 28 Oct 2009)
New Revision: 18333
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.classpath
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.project
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.settings/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.settings/org.eclipse.jdt.core.prefs
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/bin/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/bin/files/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/WEB-INF_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/css_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-java_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml-2_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/dao-router_input-message-dao.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-java_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-xml_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-with-import-to-java_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/freemarker-huge-transform_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/groovy_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-basic_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-java_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-xml_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/json-to-java_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic-virtual_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/profiling_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config-sax.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_bindings.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_datasources.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_edi-orders-parser.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-dao-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-jpa-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/splitter-router_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/validation-basic_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java-virtual_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-basic_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-groovy_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-namespaces_smooks-config.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/src/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/src/files/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/AbstractSmooksEditorTestcase.java
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/testfiles/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/testfiles/java-to-java.xml
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/util/
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/util/TestUtil.java
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/META-INF/MANIFEST.MF
Log:
JBIDE-4217
Add a test case to open the Smooks config file automatically
Modified: trunk/smooks/tests/org.jboss.tools.smooks.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.core.test/META-INF/MANIFEST.MF 2009-10-28
01:26:12 UTC (rev 18332)
+++ trunk/smooks/tests/org.jboss.tools.smooks.core.test/META-INF/MANIFEST.MF 2009-10-28
08:39:20 UTC (rev 18333)
@@ -12,8 +12,14 @@
org.jboss.tools.smooks.ui,
org.jboss.tools.smooks.core,
org.jboss.tools.tests,
- org.jboss.tools.smooks.runtime
-Eclipse-LazyStart: true
+ org.jboss.tools.smooks.runtime,
+ org.eclipse.core.filesystem,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.forms,
+ org.eclipse.jdt,
+ org.eclipse.jdt.core,
+ org.jboss.tools.common.test
+Bundle-ActivationPolicy: lazy
Bundle-ClassPath: lib/dom4j-1.6.1.jar,
.
Bundle-Vendor: %Bundle-Vendor.0
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.classpath
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.classpath
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.classpath 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.project
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.project
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.project 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>smooks-all-config-files</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.settings/org.eclipse.jdt.core.prefs 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,12 @@
+#Wed Oct 28 15:38:27 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/WEB-INF_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/WEB-INF_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/WEB-INF_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <profiles>
+ <profile base-profile="MSIE" sub-profiles="windows,large"
/>
+ <profile base-profile="Firefox"
sub-profiles="windows,large" />
+ </profiles>
+
+ <!-- Will be applied to MS Internet Explorer only... -->
+ <resource-config selector="b" target-profile="MSIE">
+ <resource>org.milyn.cdres.trans.SetAttributeTU</resource>
+ <param name="attributeName">style</param>
+ <param name="attributeValue">color: red</param>
+ </resource-config>
+
+ <!-- Will be applied to all "large" useragents (browsers) i.e.
+ both MSIE and Firefox... -->
+ <resource-config selector="b" target-profile="large">
+ <resource>org.milyn.cdres.trans.RenameElementTU</resource>
+ <param name="replacementElement">i</param>
+ </resource-config>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/WEB-INF_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/css_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/css_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/css_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <!--
+ Gather externally linked CSS info...
+ -->
+ <resource-config selector="link">
+ <resource>org.milyn.css.CSSStyleScraper</resource>
+ </resource-config>
+
+ <!--
+ Gather inlined CSS info...
+ -->
+ <resource-config selector="style">
+ <resource>org.milyn.css.CSSStyleScraper</resource>
+ </resource-config>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/css_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-java_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-java_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-java_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
+
+ <!--
+ Smooks v1.2 makes binding of CSV records very easy. Here
+ we create a List of Customer objects...
+ -->
+ <csv:reader fields="firstName,lastName,gender,age,country">
+ <csv:listBinding beanId="customerList"
class="example.Customer"/>
+ </csv:reader>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-java_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml-2_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml-2_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml-2_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd"
+
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
+
+ <!-- Use the SAX filter - more memory efficient and handle huge streams. -->
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ </params>
+
+ <!--
+ Configure the CSV Reader to read the message and change it into a stream of SAX
events.
+ Also binding each record into a Map so we can use it in a templating operation i.e.
to transform each record (below).
+ -->
+ <csv:reader fields="firstname,lastname,gender,age,country"
rootElementName="people" recordElementName="person">
+ <csv:singleBinding beanId="person"
class="java.util.HashMap"/>
+ </csv:reader>
+
+ <!-- Apply a FreeMarker template to each CSV record, generating a different XML
structure based on the gender value... -->
+ <ftl:freemarker applyOnElement="person">
+ <ftl:template><!--
+ <#if person.gender == "Male">
+ <male
age="${person.age}"><name><fn>${person.firstname}</fn><ln>${person.lastname}</ln></name><nationality>${person.country}</nationality></male>
+ <#else>
+ <female
age="${person.age}"><name><fn>${person.firstname}</fn><ln>${person.lastname}</ln></name><nationality>${person.country}</nationality></female>
+ </#if>-->
+ </ftl:template>
+ <ftl:use>
+ <ftl:inline directive="replace"/>
+ </ftl:use>
+ </ftl:freemarker>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml-2_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.1.xsd">
+
+ <!--
+ Configure the CSV Reader to read the message and change it into a stream of SAX
events.
+ -->
+ <csv:reader fields="firstname,lastname,gender,age,country" />
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/csv-to-xml_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/dao-router_input-message-dao.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/dao-router_input-message-dao.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/dao-router_input-message-dao.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,51 @@
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
xmlns:dao="http://www.milyn.org/xsd/smooks/persistence-1.2.xsd"...
+
+ <!--
+ The inserter calls (via Scribe) the SessionDaoAdapter#insert() method
+ at the visitAfter of the Order element. The SessioDaoAdapter#insert()
+ uses the Hibernate Session#save() method to persist the entity to the
+ database.
+ -->
+ <dao:inserter beanId="order" insertOnElement="order" />
+
+ <!--
+ This is a normal Javabean binding. It creates the order bean and binds
+ data into it.
+ -->
+ <jb:bean beanId="order" class="example.entity.Order"
+ createOnElement="order">
+
+ <jb:value property="ordernumber" data="ordernumber" />
+ <jb:value property="customerId" data="customer" />
+ <jb:wiring setterMethod="addOrderLine" beanIdRef="orderLine"
/>
+ </jb:bean>
+
+ <!--
+ This is a normal Javabean binding. Notice that we have a wiring on
+ 'product'. The Product entity will not be created, but looked up by a
+ locator.
+ -->
+ <jb:bean beanId="orderLine" class="example.entity.OrderLine"
+ createOnElement="order-item">
+
+ <jb:value property="quantity" data="quantity"
decoder="Integer" />
+ <jb:wiring property="order" beanIdRef="order" />
+ <jb:wiring property="product" beanIdRef="product" />
+ </jb:bean>
+
+ <!--
+ This locator calls (via Scribe) the SessionDaoAdapter#lookupByQuery()
+ method. The result will be added to the bean repository under the bean
+ id 'product'. An exception is thrown when no result is found.
+ -->
+ <dao:locator beanId="product" lookupOnElement="order-item"
+ onNoResult="EXCEPTION" uniqueResult="true">
+
+ <dao:query>from Product p where p.id = :id</dao:query>
+ <dao:params>
+ <dao:value name="id" data="product" decoder="Integer"
/>
+ </dao:params>
+ </dao:locator>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/dao-router_input-message-dao.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<medi:edimap
xmlns:medi="http://www.milyn.org/schema/edi-message-mapping-1.0.xsd&...
+
+ <medi:description name="DVD Order" version="1.0"/>
+
+ <medi:delimiters segment=" " field="*"
component="^" sub-component="~"/>
+
+ <medi:segments xmltag="orders">
+
+ <medi:segment segcode="MLS" xmltag="message-header">
+ <medi:field xmltag="date"/>
+ </medi:segment>
+
+ <medi:segment segcode="HDR" xmltag="order"
minOccurs="1" maxOccurs="-1">
+ <medi:field xmltag="order-id"/>
+ <medi:field xmltag="status-code"/>
+ <medi:field xmltag="net-amount"/>
+ <medi:field xmltag="total-amount"/>
+ <medi:field xmltag="tax"/>
+
+ <medi:segment segcode="CUS" xmltag="customer-details"
minOccurs="1" maxOccurs="1">
+ <medi:field xmltag="username"/>
+ <medi:field xmltag="name">
+ <medi:component xmltag="firstname"/>
+ <medi:component xmltag="lastname"/>
+ </medi:field>
+ <medi:field xmltag="state"/>
+ </medi:segment>
+
+ <medi:segment segcode="ORD" xmltag="order-item"
minOccurs="1" maxOccurs="-1">
+ <medi:field xmltag="position"/>
+ <medi:field xmltag="quantity"/>
+ <medi:field xmltag="productId"/>
+ <medi:field xmltag="title"/>
+ <medi:field xmltag="price"/>
+ </medi:segment>
+
+ </medi:segment>
+
+ </medi:segments>
+
+</medi:edimap>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-java_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-java_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-java_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <!--
+ Configure the EDI Reader to parse the message stream into a stream of SAX events.
+ -->
+ <edi:reader mappingModel="/example/edi-to-xml-order-mapping.xml" />
+
+ <!--
+ Create an "example.beans.Order" bean instance when we visit the start of
the <order> element.
+ Assign the new bean instance to the beanId of "order".
+ The "header" and "orderItemList" beans are wired in.
+ -->
+ <jb:bean beanId="order" class="example.model.Order"
createOnElement="order">
+ <jb:wiring property="header" beanIdRef="header" />
+ <jb:wiring property="orderItems" beanIdRef="orderItemList"
/>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.Header" bean instance when we visit the start of
the <order> element.
+ Note, we're creating this bean instance before we encounter the actual
<header> element.
+ This bean is wired into the "order" bean.
+ -->
+ <jb:bean beanId="header" class="example.model.Header"
createOnElement="order">
+ <jb:wiring property="customer" beanIdRef="customer" />
+ <jb:value property="orderId" data="header/order-id" />
+ <jb:value property="orderStatus" decoder="Long"
data="header/status-code" />
+ <jb:value property="netAmount" decoder="BigDecimal"
data="header/net-amount" />
+ <jb:value property="totalAmount" decoder="BigDecimal"
data="header/total-amount" />
+ <jb:value property="tax" decoder="BigDecimal"
data="header/tax" />
+ <jb:value property="date" decoder="Date"
data="header/date">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z
yyyy</jb:decodeParam>
+ </jb:value>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.Customer" bean instance when we visit the start of
the
+ <customer-details> element.
+ This bean is wired into the "header" bean.
+ -->
+ <jb:bean beanId="customer" class="example.model.Customer"
createOnElement="customer-details">
+ <!-- Customer bindings... -->
+ <jb:value property="userName"
data="customer-details/username" />
+ <jb:value property="firstName"
data="customer-details/name/firstname" />
+ <jb:value property="lastName"
data="customer-details/name/lastname" />
+ <jb:value property="state" data="customer-details/state"
/>
+ </jb:bean>
+
+ <!--
+ Create an ArrayList when we visit the start of the <order> element.
+ The "orderItem" beans are wired into this list and this list is wired into the
"order" bean.
+ -->
+ <jb:bean beanId="orderItemList" class="java.util.ArrayList"
createOnElement="order">
+ <jb:wiring beanIdRef="orderItem" />
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.OrderItem" bean instance when we visit the start
of the <order-item> element.
+ This bean is wired into the "orderItemList" ArrayList.
+ -->
+ <jb:bean beanId="orderItem" class="example.model.OrderItem"
createOnElement="order-item">
+ <!-- OrderItem bindings... -->
+ <jb:value property="quantity" decoder="Integer"
data="order-item/quantity" />
+ <jb:value property="productId" decoder="String"
data="order-item/product-id" />
+ <jb:value property="price" decoder="BigDecimal"
data="order-item/price" />
+ <jb:value property="title" data="order-item/title" />
+ </jb:bean>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-java_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-xml_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-xml_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-xml_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.1.xsd">
+
+ <!--
+ Configure the EDI Reader to process the message stream into a stream of SAX events.
+ -->
+ <edi:reader mappingModel="/example/edi-to-xml-order-mapping.xml" />
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-to-xml_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-with-import-to-java_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-with-import-to-java_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-with-import-to-java_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <!--
+ Configure the EDI Reader to parse the message stream into a stream of SAX events.
+ -->
+ <edi:reader mappingModel="/example/edi-to-xml-order-mapping.xml" />
+
+ <!--
+ Create an "example.beans.Order" bean instance when we visit the start of
the <order> element.
+ Assign the new bean instance to the beanId of "order".
+ The "header" and "orderItemList" beans are wired in.
+ -->
+ <jb:bean beanId="order" class="example.model.Order"
createOnElement="order">
+ <jb:wiring property="header" beanIdRef="header" />
+ <jb:wiring property="orderItems" beanIdRef="orderItemList"
/>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.Header" bean instance when we visit the start of
the <order> element.
+ Note, we're creating this bean instance before we encounter the actual
<header> element.
+ This bean is wired into the "order" bean.
+ -->
+ <jb:bean beanId="header" class="example.model.Header"
createOnElement="order">
+ <jb:wiring property="customer" beanIdRef="customer" />
+ <jb:value property="orderId" data="header/order-id" />
+ <jb:value property="orderStatus" decoder="Long"
data="header/status-code" />
+ <jb:value property="netAmount" decoder="BigDecimal"
data="header/net-amount" />
+ <jb:value property="totalAmount" decoder="BigDecimal"
data="header/total-amount" />
+ <jb:value property="tax" decoder="BigDecimal"
data="header/tax" />
+ <jb:value property="date" decoder="Date"
data="header/date">
+ <jb:decodeParam
name="format">yyyyMMdd</jb:decodeParam>
+ </jb:value>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.Customer" bean instance when we visit the start of
the
+ <customer-details> element.
+ This bean is wired into the "header" bean.
+ -->
+ <jb:bean beanId="customer" class="example.model.Customer"
createOnElement="customer-details">
+ <!-- Customer bindings... -->
+ <jb:value property="userName"
data="customer-details/username" />
+ <jb:value property="firstName"
data="customer-details/name/firstname" />
+ <jb:value property="lastName"
data="customer-details/name/lastname" />
+ <jb:value property="state" data="customer-details/state"
/>
+ </jb:bean>
+
+ <!--
+ Create an ArrayList when we visit the start of the <order> element.
+ The "orderItem" beans are wired into this list and this list is wired into the
"order" bean.
+ -->
+ <jb:bean beanId="orderItemList" class="java.util.ArrayList"
createOnElement="order">
+ <jb:wiring beanIdRef="orderItem" />
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.OrderItem" bean instance when we visit the start
of the <order-item> element.
+ This bean is wired into the "orderItemList" ArrayList.
+ -->
+ <jb:bean beanId="orderItem" class="example.model.OrderItem"
createOnElement="order-item">
+ <!-- OrderItem bindings... -->
+ <jb:value property="quantity" decoder="Integer"
data="order-item/quantity" />
+ <jb:value property="productId" decoder="String"
data="order-item/product-id" />
+ <jb:value property="price" decoder="BigDecimal"
data="order-item/price" />
+ <jb:value property="title" data="order-item/title" />
+ </jb:bean>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/edi-with-import-to-java_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/freemarker-huge-transform_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/freemarker-huge-transform_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/freemarker-huge-transform_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
+
+ <!--
+ Filter the message using the SAX Filter (i.e. not DOM, so no
+ intermediate DOM for the "complete" message - there are "mini"
DOMs
+ for the NodeModels below)....
+ -->
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ <param name="default.serialization.on">false</param>
+ </params>
+
+ <!--
+ Create 2 NodeModels. One high level model for the "order"
+ (header etc) and then one per "order-item".
+
+ These models are used in the FreeMarker templating resources
+ defined below. You need to make sure you set the selector such
+ that the total memory footprint is as low as possible. In this
+ example, the "order" model will contain everything accept the
+ <order-item> data (the main bulk of data in the message). The
+ "order-item" model only contains the current <order-item> data
+ (i.e. there's max 1 order-item in memory at any one time).
+ -->
+ <resource-config selector="order,order-item">
+ <resource>org.milyn.delivery.DomModelCreator</resource>
+ </resource-config>
+
+ <!--
+ Apply the first part of the template when we reach the start
+ of the <order-items> element. Apply the second part when we
+ reach the end.
+
+ Note the <?TEMPLATE-SPLIT-PI?> Processing Instruction in the
+ template. This tells Smooks where to split the template,
+ resulting in the order-items being inserted at this point.
+ -->
+ <ftl:freemarker applyOnElement="order-items">
+ <ftl:template><!--<salesorder>
+ <details>
+ <orderid>${order.@id}</orderid>
+ <customer>
+ <id>${order.header.customer.@number}</id>
+ <name>${order.header.customer}</name>
+ </customer>
+ </details>
+ <itemList>
+ <?TEMPLATE-SPLIT-PI?>
+ </itemList>
+</salesorder>--></ftl:template>
+ </ftl:freemarker>
+
+ <!--
+ Output the <order-items> elements. This will appear in the
+ output message where the <?TEMPLATE-SPLIT-PI?> token appears in the
+ order-items template.
+ -->
+<ftl:freemarker applyOnElement="order-item">
+ <ftl:template><!-- <item>
+ <id>${.vars["order-item"].@id}</id>
+ <productId>${.vars["order-item"].product}</productId>
+ <quantity>${.vars["order-item"].quantity}</quantity>
+ <price>${.vars["order-item"].price}</price>
+ </item>
+ --></ftl:template>
+</ftl:freemarker>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/freemarker-huge-transform_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/groovy_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/groovy_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/groovy_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:g="http://www.milyn.org/xsd/smooks/groovy-1.1.xsd">
+
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ </params>
+
+ <g:groovy executeOnElement="category">
+ <g:script>
+ <!--
+ use(DOMCategory) {
+
+ // Modify "supplies": we need an extra 2 pens...
+ if (element.'@type' == 'supplies') {
+ element.item.each { item ->
+ if (item.text() == 'Pens') {
+ item['@quantity'] =
item.'(a)quantity'.toInteger() + 2;
+ }
+ }
+ }
+ }
+
+ // When using the SAX filter, we need to explicitly write the fragment
+ // to the result stream...
+ writeFragment(element);
+ -->
+ </g:script>
+ </g:groovy>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/groovy_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-basic_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-basic_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-basic_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <resource-config selector="c b">
+ <resource>example.BasicJavaTransformer</resource>
+ <param name="newName">xxx</param>
+ </resource-config>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-basic_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-java_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-java_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-java_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ </params>
+
+ <jb:bean beanId="lineOrder" class="example.trgmodel.LineOrder"
createOnElement="example.srcmodel.Order">
+ <jb:wiring property="lineItems" beanIdRef="lineItems"
/>
+ <jb:value property="customerId"
data="header/customerNumber" />
+ <jb:value property="customerName"
data="header/customerName" />
+ <jb:value property="priority" data="header/priority"
decoder="Enum">
+ <jb:decodeParam
name="enumType">example.trgmodel.LineOrderPriority</jb:decodeParam>
+ <jb:decodeParam name="LOW">NOT_IMPORTANT</jb:decodeParam>
+ <jb:decodeParam name="MEDIUM">IMPORTANT</jb:decodeParam>
+ <jb:decodeParam
name="HIGH">VERY_IMPORTANT</jb:decodeParam>
+ </jb:value>
+ </jb:bean>
+
+ <jb:bean beanId="lineItems"
class="example.trgmodel.LineItem[]" createOnElement="orderItems">
+ <jb:wiring beanIdRef="lineItem" />
+ </jb:bean>
+
+
+ <jb:bean beanId="lineItem" class="example.trgmodel.LineItem"
createOnElement="example.srcmodel.OrderItem">
+ <jb:value property="productCode"
data="example.srcmodel.OrderItem/productId" />
+ <jb:value property="unitQuantity" decoder="Integer"
data="example.srcmodel.OrderItem/quantity" />
+ <jb:value property="unitPrice" decoder="BigDecimal"
data="example.srcmodel.OrderItem/price" />
+ </jb:bean>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-java_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-xml_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-xml_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-xml_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <resource-config selector="global-parameters">
+ <param name="stream.filter.type">SAX</param>
+ </resource-config>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/java-to-xml_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/json-to-java_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/json-to-java_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/json-to-java_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:json="http://www.milyn.org/xsd/smooks/json-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <!--
+ Configure the JSON Reader to read the message stream into a stream of SAX events.
+
+ The input message contains whitespaces in the key names. Whitespaces aren't
allowed in
+ element names of the SAX event stream. To solve this we replace the whitespaces with
dashes (-).
+
+ Another special case is that the is a key called date&time. The ampersand
isn't allowed in a
+ element name of the SAX event stream. We can solve this in two ways. Configure the
reader, with
+ the illegalElementNameCharReplacement parameter, to replace all illegal characters
with
+ a character that is allowed. In this example however we solve it by mapping the
"date&time" key
+ to the "date-and-time" name.
+
+ There are more settings to for the org.milyn.json.JSONReader.
+ Take a look at the Javadoc of the class for alle the possible parameters.
+ -->
+ <json:reader rootName="order" keyWhitspaceReplacement="-">
+ <json:keyMap>
+ <json:key from="date&time" to="date-and-time" />
+ </json:keyMap>
+ </json:reader>
+
+
+ <!--
+ Create an "example.beans.Order" bean instance when we visit the start of
the <order> element.
+ Assign the new bean instance to the beanId of "order".
+ Target the to be created Header bean under the beanId "header" via the
${header} bean binding.
+ As soon as this bean is created it will be set on this bean instance.
+ Target the to be created ArrayList instance under the beanId "orderItems"
via the ${orderItems} bean binding.
+ As soon as this list is created it will be set on this bean instance.
+ -->
+ <jb:bean class="example.model.Order" beanId="order"
createOnElement="order">
+ <jb:wiring property="header" beanIdRef="header"/>
+ <jb:wiring property="orderItems" beanIdRef="orderItems"/>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.Header" bean instance when we visit the start of
the <order> element.
+ Note, we're creating this bean instance before we encounter the actual
<header> element.
+ This bean is set on the on the previous declared Order bean as soon as it is created,
because
+ it is target by that bean via a bean binding.
+ Target the to be created Customer instance under the beanId "customer" via
the ${customer} bean binding.
+ As soon as this bean is created it will be set on this bean instance.
+ -->
+ <jb:bean class="example.model.Header" beanId="header"
createOnElement="order">
+ <jb:wiring property="customer" beanIdRef="customer"/>
+
+ <jb:value property="orderId" data="header order-id" />
+ <jb:value property="orderStatus" data="header status-code"
decoder="Long" />
+ <jb:value property="netAmount" data="header net-amount"
decoder="BigDecimal"/>
+ <jb:value property="totalAmount" data="header total-amount"
decoder="BigDecimal"/>
+ <jb:value property="tax" data="header tax"
decoder="BigDecimal"/>
+ <jb:value property="date" data="header date-and-time"
decoder="Date">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z
yyyy</jb:decodeParam>
+ <jb:decodeParam
name="locale-language">en</jb:decodeParam>
+ <jb:decodeParam
name="locale-country">IE</jb:decodeParam>
+ </jb:value>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.Customer" bean instance when we visit the start of
the
+ <customer-details> element.
+ This bean is set on the on the previous declared Header bean as soon as it is created,
because
+ it is target by that bean via a bean binding.
+ -->
+ <jb:bean class="example.model.Customer" beanId="customer"
createOnElement="customer-details">
+ <jb:value property="userName" data="customer-details
username" />
+ <jb:value property="firstName" data="customer-details
firstname" />
+ <jb:value property="lastName" data="customer-details
lastname"/>
+ <jb:value property="state" data="customer-details
state"/>
+ </jb:bean>
+
+ <!--
+ Create an ArrayList when we visit the start of the <order> element.
+ This list is set on the on the previous declared Order bean as soon as it is created,
because
+ it is target by that bean via a bean binding.
+ Target the to be created OrderItem beans under the beanId "orderItem" via the
${orderItem} bean binding.
+ As soon as these beans are created they will be added to this list.
+ -->
+ <jb:bean class="java.util.ArrayList" beanId="orderItems"
createOnElement="order">
+ <jb:wiring beanIdRef="orderItem"/>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.OrderItem" bean instance when we visit the start
of the <order-item> element.
+ This bean is add to the on the previous declared ArrayList as soon as it is created,
because
+ it is target by that ArrayList via a bean binding.
+ -->
+ <jb:bean class="example.model.OrderItem" beanId="orderItem"
createOnElement="order-item element">
+ <jb:value property="quantity" data="order-item element
quantity" decoder="Integer"/>
+ <jb:value property="productId" data="order-item element
product-id" />
+ <jb:value property="price" data="order-item element price"
decoder="BigDecimal" />
+ <jb:value property="title" data="order-item element title"
/>
+ </jb:bean>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/json-to-java_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic-virtual_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic-virtual_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic-virtual_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
+
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
+
+ <!--
+ Use a FreeMarker template to perform the model driven transformation. You can also
inline the template here.
+ -->
+ <ftl:freemarker applyOnElement="#document">
+ <ftl:template>/example/templates/HistoryTrans.ftl</ftl:template>
+ </ftl:freemarker>
+
+ <!--
+ Configure the virtual "history" bean creation and population. Wires in the
"warehouse" bean.
+ -->
+ <jb:bean beanId="history" class="java.util.HashMap"
createOnElement="history">
+ <jb:wiring property="warehouse"
beanIdRef="warehouse"/>
+ <!-- Note the date decoder is not configured with a format. Will therefore
use the default (SOAP). See DateDecoder class. -->
+ <jb:value property="creationDate" decoder="Date"
data="header/date" />
+ <!-- Note the "special" decoder for the trackingNumbers. -->
+ <jb:value property="trackingNumbers"
decoder="example.decoders.TrackingNumberDecoder"
data="history/trackingNumbers" />
+ </jb:bean>
+
+ <!--
+ Configure the virtual "warehouse" bean creation and population.
+ Note how we create it on visiting the history. Is wired into the "history"
bean.
+ -->
+ <jb:bean beanId="warehouse" class="java.util.HashMap"
createOnElement="history">
+ <jb:value property="id" decoder="Integer"
data="history/@warehouse" />
+ <!-- Note the "special" decoder for mapping the warehouse id.
-->
+ <jb:value property="name" decoder="Mapping"
data="history/@warehouse">
+ <jb:decodeParam name="1">Dublin</jb:decodeParam>
+ <jb:decodeParam name="2">Belfast</jb:decodeParam>
+ <jb:decodeParam name="3">Cork</jb:decodeParam>
+ </jb:value>
+ </jb:bean>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic-virtual_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
+
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
+ <!--
+ This configuration binds data from the message into the Shipping object model,
+ and then uses that binding data in a FreeMarker template to generate the result...
+ -->
+
+ <!--
+ Configure the History bean creation and population. Wires in the
"warehouse" bean.
+ -->
+ <jb:bean beanId="history"
class="example.model.ShippingHistory" createOnElement="history">
+ <jb:wiring property="warehouse"
beanIdRef="warehouse"/>
+ <!-- Note the date decoder is not configured with a format. Will therefore
use the default (SOAP). See DateDecoder class. -->
+ <jb:value property="creationDate" decoder="Date"
data="header/date" />
+ <!-- Note the "special" decoder for the trackingNumbers. -->
+ <jb:value property="trackingNumbers"
decoder="example.model.TrackingNumberDecoder"
data="history/trackingNumbers" />
+ </jb:bean>
+
+ <!--
+ Configure the Warehouse bean creation and population.
+ Note how we create it on visiting the history. Is wired into the "history"
bean.
+ -->
+ <jb:bean beanId="warehouse" class="example.model.Warehouse"
createOnElement="history">
+ <jb:value property="id" decoder="Integer"
data="history/@warehouse" />
+ <!-- Note the "special" decoder for mapping the warehouse id.
-->
+ <jb:value property="name" decoder="Mapping"
data="history/@warehouse">
+ <jb:decodeParam name="1">Dublin</jb:decodeParam>
+ <jb:decodeParam name="2">Belfast</jb:decodeParam>
+ <jb:decodeParam name="3">Cork</jb:decodeParam>
+ </jb:value>
+ </jb:bean>
+
+ <!--
+ Use a FreeMarker template to perform the model driven transformation. You can also
inline the template here.
+ -->
+ <ftl:freemarker applyOnElement="#document">
+ <ftl:template>/example/templates/HistoryTrans.ftl</ftl:template>
+ </ftl:freemarker>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/model-driven-basic_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/profiling_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/profiling_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/profiling_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <profiles>
+ <profile base-profile="message-exchange-1"
sub-profiles="from-a,to-b" />
+ <profile base-profile="message-exchange-2"
sub-profiles="from-a,to-c" />
+ <profile base-profile="message-exchange-3"
sub-profiles="from-a,to-d" />
+
+ <profile base-profile="message-exchange-4"
sub-profiles="from-c,to-b" />
+ <profile base-profile="message-exchange-5"
sub-profiles="from-d,to-b" />
+ </profiles>
+
+ <resource-config selector="a" target-profile="from-a">
+ <resource>example.BasicJavaTransformer</resource>
+ <param name="newName">from-a</param>
+ </resource-config>
+
+ <resource-config selector="a b" target-profile="to-b">
+ <resource>example.BasicJavaTransformer</resource>
+ <param name="newName">to-b</param>
+ </resource-config>
+
+ <resource-config selector="c b" target-profile="to-c">
+ <resource>example.BasicJavaTransformer</resource>
+ <param name="newName">to-c</param>
+ </resource-config>
+
+ <resource-config selector="c" target-profile="to-d">
+ <resource>example.BasicJavaTransformer</resource>
+ <param name="newName">to-d</param>
+ </resource-config>
+
+ <resource-config selector="b c"
target-profile="message-exchange-5">
+ <resource>example.BasicJavaTransformer</resource>
+ <param name="newName">message-exchange-5</param>
+ </resource-config>
+
+ <resource-config selector="c b" target-profile="to-b AND
from-d">
+ <resource>example.BasicJavaTransformer</resource>
+ <param name="newName">d-to-b</param>
+ </resource-config>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/profiling_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,63 @@
+<medi:edimap
xmlns:medi="http://www.milyn.org/schema/edi-message-mapping-1.0.xsd&...
+
+ <medi:description name="rollingstock_edi" version="1.0" />
+
+ <medi:delimiters segment=" " field=","
component="*" sub-component="-"/>
+
+ <medi:segments xmltag="rollingstocks">
+
+ <medi:segment segcode="Ta" xmltag="rollingstock"
minOccurs="0" maxOccurs="-1">
+ <medi:field xmltag="departureDate"/>
+ <medi:field xmltag="departureTime"/>
+ <medi:field xmltag="rollingstockId"/>
+ <medi:field xmltag="departureSignature"/>
+ <medi:field xmltag="destinationSignature"/>
+ <medi:field xmltag="dayLimit"/>
+
+ <medi:segment segcode="Tr" xmltag="route"
minOccurs="0" maxOccurs="1">
+ <medi:field xmltag="route"/>
+ </medi:segment>
+
+ <medi:segment segcode="Fo" xmltag="vehicle"
minOccurs="0" maxOccurs="-1">
+ <medi:field xmltag="litt"/>
+ <medi:field xmltag="vehicleId"/>
+ <medi:field xmltag="originalLitt"/>
+ <medi:field xmltag="ticketId"/>
+ <medi:field xmltag="vehicleType"/>
+ <medi:field xmltag="weight"/>
+ <medi:field xmltag="dynamicWeight"/>
+ <medi:field xmltag="brakeWeight"/>
+ <medi:field xmltag="length"/>
+ <medi:field xmltag="nrOfAxles"/>
+ <medi:field xmltag="speed"/>
+ <medi:field xmltag="serviceType"/>
+ <medi:field xmltag="canDoorsBeLocked"/>
+ <medi:field xmltag="class1"/>
+ <medi:field xmltag="class2"/>
+ <medi:field xmltag="couchette"/>
+ <medi:field xmltag="nrOfCompartments"/>
+ <medi:field xmltag="nrOfPlacesPerCompartment"/>
+ <medi:field xmltag="departureStation"/>
+ <medi:field xmltag="departureDate"/>
+ <medi:field xmltag="departureTime"/>
+ <medi:field xmltag="destination"/>
+
+
+ <medi:segment segcode="Fx" xmltag="comments"
minOccurs="0" maxOccurs="1">
+ <medi:field xmltag="comment"/>
+ </medi:segment>
+
+ <medi:segment segcode="Ft" xmltag="phoneNumber"
minOccurs="0" maxOccurs="-1">
+ <medi:field xmltag="litt"/>
+ <medi:field xmltag="vehicleId"/>
+ <medi:field xmltag="phoneNumber"/>
+ <medi:field xmltag="function"/>
+ <medi:field xmltag="location"/>
+ </medi:segment>
+ </medi:segment>
+
+ </medi:segment>
+
+ </medi:segments>
+
+</medi:edimap>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config-sax.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config-sax.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config-sax.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd">
+
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ </params>
+
+ <import file="smooks-config.xml" />
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config-sax.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <edi:reader mappingModel="edi-mapping.xml" />
+
+ <jb:bean beanId="rollingstocks"
class="se.sj.ipl.rollingstock.domain.RollingStockList"
createOnElement="rollingstocks">
+ <jb:wiring setterMethod="add" beanIdRef="rollingstock"/>
+ </jb:bean>
+
+ <jb:bean beanId="rollingstock"
class="se.sj.ipl.rollingstock.domain.Rollingstock"
createOnElement="rollingstocks/rollingstock">
+ <jb:wiring property="schedule" beanIdRef="rollingstock_schedule"
/>
+ <jb:wiring property="vehicles" beanIdRef="vehicles" />
+
+ <jb:value property="rollingstockId"
data="rollingstock/rollingstockId" />
+ <jb:value property="route" data="rollingstock/route/route"
/>
+ </jb:bean>
+
+ <jb:bean beanId="rollingstock_schedule"
class="se.sj.ipl.rollingstock.domain.Schedule"
createOnElement="rollingstocks/rollingstock">
+
+ <jb:value property="departureStation" data="rollingstock
departureSignature" />
+ <jb:value property="departureDate" decoder="Date"
data="rollingstock departureDate" />
+ <jb:value property="departureTime" decoder="Time"
data="rollingstock departureTime" />
+ <jb:value property="destination" data="rollingstock
destinationSignature" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicles" class="java.util.ArrayList"
createOnElement="rollingstocks/rollingstock">
+ <jb:wiring beanIdRef="vehicle" />
+ </jb:bean>
+
+
+ <jb:bean beanId="vehicle"
class="se.sj.ipl.rollingstock.domain.Vehicle"
createOnElement="rollingstock/vehicle">
+ <jb:wiring property="schedule"
beanIdRef="vehicle_schedule"/>
+ <jb:wiring property="weight" beanIdRef="vehicle_weight"/>
+ <jb:wiring property="dynamicWeight"
beanIdRef="vehicle_dynamic_weight"/>
+ <jb:wiring property="dynamicBrakeWeight"
beanIdRef="vehicle_dynamic_brake_weight"/>
+ <jb:wiring property="length" beanIdRef="vehicle_length"/>
+ <jb:wiring property="speed" beanIdRef="vehicle_speed"/>
+ <jb:wiring property="comments"
beanIdRef="vehicle_comments"/>
+ <jb:wiring property="phoneNumbers"
beanIdRef="vehicle_phonenumbers"/>
+ <jb:wiring property="passengerCarConfiguration"
beanIdRef="passenger_car_configuration" />
+
+ <jb:value property="litt" data="vehicle litt" />
+ <jb:value property="originalLitt" data="vehicle
originalLitt" />
+ <jb:value property="ticketId" data="vehicle ticketId"
/>
+ <jb:value property="vehicleId" data="vehicle vehicleId"
/>
+ <jb:value property="vehicleType" data="vehicle
vehicleType" />
+ <jb:value property="nrOfAxles" decoder="Integer"
data="vehicle nrOfAxles" />
+ <jb:value property="serviceType" data="vehicle
serviceType" />
+ <jb:value property="canDoorsBeLocked" decoder="Boolean"
data="vehicle canDoorsBeLocked" />
+ <jb:value property="positionInTrainAssembly"
decoder="Boolean" data="vehicle positionInTrainAssembly" />
+ </jb:bean>
+
+
+ <jb:bean beanId="vehicle_schedule"
class="se.sj.ipl.rollingstock.domain.Schedule"
createOnElement="rollingstock/vehicle">
+ <jb:value property="departureStation" data="vehicle
departureStation" />
+ <jb:value property="departureDate" decoder="Date"
data="vehicle departureDate" />
+ <jb:value property="departureTime" decoder="Time"
data="vehicle departureTime" />
+ <jb:value property="destination" data="vehicle
destination" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_weight"
class="se.sj.ipl.rollingstock.domain.types.Weight"
createOnElement="rollingstock/vehicle">
+ <jb:value property="weight" decoder="Double" data="vehicle
weight" default="0" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_dynamic_weight"
class="se.sj.ipl.rollingstock.domain.types.Weight"
createOnElement="rollingstock/vehicle">
+ <jb:value property="weight" decoder="Double" data="vehicle
dynamicWeight" default="0" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_dynamic_brake_weight"
class="se.sj.ipl.rollingstock.domain.types.Weight"
createOnElement="rollingstock/vehicle">
+ <jb:value property="weight" decoder="Double" data="vehicle
brakeWeight" default="0" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_length"
class="se.sj.ipl.rollingstock.domain.types.Length"
createOnElement="rollingstock/vehicle">
+ <jb:value property="length" decoder="Double" data="vehicle
length" default="0" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_speed"
class="se.sj.ipl.rollingstock.domain.types.Speed"
createOnElement="rollingstock/vehicle">
+ <jb:value property="speed" decoder="Double" data="vehicle
speed" default="0" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_comments" class="java.util.ArrayList"
createOnElement="rollingstock/vehicle">
+ <jb:wiring beanIdRef="vehicle_comment" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_comment"
class="se.sj.ipl.rollingstock.domain.Comment"
createOnElement="rollingstock/vehicle/comments/comment">
+ <jb:value property="comment" data="comments/comment" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_phonenumbers"
class="java.util.ArrayList"
createOnElement="rollingstock/vehicle">
+ <jb:wiring beanIdRef="vehicle_phonenumber" />
+ </jb:bean>
+
+ <jb:bean beanId="vehicle_phonenumber"
class="se.sj.ipl.rollingstock.domain.PhoneNumber"
createOnElement="rollingstock/vehicle/phoneNumber">
+ <jb:value property="function" data="phoneNumber/function" />
+ <jb:value property="location" data="phoneNumber/location"
/>
+ <jb:value property="number" data="phoneNumber/phoneNumber"
/>
+ </jb:bean>
+
+ <jb:bean beanId="passenger_car_configuration"
class="se.sj.ipl.rollingstock.domain.PassengerCarConfiguration"
createOnElement="rollingstock/vehicle">
+ <jb:value property="class1" decoder="Integer" data="vehicle
class1" default="0" />
+ <jb:value property="class2" decoder="Integer"
data="vehicle class2" default="0" />
+ <jb:value property="couchette" decoder="Integer"
data="vehicle couchette" default="0" />
+ <jb:value property="compartments" decoder="Integer"
data="vehicle compartments" default="0" />
+ </jb:bean>
+
+ <resource-config selector="decoder:Time">
+ <resource>org.milyn.javabean.decoders.SqlTimeDecoder</resource>
+ <param name="format">HH:mm:ss</param>
+ </resource-config>
+
+ <resource-config selector="decoder:Date">
+ <resource>org.milyn.javabean.decoders.SqlDateDecoder</resource>
+ <param name="format">yyyy-MM-dd</param>
+ </resource-config>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_bindings.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_bindings.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_bindings.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <!--
+ Virtual Model Binding Configurations for the order message elements...
+
+ Just capturing the order and order-item element details into 2
+ Maps, overwriting each as we iterate through the message i.e. not
+ accumulating them in memory => low memory footprint because we only
+ have details of the current order + current order-item in memory
+ at any given time (i.e. we never even have a full order in memory)...
+
+ The Database Schema (need to capture enough from the message to populate this):
+ ORDERS (ORDERNUMBER INTEGER, USERNAME VARCHAR(50), STATUS INTEGER, NET DOUBLE,
TOTAL DOUBLE, ORDDATE DATE)
+ ORDERITEMS (ORDERNUMBER INTEGER, QUANTITY INTEGER, PRODUCT INTEGER, TITLE
VARCHAR(50), PRICE DOUBLE)
+ -->
+
+ <jb:bean beanId="message" class="java.util.HashMap"
createOnElement="message-header">
+ <jb:value property="date" data="message-header/date"
decoder="Date">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z
yyyy</jb:decodeParam>
+ </jb:value>
+ </jb:bean>
+
+ <jb:bean beanId="order" class="java.util.HashMap"
createOnElement="order">
+ <jb:value property="orderNum" data="order/order-id"
decoder="Integer" />
+ <jb:value property="customerUname"
data="order/customer-details/username" />
+ <jb:value property="status"
data="order/status-code" decoder="Integer" />
+ <jb:value property="net" data="order/net-amount"
decoder="BigDecimal" />
+ <jb:value property="total"
data="order/total-amount" decoder="BigDecimal" />
+ </jb:bean>
+
+ <jb:bean beanId="orderItem" class="java.util.HashMap"
createOnElement="order-item">
+ <!-- Just bind in all elements of the orderItem into the orderItem map.
Property name is
+ taken from the element name... -->
+ <jb:value data="order-item/*" />
+ </jb:bean>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_bindings.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_datasources.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_datasources.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_datasources.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:ds="http://www.milyn.org/xsd/smooks/datasource-1.1.xsd">
+
+ <ds:direct
+ bindOnElement="#document"
+ datasource="DBExtractTransformLoadDS"
+ driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:9201/milyn-hsql-9201"
+ username="sa"
+ password=""
+ autoCommit="false" />
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_datasources.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_edi-orders-parser.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_edi-orders-parser.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_edi-orders-parser.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.1.xsd">
+
+ <!--
+ Configure the EDI Reader to parse the message stream into a stream of SAX events.
+ -->
+ <edi:reader mappingModel="/edi-to-sax-order-mapping.xml" />
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_edi-orders-parser.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:db="http://www.milyn.org/xsd/smooks/db-routing-1.1.xsd">
+
+ <!--
+ Filter the message using the SAX Filter (i.e. not DOM, so no
+ intermediate DOM, so we can process huge messages...
+ -->
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ </params>
+
+ <!--
+ Define the EDI stream parser for the orders message...
+ -->
+ <import file="edi-orders-parser.xml" />
+
+ <!--
+ Define the Database Datasource(s)...
+ -->
+ <import file="datasources.xml"/>
+
+ <!--
+ Define the Data Bindings. This is to bind the order and orderItem data into the
ExecutionContext so it
+ can be used by the SQLExecutor for performing the inserts...
+ -->
+ <import file="bindings.xml"/>
+
+ <!--
==================================================================================
+ Now define the DB Executor resource that will use the data bound from the EDI
message
+ into the virtual data model defined in bindings.xml...
+ ===================================================================================
-->
+
+ <!-- Assert whether it's an insert or update. Need to do this just before we
do the
+ insert/update, which is triggered to happen just after the customer-details are
processed... -->
+ <db:executor executeOnElement="customer-details"
datasource="DBExtractTransformLoadDS" executeBefore="true">
+ <db:statement>select ORDERNUMBER from ORDERS where ORDERNUMBER =
${order.orderNum}</db:statement>
+ <db:resultSet name="orderExistsRS"/>
+ </db:executor>
+
+ <!-- If it's an insert (orderExistsRS.isEmpty()), insert the order at the end
of the customer-details i.e. just before we process the order items... -->
+ <db:executor executeOnElement="customer-details"
datasource="DBExtractTransformLoadDS" executeBefore="false">
+ <condition>orderExistsRS.isEmpty()</condition>
+ <db:statement>INSERT INTO ORDERS VALUES(${order.orderNum},
${order.customerUname}, ${order.status}, ${order.net}, ${order.total},
${message.date})</db:statement>
+ </db:executor>
+
+ <!-- And insert each orderItem... -->
+ <db:executor executeOnElement="order-item"
datasource="DBExtractTransformLoadDS" executeBefore="false">
+ <condition>orderExistsRS.isEmpty()</condition>
+ <db:statement>INSERT INTO ORDERITEMS VALUES (${order.orderNum},
${orderItem.quantity}, ${orderItem.productId}, ${orderItem.title},
${orderItem.price})</db:statement>
+ </db:executor>
+
+ <!-- Ignoring updates for now!! -->
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-dao-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-dao-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-dao-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
+
xmlns:dao="http://www.milyn.org/xsd/smooks/persistence-1.2.xsd"...
+
+ <!--
+ This is the normal Javabean binding. Notice that we have a wiring on customer. The
+ Customer entity will not be created but looked up by a locator.
+ -->
+ <jb:bean beanId="order" class="example.entity.Order"
createOnElement="order">
+ <jb:value property="ordernumber" data="ordernumber"
decoder="Integer" />
+ <jb:value property="orderDate" data="date"
decoder="Date">
+ <jb:decodeParam name="format">yyyy-MM-dd
HH:mm:ss</jb:decodeParam>
+ </jb:value>
+
+ <jb:wiring property="customer" beanIdRef="customer"
/>
+ <jb:wiring setterMethod="addOrderLine"
beanIdRef="orderLine" />
+ </jb:bean>
+
+ <!--
+ The locator calls the CustomerDao#findById() method and expects a result. The result
+ will be added to the bean repository under the bean id "customer".
+ The locator know which method to call via the @Lookup annotation on the method. It
knows
+ how to map the parameters because each method parameter is annotated with the @Param
annotation.
+ -->
+ <dao:locator beanId="customer" dao="customer"
lookup="id" lookupOnElement="order" onNoResult="EXCEPTION"
>
+ <dao:params>
+ <dao:value name="id" data="customer"
decoder="Integer"/>
+ </dao:params>
+ </dao:locator>
+
+ <!--
+ This is the normal Javabean binding. Notice that we have a wiring on product. The
+ Product entity will not be created but looked up by a locator.
+ -->
+ <jb:bean beanId="orderLine" class="example.entity.OrderLine"
createOnElement="order-item">
+ <jb:value property="quantity" data="quantity"
decoder="Integer"/>
+ <jb:wiring property="order" beanIdRef="order"/>
+ <jb:wiring property="product" beanIdRef="product"/>
+ </jb:bean>
+
+ <!--
+ This locator calls the ProductDao#findById() method and expects a result. The result
+ will be added to the bean repository under the bean id "customer".
+ -->
+ <dao:locator beanId="product" dao="product"
lookup="id" lookupOnElement="order-item"
onNoResult="EXCEPTION">
+ <dao:params>
+ <dao:value name="id" data="product"
decoder="Integer"/>
+ </dao:params>
+ </dao:locator>
+
+ <!--
+ The inserter calls the OrderDao#insertOrder() method at the visitAfter of Order. The
inserter
+ knows which method it needs to call via the @Persist annotation on the method.
+ The insertOrder method is responsible for inserting the Order.
+ -->
+ <dao:inserter beanId="order" dao="order"
insertOnElement="order" />
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-dao-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-jpa-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-jpa-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-jpa-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
+
xmlns:dao="http://www.milyn.org/xsd/smooks/persistence-1.2.xsd"...
+
+ <!--
+ This is the normal Javabean binding. Notice that we have a wiring on customer. The
+ Customer entity will not be created but looked up by a locator.
+ -->
+ <jb:bean beanId="order" class="example.entity.Order"
createOnElement="order">
+ <jb:value property="ordernumber" data="ordernumber"
decoder="Integer" />
+ <jb:value property="orderDate" data="date"
decoder="Date">
+ <jb:decodeParam name="format">yyyy-MM-dd
HH:mm:ss</jb:decodeParam>
+ </jb:value>
+
+ <jb:wiring property="customer" beanIdRef="customer"
/>
+ <jb:wiring setterMethod="addOrderLine"
beanIdRef="orderLine" />
+ </jb:bean>
+
+ <!--
+ The locator calls the EntityManager#query() method and expects a result. The locator
wants
+ a unique result but the query() method returns a list. The locator will check that
there is only
+ one row and extract that row from the list. That entity is inserted into bean
repository under
+ the bean id customer.
+ -->
+ <dao:locator beanId="customer" lookupOnElement="order"
onNoResult="EXCEPTION" uniqueResult="true">
+ <dao:query>from Customer c where c.id = :id</dao:query>
+ <dao:params>
+ <dao:value name="id" data="customer"
decoder="Integer"/>
+ </dao:params>
+ </dao:locator>
+
+ <!--
+ This is the normal Javabean binding. Notice that we have a wiring on product. The
+ Product entity will not be created but looked up by a locator.
+ -->
+ <jb:bean beanId="orderLine" class="example.entity.OrderLine"
createOnElement="order-item">
+ <jb:value property="quantity" data="quantity"
decoder="Integer"/>
+ <jb:wiring property="order" beanIdRef="order"/>
+ <jb:wiring property="product" beanIdRef="product"/>
+ </jb:bean>
+
+ <!--
+ The locator calls the EntityManager#query() method and expects a result. The locator
wants
+ a unique result but the query() method returns a list. The locator will check that
there is only
+ one row and extract that row from the list. That entity is inserted into bean
repository under
+ the bean id product.
+ -->
+ <dao:locator beanId="product" lookupOnElement="order-item"
onNoResult="EXCEPTION" uniqueResult="true">
+ <dao:query>from Product p where p.id = :id</dao:query>
+ <dao:params>
+ <dao:value name="id" data="product"
decoder="Integer"/>
+ </dao:params>
+ </dao:locator>
+
+ <!--
+ The inserter calls the EntityManager#persist() method at the visitAfter of Order.
+ -->
+ <dao:inserter beanId="order" insertOnElement="order" />
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/smooks-configs_smooks-jpa-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/splitter-router_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/splitter-router_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/splitter-router_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:jms="http://www.milyn.org/xsd/smooks/jms-routing-1.2.xsd"
+
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
+
+ <!--
+ Filter the message using the SAX Filter (i.e. not DOM, so no
+ intermediate DOM, so we can process huge messages...
+ -->
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ </params>
+
+ <!-- Capture the message data 2 seperate DOM models, for "order" and
"order-item" fragments... -->
+ <resource-config selector="order,order-item">
+ <resource>org.milyn.delivery.DomModelCreator</resource>
+ </resource-config>
+
+ <!-- At each "order-iteam", apply a template to the "order"
and "order-item" DOM models... -->
+ <ftl:freemarker applyOnElement="order-item">
+ <!--
+ Note in the template that we need to use the special FreeMarker variable
".vars"
+ because of the hyphenated variable names ("order-item"). See
http://freemarker.org/docs/ref_specvar.html.
+ -->
+ <ftl:template>/orderitem-split.ftl</ftl:template>
+ <ftl:use>
+ <!-- Bind the templating result into the bean context, from where
+ it can be accessed by the JMSRouter (configured above). -->
+ <ftl:bindTo id="orderItem_xml"/>
+ </ftl:use>
+ </ftl:freemarker>
+
+ <!-- At each "order-iteam", route the "orderItem_xml" to the
ActiveMQ JMS Queue... -->
+ <jms:router routeOnElement="order-item" beanId="orderItem_xml"
destination="smooks.exampleQueue">
+ <jms:message>
+ <!-- Need to use special FreeMarker variable ".vars" -->
+
<jms:correlationIdPattern>${order.@id}-${.vars["order-item"].@id}</jms:correlationIdPattern>
+ </jms:message>
+ <jms:jndi properties="/activemq.sr.jndi.properties" />
+ <jms:highWaterMark mark="3"/>
+ </jms:router>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/splitter-router_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/validation-basic_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/validation-basic_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/validation-basic_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:rules="http://www.milyn.org/xsd/smooks/rules-1.0.xsd"
+
xmlns:validation="http://www.milyn.org/xsd/smooks/validation-1.0.xsd...
+
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <params>
+ <!-- Generate a ValidationException if we get more than 5 validation
failures... -->
+ <param name="validation.maxFails">5</param>
+ </params>
+
+ <!-- Define the ruleBases that are used by the validation rules... -->
+ <rules:ruleBases>
+ <!-- Field value rules using regex... -->
+ <rules:ruleBase name="customer"
src="rules/customer.properties"
provider="org.milyn.rules.regex.RegexProvider"/>
+ <rules:ruleBase name="product"
src="rules/product.properties"
provider="org.milyn.rules.regex.RegexProvider"/>
+
+ <!-- Order business rules using MVEL expressions... -->
+ <rules:ruleBase name="order" src="rules/order-rules.csv"
provider="org.milyn.rules.mvel.MVELProvider"/>
+ </rules:ruleBases>
+
+ <!-- Capture some order-item data into the bean context - required by the business
rule validations... -->
+ <jb:bean beanId="orderDetails" class="java.util.HashMap"
createOnElement="header">
+ <jb:value data="header/*"/>
+ </jb:bean>
+ <jb:bean beanId="orderItem" class="java.util.HashMap"
createOnElement="order-item">
+ <jb:value data="order-item/*"/>
+ </jb:bean>
+
+ <!-- Target validation rules... -->
+ <validation:rule executeOn="header/username"
name="customer.customerId" onFail="ERROR"/>
+ <validation:rule executeOn="email" name="customer.email"
onFail="WARN"/>
+ <validation:rule executeOn="order-item/productId"
name="product.productId" onFail="ERROR"/>
+
+ <validation:rule executeOn="order-item"
name="order.order_item_total" onFail="ERROR"/>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/validation-basic_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java-virtual_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java-virtual_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java-virtual_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <!--
+ The "xml-to-java-virtual" sample config is the same as that of the
"xml-to-java" sample accept for the fact that
+ xml-to-java-virtual uses HashMaps (virtual) in place of a fully defined
(physical) object model.
+ -->
+
+ <!--
+ Create an "java.util.HashMap" bean instance when we visit the start of the
<order> element.
+ Assign the new bean instance to the beanId of "order".
+ Wire in the "header" and "orderItems" beans.
+ -->
+ <jb:bean beanId="order" class="java.util.HashMap"
createOnElement="order">
+ <jb:wiring property="header" beanIdRef="header" />
+ <jb:wiring property="orderItems" beanIdRef="orderItems"
/>
+ </jb:bean>
+
+ <!--
+ Create an ArrayList bean instance when we visit the start of the <order>
element.
+ This bean is wired into the "order" bean.
+ -->
+ <jb:bean beanId="orderItems" class="java.util.ArrayList"
createOnElement="order">
+ <jb:wiring beanIdRef="orderItem" />
+ </jb:bean>
+
+ <!--
+ Create an "java.util.HashMap" bean instance when we visit the start of the
<header> element.
+ This bean is wired into the "order" bean.
+ -->
+ <jb:bean beanId="header" class="java.util.HashMap"
createOnElement="header">
+ <jb:value property="date" decoder="Date"
data="header/date">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z
yyyy</jb:decodeParam>
+ <jb:decodeParam
name="locale-language">en</jb:decodeParam>
+ <jb:decodeParam
name="locale-country">IE</jb:decodeParam>
+ </jb:value>
+ <jb:value property="customerNumber" decoder="Long"
data="header/customer/@number" />
+ <jb:value property="customerName" data="header/customer"
/>
+ </jb:bean>
+
+ <!--
+ Create an "java.util.HashMap" bean instance when we visit the start of the
<order-item> element.
+ This bean is wired into the "orderItems" ArrayList bean.
+ -->
+ <jb:bean beanId="orderItem" class="java.util.HashMap"
createOnElement="order-item">
+ <jb:value property="productId" decoder="Long"
data="order-item/product" />
+ <jb:value property="quantity" decoder="Integer"
data="order-item/quantity" />
+ <jb:value property="price" decoder="Double"
data="order-item/price" />
+ </jb:bean>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java-virtual_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <!--
+ Create an "example.beans.Order" bean instance when we visit the start of
the <order> element.
+ Assign the new bean instance to the beanId of "order".
+ Wire in the "header" and "orderItems" beans.
+ -->
+ <jb:bean beanId="order" class="example.model.Order"
createOnElement="order">
+ <jb:wiring property="header" beanIdRef="header" />
+ <jb:wiring property="orderItems" beanIdRef="orderItems"
/>
+ </jb:bean>
+
+ <!--
+ Create an ArrayList bean instance when we visit the start of the <order>
element.
+ This bean is wired into the "order" bean.
+ -->
+ <jb:bean beanId="orderItems" class="java.util.ArrayList"
createOnElement="order">
+ <jb:wiring beanIdRef="orderItem" />
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.Header" bean instance when we visit the start of
the <header> element.
+ This bean is wired into the "order" bean.
+ -->
+ <jb:bean beanId="header" class="example.model.Header"
createOnElement="header">
+ <jb:value property="date" decoder="Date"
data="header/date">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z
yyyy</jb:decodeParam>
+ <jb:decodeParam
name="locale-language">en</jb:decodeParam>
+ <jb:decodeParam
name="locale-country">IE</jb:decodeParam>
+ </jb:value>
+ <jb:value property="customerNumber" decoder="Long"
data="header/customer/@number" />
+ <jb:value property="customerName" data="header/customer"
/>
+ </jb:bean>
+
+ <!--
+ Create an "example.beans.OrderItem" bean instance when we visit the start
of the <order-item> element.
+ This bean is wired into the "orderItems" ArrayList bean.
+ -->
+ <jb:bean beanId="orderItem" class="example.model.OrderItem"
createOnElement="order-item">
+ <jb:value property="productId" decoder="Long"
data="order-item/product" />
+ <jb:value property="quantity" decoder="Integer"
data="order-item/quantity" />
+ <jb:value property="price" decoder="Double"
data="order-item/price" />
+ </jb:bean>
+
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xml-to-java_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-basic_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-basic_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-basic_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:xsl="http://www.milyn.org/xsd/smooks/xsl-1.1.xsd">
+
+ <xsl:xsl applyOnElement="c/b">
+ <xsl:template>/example/BasicXslTransform.xsl</xsl:template>
+ </xsl:xsl>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-basic_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-groovy_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-groovy_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-groovy_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:xsl="http://www.milyn.org/xsd/smooks/xsl-1.1.xsd">
+
+ <!--
+ Break out the <date> field into separate "time", "day",
"month" and "year" fields using Groovy.
+ This makes the complex date field value consumable by something like XSLT.
+ -->
+ <resource-config selector="header date">
+ <resource>/example/DateFormatter.groovy</resource>
+ <param name="input-format">EEE MMM dd HH:mm:ss z
yyyy</param>
+ <param name="output-format">
+ time=HH:mm
+ day=dd
+ month=MM
+ year=yy
+ </param>
+ </resource-config>
+
+ <!--
+ Transform the document (as a whole) using XSLT. The complex date field has already
been preprocessed into
+ separate fields using Groovy (see above config) - XSLT can handle it easily now :-)
+ -->
+ <xsl:xsl applyOnElement="#document">
+ <xsl:template>/example/order.xsl</xsl:template>
+ </xsl:xsl>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-groovy_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-namespaces_smooks-config.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-namespaces_smooks-config.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-namespaces_smooks-config.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+
xmlns:xsl="http://www.milyn.org/xsd/smooks/xsl-1.1.xsd">
+
+ <xsl:xsl applyOnElement="$document">
+ <xsl:template>
+ <![CDATA[
+ <xsl:stylesheet
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="smk xhtml"
+
xmlns:smk="http://milyn.codehaus.org/Smooks">
+
+ <xsl:output method="xml" encoding="UTF-8"/>
+
+ <xsl:template match="/">
+ <CanonicalOrderFormat
xmlns="http://canonical.codehaus.org/Order">
+ <orderId>
+ <xsl:value-of
select="./smk:Order/smk:header/smk:order-id"/>
+ </orderId>
+ <item>
+ <productId>
+ <xsl:value-of
select="./smk:Order/smk:order-item/smk:product-id"/>
+ </productId>
+ <title>
+ <xsl:value-of
select="./smk:Order/smk:order-item/smk:title"/>
+ </title>
+ <price>
+ <xsl:value-of
select="./smk:Order/smk:order-item/smk:price"/>
+ </price>
+ </item>
+ </CanonicalOrderFormat>
+ </xsl:template>
+ </xsl:stylesheet>
+ ]]>
+ </xsl:template>
+ </xsl:xsl>
+
+</smooks-resource-list>
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/xslt-namespaces_smooks-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/AbstractSmooksEditorTestcase.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/AbstractSmooksEditorTestcase.java
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/AbstractSmooksEditorTestcase.java 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.test.openeditor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.smooks.test.util.TestUtil;
+
+/**
+ * @author Dart
+ *
+ */
+public class AbstractSmooksEditorTestcase extends TestCase {
+
+ protected static final IWorkspace WorkSpace = ResourcesPlugin.getWorkspace();
+ protected static final IWorkbench WorkBench = PlatformUI.getWorkbench();
+
+ protected List<IEditorPart> editorList = new ArrayList<IEditorPart>();
+
+ protected IProject testProject = null;
+
+ private void setUpEnvironment() throws CoreException {
+ if (getTestProjectName() != null) {
+ TestProjectProvider provider = new TestProjectProvider(TestUtil.TEST_BUNDLE_NAME,
"/projects/"
+ + getTestProjectName(), getTestProjectName(), true);
+ testProject = provider.getProject();
+ }
+ }
+
+ protected String getTestProjectName() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setUpEnvironment();
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see junit.framework.TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ if (this.testProject != null) {
+ testProject.delete(true, null);
+ }
+ super.tearDown();
+ }
+
+}
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/AbstractSmooksEditorTestcase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.test.openeditor;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
+
+/**
+ * @author Dart
+ *
+ */
+public class OpenAllSmooksConfigFileTestCase extends AbstractSmooksEditorTestcase {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.test.openeditor.AbstractSmooksEditorTestcase#setUp
+ * ()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ for (Iterator<?> iterator = editorList.iterator(); iterator.hasNext();) {
+ IEditorPart editor = (IEditorPart) iterator.next();
+ editor.dispose();
+ }
+ editorList.clear();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.test.openeditor.AbstractSmooksEditorTestcase#tearDown
+ * ()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ for (Iterator<?> iterator = editorList.iterator(); iterator.hasNext();) {
+ IEditorPart editor = (IEditorPart) iterator.next();
+ editor.dispose();
+ }
+ editorList.clear();
+ super.tearDown();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.test.openeditor.AbstractSmooksEditorTestcase#
+ * getTestProjectName()
+ */
+ @Override
+ protected String getTestProjectName() {
+ return "smooks-all-config-files";
+ }
+
+ public void testOpenAllFiles() throws URISyntaxException, PartInitException, IOException
{
+ if (this.testProject != null) {
+ IFolder folder = testProject.getFolder("smooks-config-files");
+ if (folder.exists()) {
+ File file = folder.getLocation().toFile();
+ File[] files = file.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ File childFile = files[i];
+ IFile cf = folder.getFile(childFile.getName());
+ if (SmooksUIUtils.isSmooksFile(cf)) {
+ IWorkbenchWindow window = WorkBench.getActiveWorkbenchWindow();
+ IEditorPart part = IDE.openEditor(window.getActivePage(), cf);
+ Assert.assertNotNull(part);
+ Assert.assertTrue(
+ "Editor isn't Smooks editor , there are some errors occur when create
Smooks Editor",
+ (part instanceof AbstractSmooksFormEditor));
+ System.out.println("successful to open file : '" + cf.getName() +
"'");
+ }
+ }
+ }
+ }
+ }
+}
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/testfiles/java-to-java.xml
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/testfiles/java-to-java.xml
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/testfiles/java-to-java.xml 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:graph="http://www.jboss.org/jbosstools/smooks/smooks-graphics-...
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+ <params>
+ <param name="stream.filter.type">SAX</param>
+ </params>
+ <jb:bean beanId="lineOrder" class="example.trgmodel.LineOrder"
createOnElement="example.srcmodel.Order">
+ <jb:value data="header/customerNumber"
property="customerId"/>
+ <jb:value data="header/customerName"
property="customerName"/>
+ <jb:value data="header/priority" decoder="Enum"
property="priority">
+ <jb:decodeParam name="enumType">example.trgmodel.LineOrderPriority
+ </jb:decodeParam>
+ <jb:decodeParam name="LOW">NOT_IMPORTANT</jb:decodeParam>
+ <jb:decodeParam name="MEDIUM">IMPORTANT</jb:decodeParam>
+ <jb:decodeParam name="HIGH">VERY_IMPORTANT</jb:decodeParam>
+ </jb:value>
+ <jb:wiring beanIdRef="lineItems" property="lineItems"/>
+ </jb:bean>
+ <jb:bean beanId="lineItems" class="example.trgmodel.LineItem[]"
createOnElement="orderItems">
+ <jb:wiring beanIdRef="lineItem"/>
+ </jb:bean>
+ <jb:bean beanId="lineItem" class="example.trgmodel.LineItem"
createOnElement="example.srcmodel.OrderItem">
+ <jb:value data="example.srcmodel.OrderItem/productId"
property="productCode"/>
+ <jb:value data="example.srcmodel.OrderItem/quantity"
decoder="Integer" property="unitQuantity"/>
+ <jb:value data="example.srcmodel.OrderItem/price"
decoder="BigDecimal" property="unitPrice"/>
+ </jb:bean>
+ <graph:smooks-graphics-ext platformVersion="1.2">
+ <graph:graph/>
+ <graph:processes>
+ <graph:process>
+ <graph:task id="input" name="Input Task">
+ <graph:task id="java_mapping" name="Java Mapping"/>
+ </graph:task>
+ </graph:process>
+ </graph:processes>
+ </graph:smooks-graphics-ext>
+</smooks-resource-list>
\ No newline at end of file
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/testfiles/java-to-java.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/util/TestUtil.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/util/TestUtil.java
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/util/TestUtil.java 2009-10-28
08:39:20 UTC (rev 18333)
@@ -0,0 +1,13 @@
+package org.jboss.tools.smooks.test.util;
+
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+
+public class TestUtil {
+
+ public static final String TEST_BUNDLE_NAME =
"org.jboss.tools.smooks.core.test";
+
+ public static Bundle getSmooksCoreTestBundle() {
+ return Platform.getBundle("org.jboss.tools.smooks.core.test");
+ }
+}
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/util/TestUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain