JBoss.orgCommunity Documentation
This chapter includes detailed reference information about Smooks Tools.
This chapter describes the following 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.
Using the popup menu in the Processing Task section you can select which types of technologies(templating or mapping ones) you will use for transofmation:
The descriptions of the popup menu options are in the following table.
Table 3.1. Process Tab. Processing Task section.
Option | Description | Default |
---|---|---|
Add Task | Select one of the following tasks according to the necessary type of Source and Result types of the files:
| |
Delete | Click this option if you want to delete some task from the section. Note:you can't delete input task because it's required. | |
Input Methods | Choose one of the following methods:
| System |
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:
CSV:
EDI:
JSON:
Custom:
All the input task configuration positions can be found in the table below:
Table 3.2. Selected Task Details Section. Options for Input Task.
Option | Description | Default |
---|---|---|
Input type | Select your type of input file.
If don't find your type in the list,you should use Custom type:
| XML |
Input configuration |
|
|
Input Data | You should select a data file using Add and Delete buttons | |
Input Model View | Using 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 allow you to perform drug/drop operations with the nodes of transform 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.
Selected Task Details section for this task is presented by the graf, that is similar to the one in the previous section.
This section describes Options tab of the Smooks Configuration File editor, gives short recommendations how this tab can be used during the project configuring.
In the Smooks Configuration section of Options Tab only one element is availible:Smooks Platform Version
This parameter is not rechangable, and is set according to the vesion of the Smooks libraries that are added to the project.
In Filter Settings section you can set the following global options responsible for Smooks filtering configuring:
This behavior can be turned off using this global configuration parameter and can be overriden on a per fragment basis by targetting a Visitor implementation at that fragment that takes ownership of the Result writer (in the case of SAX filtering), or simply modifies the DOM (in the case of DOM filtering). As an example of this, see the FreeMarkerTemplateProcessor.
Table 3.3. Options Tab. Filter Settings section.
Option | Description | Default |
---|---|---|
Stream Filter Type | Determines the type of processing model that will be used.
Please refer to
Filtering Process Selection section
of the official Smooks User Guide for more information about these models:
| DOM |
Default Serialization is On | Defines whether default serialization should be switched on. Default serialization being turned on leads to locating StreamResult/DOMResult to the Result objects provided to the Smooks.filterSource method and to serialization all the events to that Result. | true |
This section provides information about Smooks Source Editor Page.
You can use this editor to edit the Smooks Configuration file directly.
If the Smooks tools can't understand the configuration file or the configuration file is illegal (XML structure isn't right for Smooks Configuration file, etc.), the error is underlined.
Smooks configuration file validator will validate your Smooks configuration file. Just right-click on the file and then click on the Validate button. The validator can be enabled/disabled in Window -> Preferences -> Validation:
You can set up your Smooks validator to include, exclude groups to validate and specify rules for validation. Just click on the Settings button and use the options provided: