Difference between revisions of "XML Data mapper"

From GreenVulcano Wiki
Jump to: navigation, search
(Functions)
(Functions)
Line 41: Line 41:
 
To create a function you must select a function at the right of Graphic Editor and click in the space where you want to be created. For some functions you must define the format of the same being created, such as the "concat" string you must define how input parameters are needed for this. In this case will be presented with a window that requires the additional information requested. This value will be associated with a Property of the function can be created and modified in the lower box of the Property. To use the functions must then make the link to define the input parameters and the link to define which target element must be connected to the output of the function under consideration.
 
To create a function you must select a function at the right of Graphic Editor and click in the space where you want to be created. For some functions you must define the format of the same being created, such as the "concat" string you must define how input parameters are needed for this. In this case will be presented with a window that requires the additional information requested. This value will be associated with a Property of the function can be created and modified in the lower box of the Property. To use the functions must then make the link to define the input parameters and the link to define which target element must be connected to the output of the function under consideration.
 
[[File:DTEFunction.png|thumb|DTE Function]]
 
[[File:DTEFunction.png|thumb|DTE Function]]
If a parameter to a function you want to assign a constant value, right-click the parameter in question and choose the value to be determined.
+
If a parameter to a function you want to assign a constant value, right-click the parameter in question and choose the value to be determined. If you would need to use a feature not present in the default settings you can use a custom function that is accessed from its folder present in the Palette. When creating a custom function will be presented the new window where you go to add the following fields:
 +
*Name: name of the function to create (example: java:it.greenvulcano.gvesb.datahandling.utils.GenericRetriever.getData).
 +
*Label: label displayed on the editor (example: getId).
 +
*Numarg: number of function arguments.
 +
*Prefix: namespace prefix used by the function (example: java).
 +
*Namespace: namespace of the function ( ''' Inserire il link --- nel DTE vecchio http://xml.apache.org/xalan/java)
  
  

Revision as of 15:13, 6 February 2012

Introduction

XML Data mapper module allows users to implement a data transformation from one format defined by a source xsd to a format defined by a target xsd, and to create xsl documents in a data transformation defined in VulCon. The use of graphics speeds up the process of defining the mapping of data, and gives it a simple and efficient graphical representation.

Create a data transformation

The steps required to create a graphical form of data transformation are:

  • Access the VulCon Core view and expand the GVDataTransformation node
  • Click on Transformations item with right mouse button and choose in the drop-down list
Transformations --> Create XSLT Transformation
  • Using the appearing wizard, insert the data transformation definition parameters:
    • Transformation Name: a configuration file with .gvxdt extension and a xsl transformation file with .xsl extension will be created with the name choosen in this field
    • Data Source: the datasource name that indicates the repository where files will be deposited
    • Path XSL: internal del datasource path in which the xsl file will be generated
    • XSD Input: xsd file name defining the source format
    • root XSD Input: source xsd file root element name from which start the data transformation operation. Xsd files suggested by the drop-down list are stored in the /conf/xsds folder
    • XSD Output: xsd file name defining the target format
    • root XSD Output: target xsd file root element name from which start the data transformation operation. Xsd files suggested by the drop-down list are stored in the /conf/xsds folder
  • Click the wizard Finish button: in Graphic Editor VulCon perspective will appear the Data mapper graphic editor.

Data mapper graphic editor

Data Mapper

In Data mapper graphic editor are visible the representations for input and output formats.Items followed by '=' character are attributes, while those enclosed in angle brackets '<>' are nodes of the xml data. Is it possible to compress or expand simply by clicking on '+' or '-' symbols on the left of each node name. The right pane contains the palettes used for the definition of the data mapping. The Select button allows the selection of the xsd nodes interested for the transformation. The Create link button allows to define links:

  • between a source and a target element;
  • between a source element and a parameter of a function;
  • between the output of a function and a parameter of another function;
  • between the output of a function and a target element.

In the folders below that buttons, it is possible to access the functions used for data-mapping grouped by topic.

Links

A link is a relation between the node in the source format and its counterpart in the target format. Clicking the Create link button in the Palette pane, link mode is enabled. In this mode is possible creating a new connection simply clicking on a node in the source xsd format, and dragging it on a target node. Once defined a new connection in the graphic area, properties of the selected object are shown in Properties area. 'Match' property allows the definition of the selected mapping generation mode:

  • template: a template node will be created e called into the mapping;
  • for-each: a for-each node will be created to generate all defined mapping.

Functions

To create a function you must select a function at the right of Graphic Editor and click in the space where you want to be created. For some functions you must define the format of the same being created, such as the "concat" string you must define how input parameters are needed for this. In this case will be presented with a window that requires the additional information requested. This value will be associated with a Property of the function can be created and modified in the lower box of the Property. To use the functions must then make the link to define the input parameters and the link to define which target element must be connected to the output of the function under consideration.

DTE Function

If a parameter to a function you want to assign a constant value, right-click the parameter in question and choose the value to be determined. If you would need to use a feature not present in the default settings you can use a custom function that is accessed from its folder present in the Palette. When creating a custom function will be presented the new window where you go to add the following fields:

  • Name: name of the function to create (example: java:it.greenvulcano.gvesb.datahandling.utils.GenericRetriever.getData).
  • Label: label displayed on the editor (example: getId).
  • Numarg: number of function arguments.
  • Prefix: namespace prefix used by the function (example: java).
  • Namespace: namespace of the function ( Inserire il link --- nel DTE vecchio http://xml.apache.org/xalan/java)




{{#w4grb_rate:}} <w4grb_ratinglist latestvotes items="5" nosort/>