Author: DartPeng
Date: 2008-12-02 03:50:47 -0500 (Tue, 02 Dec 2008)
New Revision: 12203
Added:
trunk/smooks/docs/.project
trunk/smooks/docs/reference/en/images/common/
trunk/smooks/docs/reference/en/images/common/data_type_selection.png
trunk/smooks/docs/reference/en/images/common/data_type_wizard.png
trunk/smooks/docs/reference/en/images/common/form_editor.png
trunk/smooks/docs/reference/en/images/common/input_file_name.png
trunk/smooks/docs/reference/en/images/common/new_wizard.png
trunk/smooks/docs/reference/en/images/common/smooks-usecase.png
trunk/smooks/docs/reference/en/images/java2java/
trunk/smooks/docs/reference/en/images/java2java/connect_rootnode.png
trunk/smooks/docs/reference/en/images/java2java/connection_error1.png
trunk/smooks/docs/reference/en/images/java2java/connection_error2.png
trunk/smooks/docs/reference/en/images/java2java/correct_editor.png
trunk/smooks/docs/reference/en/images/java2java/java_connection1.png
trunk/smooks/docs/reference/en/images/java2java/java_data_display.png
trunk/smooks/docs/reference/en/images/java2java/java_data_selection_wizard.png
trunk/smooks/docs/reference/en/modules/introduction.xml
Modified:
trunk/smooks/docs/reference/en/master.xml
trunk/smooks/docs/reference/en/modules/quick_start.xml
Log:
JBIDE-3296
add new docbook modules
Added: trunk/smooks/docs/.project
===================================================================
--- trunk/smooks/docs/.project (rev 0)
+++ trunk/smooks/docs/.project 2008-12-02 08:50:47 UTC (rev 12203)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>docs_smooks</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Property changes on: trunk/smooks/docs/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/docs/reference/en/images/common/data_type_selection.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/common/data_type_selection.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/common/data_type_wizard.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/common/data_type_wizard.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/common/form_editor.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/common/form_editor.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/common/input_file_name.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/common/input_file_name.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/common/new_wizard.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/common/new_wizard.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/common/smooks-usecase.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/common/smooks-usecase.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/java2java/connect_rootnode.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/java2java/connect_rootnode.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/java2java/connection_error1.png
===================================================================
(Binary files differ)
Property changes on:
trunk/smooks/docs/reference/en/images/java2java/connection_error1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/java2java/connection_error2.png
===================================================================
(Binary files differ)
Property changes on:
trunk/smooks/docs/reference/en/images/java2java/connection_error2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/java2java/correct_editor.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/java2java/correct_editor.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/java2java/java_connection1.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/java2java/java_connection1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/java2java/java_data_display.png
===================================================================
(Binary files differ)
Property changes on:
trunk/smooks/docs/reference/en/images/java2java/java_data_display.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/images/java2java/java_data_selection_wizard.png
===================================================================
(Binary files differ)
Property changes on:
trunk/smooks/docs/reference/en/images/java2java/java_data_selection_wizard.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/smooks/docs/reference/en/master.xml
===================================================================
--- trunk/smooks/docs/reference/en/master.xml 2008-12-02 03:15:40 UTC (rev 12202)
+++ trunk/smooks/docs/reference/en/master.xml 2008-12-02 08:50:47 UTC (rev 12203)
@@ -3,62 +3,39 @@
"http://www.docbook.org/xml/4.3/docbookx.dtd"
[
-<!--ENTITY intro SYSTEM "modules/intro.xml">
-<!ENTITY creating_new_seam SYSTEM "modules/creating_new_seam.xml">
-<!ENTITY directory_structure SYSTEM "modules/directory_structure.xml">
-<!ENTITY menus_and_actions SYSTEM "modules/seam_menus_and_actions.xml">
-<!ENTITY seam_wizards SYSTEM "modules/seam_wizards.xml">
-<!ENTITY generate_entities SYSTEM "modules/generate_entities.xml">
-<!ENTITY seam_editors SYSTEM "modules/seam_editors.xml">
-<!ENTITY seam_view SYSTEM "modules/seam_view.xml">
- <!ENTITY seam_preferences SYSTEM "modules/seam_preferences.xml">
-<!ENTITY crud_database_application SYSTEM
"modules/crud_database_application.xml">
-<!ENTITY crud_application_walkthrough SYSTEM
"modules/crud_application_walkthrough.xml">
-<!ENTITY business_application SYSTEM "modules/business_application.xml">
-<!ENTITY testng SYSTEM "modules/testng.xml"-->
+<!ENTITY introduction SYSTEM "modules/introduction.xml">
+<!ENTITY quickstart SYSTEM "modules/quick_start.xml">
+]>
+<book>
-<!ENTITY seamlink "../../seam/html_single/index.html">
-<!ENTITY aslink "../../as/html_single/index.html">
-<!ENTITY esblink "../../esb_ref_guide/html_single/index.html">
-<!ENTITY gsglink "../../GettingStartedGuide/html_single/index.html">
-<!ENTITY hibernatelink "../../hibernatetools/html_single/index.html">
-<!ENTITY jbpmlink "../../jbpm/html_single/index.html">
-<!ENTITY jsflink "../../jsf/html_single/index.html">
-<!ENTITY jsfreflink "../../jsf_tools_ref_guide/html_single/index.html">
-<!ENTITY jsftutoriallink
"../../jsf_tools_tutorial/html_single/index.html">
-<!ENTITY strutsreflink
"../../struts_tools_ref_guide/html_single/index.html">
-<!ENTITY strutstutoriallink
"../../struts_tools_tutorial/html_single/index.html">
+ <bookinfo>
+ <title>Smooks Dev Tools Reference Guide</title>
+ <author>
+ <firstname>Xue(Dart)</firstname>
+ <surname>Peng</surname>
+ </author>
-]>
-<book>
-
- <bookinfo>
-
- <title>Smooks Dev Tools Reference Guide</title>
-
<author><firstname>Dart</firstname><surname>Peng</surname></author>
-
- <pubdate>November 2008</pubdate>
- <copyright>
- <year>2008</year>
- <holder>JBoss, a division of Red Hat Inc.</holder>
- </copyright>
- <releaseinfo>
- Version: 3.0.0.CR1
+ <pubdate>November 2008</pubdate>
+ <copyright>
+ <year>2008</year>
+ <holder>JBoss, a division of Red Hat Inc.</holder>
+ </copyright>
+ <releaseinfo>
+ Version: 3.0.0.CR1
</releaseinfo>
-
-<abstract>
- <title/>
- <para>
- <ulink
url="http://download.jboss.org/jbosstools/nightly-docs/en/smooks/pdf...
version</ulink>
- </para>
-</abstract>
+ <abstract>
+ <title />
+ <para>
+ <ulink
+
url="http://download.jboss.org/jbosstools/nightly-docs/en/smooks/pdf...
version</ulink>
+ </para>
+ </abstract>
- </bookinfo>
- <toc/>
-<!--&testng;-->
-
-
+ </bookinfo>
+ <toc />
+ &introduction;
+ &quickstart;
</book>
Added: trunk/smooks/docs/reference/en/modules/introduction.xml
===================================================================
--- trunk/smooks/docs/reference/en/modules/introduction.xml (rev
0)
+++ trunk/smooks/docs/reference/en/modules/introduction.xml 2008-12-02 08:50:47 UTC (rev
12203)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="introduction">
+ <?dbhtml filename="introduction.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Smooks</keyword>
+ <keyword>JBDS</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Introduction</title>
+ <sect1>
+ <title>What is Smooks?</title>
+ <para>Smooks is a Java Framework/Engine for processing XML and
+ non XML data (CSV, EDI, Java, JSON etc).</para>
+ <para></para>
+ <para>In this guide we provide you with the information on ESB
+ Editor which allows you to
+ develop ESB file much faster and with far
+ fewer errors so sparing your time.
+ </para>
+ </sect1>
+ <sect1>
+ <title>What is Smooks dev tools?</title>
+ <para>Smooks dev tools is a set of graphical tools for editing
+ Smooks configuration file base on Eclipse</para>
+ </sect1>
+</chapter>
Property changes on: trunk/smooks/docs/reference/en/modules/introduction.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/docs/reference/en/modules/quick_start.xml
===================================================================
--- trunk/smooks/docs/reference/en/modules/quick_start.xml 2008-12-02 03:15:40 UTC (rev
12202)
+++ trunk/smooks/docs/reference/en/modules/quick_start.xml 2008-12-02 08:50:47 UTC (rev
12203)
@@ -1,16 +1,349 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="intro" xreflabel="intro">
- <?dbhtml filename="intro.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>JBoss Tools</keyword>
- <keyword>Seam</keyword>
- <keyword>JBDS</keyword>
- </keywordset>
- </chapterinfo>
+<chapter id="quickstart" xreflabel="Quick Start">
+ <?dbhtml filename="quick_start.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Smooks</keyword>
+ <keyword>JBDS</keyword>
+ <keyword>java</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Quick Start</title>
+ <sect1>
+ <title>Java-to-Java Quick Start</title>
+ <sect2>
+ <title>Smooks configuration file wizard</title>
+ <para>First , select the Java project what you created first to
+ create Smooks configuration file and right-click , select : “New” ->
+ “Other...” , find the “Smooks Configuration File” wizard. Click
+ “Next” button.
+ </para>
+ <figure>
+ <title>To select Smooks Configuration File wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/common/new_wizard.png" scale="90"
/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>First wizard page is file path creation page. Select the
+ “src” to be the file's container , and type
+ “smooks-newconfig.smooks”
+ to be the file's name. Click “Next”.</para>
+ <figure>
+ <title>Choose the configuration file container and type the
+ file's name</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/common/input_file_name.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The second wizard page is the transform data type choose
+ page.</para>
+ <figure>
+ <title>Select Data Type</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/common/data_type_selection.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </sect2>
+ <sect2>
+ <title>Smooks form editor</title>
+ <para>When the wizard finish to create a new Smooks configuration
+ file , the Smooks editor will be opened automatically. We will see a
+ “Form Editor”.
+ </para>
+ <figure>
+ <title>Smooks form editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/common/form_editor.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
- <title>Quick Start</title>
+ <para>
+ This editor contains several parts:
+ <orderedlist numeration="loweralpha" inheritnum="inherit">
+ <listitem>
+ Notify message display
+ area. If there are any errors ,
+ this
+ area will
+ display them.(You will
+ see a empty area , because now
+ there
+ aren't
+ any errors)
+ </listitem>
+ <listitem>
+ Source data
+ tree. The tree will display the
+ structured of
+ transform source
+ data.
+ </listitem>
- <section>
- </section>
+ <listitem>
+ Target data tree. The tree
+ will display the structured of
+ transform
+ source
+ target.
+ </listitem>
+
+ <listitem>
+ Mapping
+ graphical area. Show the data
+ mapping lines.
+ </listitem>
+
+ <listitem>
+ Source/Target data
+ selection links. Click the
+ link ,
+ there
+ will
+ open a data
+ selection
+ wizard to help user to choose
+ the
+ source/target
+ data.
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect2>
+ <sect2>
+ <title>Choose the source/target data
+ </title>
+ <para>Click the data selection links to choose the transform
+ data. You will see a wizard , and there are two items on it :
+ XML,Java.
+ </para>
+ <figure>
+ <title>Data type wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/common/data_type_wizard.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Select the “JavaBean Data Type” and click “Next” , you
+ will see a java class selection page :
+ </para>
+ <figure>
+ <title>JavaBean data selection wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/java2java/java_data_selection_wizard.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>After you confirm the java class , click “Finish” , you
+ will find , the structured of the class was be display on the Source
+ data tree. Please do the same operation for the target data link.
+ </para>
+ <figure>
+ <title>Display structure of the transform data</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/java2java/java_data_display.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </sect2>
+ <sect2>
+ <title>Mapping</title>
+ <para>
+ As you see , the source/target data tree display the structure
+ of the
+ java class. How to mapping it?</para>
+ <para>
+ First , we should know what is
+ we
+ want to transform:
+ <orderedlist numeration="loweralpha" inheritnum="inherit">
+ <listitem>
+ Bind the “customerName” property of the
+ Order#header to
+ the
+ “customerName” property of LineOrder.
+ </listitem>
+ <listitem>
+ Bind the
+ “customerNumber” property of the Order#header to
+ the
+ “customerId”
+ property of LineOrder.
+ </listitem>
+ <listitem>
+ Bind the “price” property of the OrderItem
+ to
+ the
+ “unitPrice” property of
+ LineItem.
+ </listitem>
+ <listitem>
+ Bind the “productId”
+ property
+ of the OrderItem to the
+ “productCode”
+ property of LineItem.
+ </listitem>
+ <listitem>
+ Bind the
+ “quantity” property of the OrderItem to the
+ “unitQuantity”
+ property of
+ LineItem.
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Make sense ? OK, let's select the “customerName”
+ item of the
+ “header”
+ item on the source data tree and start to drag
+ it. When the
+ drag item
+ cross into the Mapping graphical area , we will
+ see a
+ connection
+ line. Drop the item onto the “customerName” of the
+ “LineOrder” on the
+ target data view.
+ Now there will open a dialog to
+ ask you that do you want to connect the
+ root node:
+ </para>
+ <figure>
+ <title>A dialog to ask user to connect the root nodes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/java2java/connect_rootnode.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>
+ Please click “Yes” to connect the root node , if you don't ,
+ this dialog
+ will open again when you connect other nodes. Please
+ remember that :
+ The root nodes of the source data and target data
+ MUST
+ be connected.
+ (Not only Java-to-Java , the same as XML-to-Java).
+
+ </para>
+ <para>
+ Now let's do the same operation with the “customerNumber” ,
+ that
+ is the
+ what we want to see :
+
+ </para>
+ <figure>
+ <title>Correctly mapping editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/java2java/java_connection1.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Next , we are going to try to bind the properties of the
+ “OrderItem” to the properties of the “LineItem”.
+ </para>
+ <para>Select the “price” and drag it onto the “unitPrice” of
+ the
+ other side tree viewer. The notify message display area will show
+ an
+ error :
+ </para>
+ <figure>
+ <title>Connection Error 1</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/java2java/connection_error1.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>How to deal with the error ?</para>
+ <para>Please click the “Fix it” link , you will see a menu and
+ there will show several resolves on the menu (Sorry , can't get the
+ captures when the menu opened ).
+ </para>
+ <para>
+ Select the first resolve : 'Connect the “OrderItem” to the
+ “LineItem” ' ,
+ then you will find that the “OrderItem” was connected
+ with the
+ “LineItem”.
+ </para>
+ <para>But the notify message area still show some other errors:
+ </para>
+ <figure>
+ <title>Connection Error 2</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/java2java/connection_error2.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>OK,Deal it with the fire error ---- Click “Fix it” link
+ and select the first resolve item. The “orderItems” was connected
+ with the “lineItems”.
+ </para>
+ <para>
+ Why there will occur error? We will find that , if we only
+ connect the
+ property node without to connect the parent node of the
+ property ,
+ the “connection error” will happen. We can say that the
+ connection of
+ the “price to unitPrice” is the “Binding Connection” ,
+ but there need
+ a “Instance Creation Connection” ---- the connection
+ of
+ the
+ “OrderItem to LineItem”.</para>
+ <para>
+ After that , connect the quantity to
+ the
+ unitQuantity ; connect
+ the
+ productId to the productCode:
+ </para>
+ <figure>
+ <title>Complete mapping</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/java2java/correct_editor.png"
+ scale="90" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Now , we should save the file.</para>
+ <para>OK,Let run the test class : example.Main (Please make
+ sure
+ that the Smooks engine load the correct configuration file)
+ </para>
+ <para>Success!
+ </para>
+ </sect2>
+ </sect1>
</chapter>