HTML Builder

HTML builder

HTML builder is editor for editing Velocity template on HTML adapter.

HTML Builder provides the following functions.
  1. Inserts variable reference to Velocity template by mouse operation.

  2. Inserts reference result data of process component to Velocity template by mouse operation.

  3. Support the input of Conditional Branch process or loop process defined by Velocity template language(VTL).

Start and end HTML Builder

Start HTML builder

Double-click the HTML adapter icon, HTML builder edition screen starts as tab screen.

End HTML builder

Click button "×" on HTML builder edition screen to end.

Screen structure of HTML builder




Numbering in the figure Name Description Remarks
(1) Input source Schema of input source, script variable, component variable are shown.
  • For information regarding how to edit a schema of input data, refer to "Edit Schema" in the Mapper section.
  • Unlike Mapper, it is not possible to save the schema you edited in the HTML builder when saving a project.
(2) Template area Describe Velocity template.
Syntax of reference of variable/input data and loop process/conditional branch process is changed to color and shown.
 
(3) Tool palette Tool related to "add input data" and "insert loop process" "Insert condition branch process" is shown.
It is possible to start each tool by dragging&dropping to template area.
 

Developing procedures

Here introduces HTML builder development manual by example which uses "HTML file generation process".
  1. Align HTML file generation process icon to campus.

  2. Double click icon to open HTML builder edition screen.
    Refer to "Start and end HTML Builder"

  3. In HTML builder edition screen, add variable reference to Velocity template.
    Refer to "Using variables"


  4. In HTML builder edition screen, add input data.
    Refer to "Add/delete input data"


  5. In case of adapter in which schema is not generated automatically, set schema.
    Refer to "Edit Schema"

  6. In HTML builder edition screen, add loop process which used input data to Velocity template.
    Refer to "Insert loop process using input data"


  7. In HTML builder edition screen, add condition branch process using variable or input data to Velocity template.
    For conditional branch process using variable: Refer to "Usage of variables"
    Conditional branch process using input data: Refer to " Insert conditional branch process using input data "

    After insertion of conditional branch processing


    After modification of conditional branch processing

  8. Finally, align HTML and finish.

Usage of input data

With the following notation, the reference of results data used in DataSpider can be passed to Velocity context.
Notation Description
$component.{ProcessingComponentName} Returns the object corresponding to the result data of Processing Component in [Processing Component Name].

Difference according to input data type

Depending on if the input data is of table model type of XML type, the object passed to Velocity context is different.Therefore, depending on the type of input data, descriptions of Loop and Conditional Branch differs.

XML type data

For XML type input data, JDOM is converted to document$component.JDOM document root element can be retrieved by writing in "$component.component name".
For JDOM, please refer to "jdom.org"(http://www.jdom.org/).

Table Model Type data

If the type of input data table model,can get Collection object related to row by writing in "$component.component name.rows"format.
Method Name Arguments Return type Description
rows None Collection Collection for object to access to each row.

Also, the following methods are implemented in the row object.
Method Name Arguments Return type Description
getColumnValue int Column Get the column object with the specified index.
getColumnCount None int Returns the number of columns in the row.
getColumnData None Column[] Returns an array of column objects included in row object.

Also, the following methods are implemented in the row object.
In addition, column object itself returns string equal to getStringValue.
Method Name Arguments Return type Description
getData None Object Return column input value unchanged.
getStringValue None String Value as String type
getIntegerValue None Integer Value as Integer type
getLongValue None Long Value as Long type
getShortValue None Short value as Short type
getFloatValue None Float Value as Float type
getDoubleValue None Double Value as Double type
getBigDecimalValue None BigDecimal value as BigDecimal type
getBooleanValue None Boolean value as Boolean type

Input data Add/Delete

HTML builder input data

In HTML builder, different from other writing process adapter or Mapper, base on Velocity template content to add/delete input data dynamically.

Add input data

Add input data.
  1. Execute one of the processes below and open the "Add input data" screen.
  2. Select data you add to [Input data] in the "Add input data" screen, and click the [Finish] button.



    By clicking [Next] button, you can also insert loop process which use the added data to insert Conditional branch or loop.

  3. "$component.{component name}" is written in the template area and input data will be added.
    Velocity templates in the template shown in the area "$component.Component Name", by writing and will be added to the original input data is the result of the tree component.
With the process above, input data is added and data flow of designer and input source tree are updated automatically.

Delete input data

From the template "$component.By deleting all description of "$component.component name"from template, input data will be deleted and data flow of designer and input source tree are updated automatically.

Insert loop using input data

Insert loop using input data.
  1. Execute one of the processes below and open the "Insert loop" screen.
  2. Select data for loop processing from [target data] in the "Insert loop" screen, and click [Next].



    This process is not required if you open the "Insert loop" screen by drag & drop the nord of data for the loop processing from the "Input data" tree.

  3. Select the type for loop processing in the "Input data" screen, and click [Finish].

Insert Conditional Branch using input data

Insert Conditional Branch using input data.
  1. Execute one of the processes below and open the "Insert conditional branch" screen.
  2. Select data for the conditional branch processing from [Target variable/data] in the "Insert conditional branch" screen, and click [Finish].

You can also add a conditional branch by drag & drop the nord of data for the conditional branch processing from the source "Input data" tree, and select [Insert conditional branch] in the menu.

Usage of variables

With the following notation, the reference of results data used in DataSpider can be passed to Velocity context.

Type Notation Description
Script Variable $script.<script variable name> Returns the string representation of the value dereferenced by the <script variable name>.
$start.<XML script input variable name> Return XML data of the script variable shown as <XML script input variable name>.
For more details, refer to "XML type data".
$component.<XML script input variable name>
Component variable $property.{component name}.{component variable name} Return string representation of component number indicated by <processing component name> and <component variable name>.

Environment variables cannot be used.
For variables, refer to "variable".

Component variable

Component variable are variables that can be gotten with each component.
They are used to alter the succeeding processing with the results of the adapter.
Values you can obtain vary depending on the component. For more details, refer to the Help page of each adapter.

In HTML builder edit screen, for Velocity template, it is possible to execute "Insert script variable"or"Insert condition branch process which targets script variable".

Insert Component Variable

Insert component variable.
  1. From right click menu of template area, select [Insert script variable].

  2. Select the variable to insert to [Component variable] in the "Insert component variable" screen, and click [Finish].

You can also insert a component variable by drag & drop the component variable you insert from the source "Component variable" tree to the template area, and select [Insert component variable].

Insert Conditional Branch using component variables

Insert conditional branch using component variables.
  1. Execute one of the processes below to open the "Insert conditional branch" screen.
  2. Select the component variable for a conditional branch to [Target variable/data] in the "Insert conditional branch" screen, and click [Finish].

You can also insert a conditional branch by drag & drop the component variable you insert from the source "Component variable" tree, and select [Insert conditional branch] in the menu.

Script Variable

Script variables are variables that can be created by the designer.
Store data temporarily, then use when we want to use in the process after.

In HTML builder edit screen, for Velocity template, it is possible to execute "Insert script variable" or "Insert condition branch process which targets script variable".

Insert script variable

Insert script variable.
  1. Select [Insert script variable] from the right-click menu of the template area, and open the "Insert script variable" screen.

  2. Select the variable to insert to [Script variable] in the "Insert script variable" screen, and click [Finish].

You can also insert a script variable by drag & drop the script variable you insert from the source "Script variable" tree, and select [Insert script variable] in the menu.

Insert Conditional Branch using component variables

Insert conditional branch using component variables.
  1. Execute one of the processes below and open the "Insert conditional branch" screen.
  2. Select the script variable for a conditional branch to [Target variable/data] in the "Insert conditional branch" screen, and click [Finish].

You can also insert a script variable by drag & drop the script variable you insert from the source "Script variable" tree, and select [Insert script variable] in the menu.

Specification Limits

Notes