Create new JBoss Tools Documentation Jira issue

This will launch the Jboss Tools Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

Chapter 3. Reference

3.1. Process tab
3.1.1. Processing Task section
3.1.2. Selected Task Details Section
3.2. Options Tab
3.2.1. Smooks Configuration section
3.2.2. Filter Settings Filter section
3.3. Source Tab
3.3.1. XML Source Editor
3.3.2. Error underlining in Graphical Editor
3.3.3. Smooks Configuration File Validator
3.4. Properties View
3.4.1. Decode Configuration
3.4.2. Apply Template Wizard

This chapter includes detailed reference information about all tabs of the Smooks Configuration Editor.

The Process tab of the Smooks Configuration Editor helps to configure different types of transformations. By default smooks configuration file is opened in this editor.If you have another default settings for editor opening you should left click smooks configuration file and select:Open With->Smooks Configuration Editor.

The Process tab has two sections:

You can see them on the picture below.


The options of this section depends on the selected task in the Processing Task section. Because there are 3 types of tasks there are 3 different sets of its options in the Selected Task Details Section. They will be described one by one.

On the picture below you can find an example of Selected Task Details Section view if XML is selected as input type.


As you can see on the picture above Input Configuration section is empty for XML input file. But this section has special configuration options for CSV,EDI,JSON,Custom input files.

Here are the screens of these configuration options:

All the input task configuration positions can be found in the table below:

Table 3.2. Selected Task Details Section. Options for Input Task.

OptionDescriptionDefault
Input typeSelect your type of input file. If don't find your type in the list,you should use Custom type:
  • No Input

  • XML

  • Java

  • XSD/WSDL

  • CSV

  • EDI

  • JSON

  • Custom

XML
Input configuration
  • No Input - no info required

  • XML - no info required

  • Java - no info required

  • XSD/WSDL - no info required

  • CSV

    • Fields - Comma separated list of CSV record field names

    • Separator Character - Field separator character.

    • Quote Character - Quote character.

    • Record Name - Name of csv record element.

    • Root Name - Name of csv root element.

    • indent - Add indentation character data to the generated event stream. This simply makes the generated event stream easier to read in its serialized form. Useful for testing etc.

    • Skip Lines - Number of lines to skip before processing starts.

  • EDI

    • Target Profile - Defines the output transformation profile

    • Encoding - The character encoding.

    • Mapping Model - Defines the EDI Mapping Model configuration for processing the EDI message stream to a stream of SAX events that can be processed by Smooks.

    • Validate - This attribute turns on/off datatype validation in the EDI Parser. Validation is on by default. It makes sense to turn datatype validation off on the EDI Reader if the EDI data is being bound into a Java Object model.

  • JSON

    • Target Profile - Defines the output transformation profile

    • Array Element Name - The element name of an array element.

    • Encoding - encoding: The default encoding of any JSON message InputStream processed by this Reader.

    • Illegal Element Name Char Replacement - If illegal characters are encountered in a JSON element name then they are replaced with this value. By default this is not defined, so that the reader doesn't doesn't search for illegal characters.

    • Indent - Add indentation character data to the generated event stream. This simply makes the generated event stream easier to read in its serialized form. Useful for testing etc.

    • Key Prefix on Numeric - The prefix character to add if the JSON node name starts with a number. By default this is not defined, so that the reader doesn't search for element names that start with a number.

    • Key Whitespace Replacement - The replacement character for whitespaces in a JSON map key. By default this not defined, so that the reader doesn't search for whitespaces.

    • Null Value Replacement - The replacement string for JSON NULL values.

    • Root Name - The element name of the document root.

    • Key Maps - Defines a JSON element name mapping The "from" key will be replaced with the "to" key or the contents of the element.

  • Custom

    • Target Profile - Defines the output transformation profile

    • Class - Custom reader class.

    • Handlers - Set a handler on the reader instance e.g. an EntityResolver, ErrorHandler etc.

    • Features - Reader Features List

    • Parametres - Resource Parameters

  • CSV

    • not defined

    • ','

    • '"'

    • csv-record

    • csv-set

    • true

    • 0

  • EDI

    • not defined

    • UTF-8

    • not defined

    • true

  • JSON

    • not defined

    • element

    • UTF-8

    • not defined

    • false

    • not defined

    • not defined

    • ""(an empty string)

    • 'json'

    • not defined

  • Custom

    • no defaults

Input DataYou should select a data file using Add and Delete buttons 
Input Model ViewUsing this view you can see the structure of your input file.If the file has been changed, to see the changes click Refreshlink. 

Selected Task Details section for this task is presented by the graf, that lighten the process of java mapping.


This graphical editor allows you to perform drag&drop operation with the nodes of transformed data to map the source data to target data. When you save the changes in the graphical editor the correct Smooks configuration file content will be generated.

Using the popup menu in the Selected Task Details section you can manage the diagram elements on the canvas.

The descriptions of the popup menu options are in the following table.


This section describes Options tab of the Smooks Configuration File editor, gives short recommendations how this tab can be used during the project configuring.


This section provides information about Smooks Source Editor Page.

Properties View is available for some elements on the canvas of Java Mapping and Apply Template Tasks,like:

To add Properties View to the opened perspective the user can either open Window->Show View->Preferences in the toolbar or right click the element which properties he wants to inspect and select Properties in the popup menu.On the picture below you can see how this view looks like when some csv template is selected.


This view is fully syncronized with the canvas of Smooks Configuration Editor. This means that when you change selected element by click,the properties of a new element are immediatly displayed in it. Using Properties View you can edit all the properties of the selected item.


Smooks tools support decode parameter configuration through the Decode tab in Properties View activated by clicking the connection between input model and bean items.

On the picture below you can see an example of decode configurations for mapping some Input Model Item to Date format:


The descriptions of the Decode Configuration tab options are listed in the following table:


The Decoder Parameters section for EnumDecoder quite differs from other types of decoders. See the picture below:


The Decoder Parameters section for EnumDecoder in Properties View consists of 2 rows:

  • From Data Value - The lines in this row are editable. You can change them according to the names of enum types you used in input file.

  • To Enum Value - The lines in this row are not editable. Here a set of all constants declared in mapped Enum type is listed. The user is responsible for correspondence between the values in these two rows.

For more information about different decoder parametres read Smooks Technology Documentation.

The Apply Template Wizard helps you to add a new Apply Template Task to Smooks configuration file. You can call it from the popup menu when Java Mapping item in Processing Task section is selected by following Add Task > Apply Template (see Apply Template configuration picture).

The wizard consists of several pages:

  1. The first one includes only one option to adjust.The user should select in which of the two formats(XML or CSV) he prefers to create an output message:


  2. The second page is specific for each of the output message formats: