From jbosstools-commits at lists.jboss.org Mon Sep 14 08:49:56 2009 Content-Type: multipart/mixed; boundary="===============4734906127257716621==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r17544 - in trunk/smooks/docs/reference/en: images/quick_start and 1 other directories. Date: Mon, 14 Sep 2009 08:49:56 -0400 Message-ID: <200909141249.n8ECnuGA006311@svn01.web.mwc.hst.phx2.redhat.com> --===============4734906127257716621== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: chukhutsina Date: 2009-09-14 08:49:56 -0400 (Mon, 14 Sep 2009) New Revision: 17544 Added: trunk/smooks/docs/reference/en/images/quick_start/quick_start9a.png trunk/smooks/docs/reference/en/images/quick_start/quick_start9b.png trunk/smooks/docs/reference/en/images/quick_start/quick_start9c.png trunk/smooks/docs/reference/en/images/quick_start/sourcemodel_structured= .jpg trunk/smooks/docs/reference/en/images/quick_start/targetmodel_structured= .jpg Modified: trunk/smooks/docs/reference/en/images/introduction/introduction2.png trunk/smooks/docs/reference/en/images/quick_start/quick_start6.png trunk/smooks/docs/reference/en/images/quick_start/quick_start9.png trunk/smooks/docs/reference/en/images/quick_start/quick_start_6a.png trunk/smooks/docs/reference/en/modules/quick_start.xml Log:

https://jira.jboss.org/jira/browse/JBDS-821 -Updated Quick Start section= according to the new design and functionality of the Smooks-tools.

Modified: trunk/smooks/docs/reference/en/images/introduction/introduction2.= png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Modified: trunk/smooks/docs/reference/en/images/quick_start/quick_start6.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Modified: trunk/smooks/docs/reference/en/images/quick_start/quick_start9.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Added: trunk/smooks/docs/reference/en/images/quick_start/quick_start9a.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/smooks/docs/reference/en/images/quick_start/quic= k_start9a.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/smooks/docs/reference/en/images/quick_start/quick_start9b.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/smooks/docs/reference/en/images/quick_start/quic= k_start9b.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/smooks/docs/reference/en/images/quick_start/quick_start9c.png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/smooks/docs/reference/en/images/quick_start/quic= k_start9c.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/smooks/docs/reference/en/images/quick_start/quick_start_6a.= png =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Added: trunk/smooks/docs/reference/en/images/quick_start/sourcemodel_struct= ured.jpg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/smooks/docs/reference/en/images/quick_start/sour= cemodel_structured.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/smooks/docs/reference/en/images/quick_start/targetmodel_struct= ured.jpg =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: trunk/smooks/docs/reference/en/images/quick_start/targ= etmodel_structured.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/smooks/docs/reference/en/modules/quick_start.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/smooks/docs/reference/en/modules/quick_start.xml 2009-09-14 12:36= :19 UTC (rev 17543) +++ trunk/smooks/docs/reference/en/modules/quick_start.xml 2009-09-14 12:49= :56 UTC (rev 17544) @@ -16,7 +16,7 @@
Download Smooks Java-to-Java Example Visit smooks examples page to download the "java-to-java" example pr= oject. Tip: @@ -26,6 +26,57 @@ them into the eclipse Java project.
+
+ Mapping rules + At the begining of working with Smooks tools, + we need to understand the Java-to-Java mapping rules of this example. + The transform input Java class is example.sourcemod= el.Order , its structure looks like this : + +
+ Order class + + + + + +
+ Let's describe the structure of example.source= model.Order in short: + + Order class contains a Header clas= s and a List class. + The Header class has cu= stomerName,customerNumber,priorit= y as properties. + In Order class the objects of the OrderItem class are s= tored in the List. + OrderItem has price,prod= uctId,quantity as its properties. + + Let's look at the transform target Java class : LineOrder. + On the screen below you can see its structure: +
+ LineOrder class + + + + + +
+ + LineOrder class contains 3 propert= ies:customerId,customerName,priority and an array of lineItems. + The Header class has cus= tomerName,customerNumber,priority= as its properties. + OrderItem objects are stored in a List. + + Now it's the time to define the mapping rules to transform the inp= ut source java class to the target java class: + + Each instance of the Order class should be mapped with = an instance of the LineOrder class. + The value of customerName of the H= eader class should be assigned to the customerName pro= perty of a LineOrder instance. + The value of customerNumber of the= Header class should be assigned to the customerId pro= perty of a LineOrder instance. + The value of priority of the Heade= r class should be assigned to the priority property of= LineOrder instance. + For the orderitems List of the Ord= er instance, it's necessary to map a new lineItems array instance of LineOr= der , + and each OrderItem instance in the orderItems List should be transforme= d to a LineItem instance, + those instances will be put into the lineItems array. + The value of productId of the Orde= rItem instance should be assigned to the 'productCode' of LineItem.<= /listitem> + The value of price of OrderItem s= hould be assigned to the unitPrice of LineItem.= + = + +
+ =
Smooks Configuration File Wizard Select the Smooks Java-to-Java example project that you created an= d right-click, @@ -118,7 +169,14 @@ - + On the bottom of this editor there are 5 tabs, they are : + = + Overview, Reader, Message Filter, Graph, Source. +
+ Adding the input data + At first, we need to add the Order class as the input data. + To do this, click the Reader tab, swich to the Reader/Input editor pag= e + = -
+ = = -
- Choosing the transform data - To choose the transform data you should open Reader tab and click Add button in the Input Data section. @@ -235,10 +290,10 @@ = - Let's select the Order class from the example project as the sour= ce JavaBean class and the ListOrder class as the target JavaBean class.When= you selected the necessary java classes, click + Let's select the Order class from the example project as the sour= ce JavaBean class.After that click Finish - and you should see all added java classes displayed in the= Input Data Section - . + and you should see the just added java class, being displa= yed in the Input Data Section. +
Displaying the Structure of the Transformed Data @@ -247,8 +302,74 @@
+
+
+ Adding the target Bean + After adding the input data, let's switch to the Message Filter p= age: +
+ Displaying the Structure of the Transformed Data + + + + + +
+ Click the Add button, the Add Chil= d wizard page will be shown, let's select the Java Bin= ding v1.2 -> Bean v1.2 and click OK to add the Bean : + +
+ Add Child wizard + + + + + +
+ Then we can find on the Message Filter page the Bean v1= .2 item added, click on it ,a Bean v1.2 section should appear t= o the right of the page. + The section represents a GUI for editing Bean v1.2 properties: +
+ Bean v1.2 section + + + + + +
+ You should input + lineOrder as the Bean's id in the "Bean Id" field.Then you = should click Browse button + near the Class textfield and select LineOrder as = the Bean's class. + + + When you enter a value for the Class text field, + you can type 'Alt + /' and the content assist pop dialog will be show= n, + so it's will increase the efficiency. If 'Alt + /' doesn't work, + try to use the 'Ctrl + space'('Key Assist' of Eclipse). + + + Let's click the Add Binding link at the bott= om of this page, + it will show a dialog to ask the binding of what Bean properties you w= ill prefer to add. + Select all and click OK, you will see a list of Binding elements added= under the Bean item. + Then you should add an array of beans called lineItems<= /property> and a Bean LineItem.These two classes and Id values are: + Array Bean: + + BeanId : lineItems; + Class : example.trgmodel.LineItem[] + + LineItem Bean : + + BeanId : lineItem; + Class : example.trgmodel.LineItem + + + + In Smooks , to be an array of Beans , the class value should end with = '[]'. This means that this bean is an array type. + = + + + To finish this work, use the Add Binding lin= k to add all the bindings for the Bean. +
+ = + =
-
Mapping = @@ -296,7 +417,7 @@ = Make sense? - You should right click Resource List , select + You should open Design tab and click Add button. In opened Add Child Wi= zard,please, select Add Smooks Resource>Java Binding>Bindings. = First of all, you should bind --===============4734906127257716621==--