Difference between revisions of "XML Data mapper"
(→Functions) |
|||
Line 38: | Line 38: | ||
*template: a template node will be created e called into the mapping; | *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. | *for-each: a for-each node will be created to generate all defined mapping. | ||
+ | |||
===Functions=== | ===Functions=== | ||
Folders on the right of Graphic Editor contain the most largely used [http://www.w3schools.com/xpath/xpath_functions.asp XSLT and xpath functions], organized by topic.<br/> | Folders on the right of Graphic Editor contain the most largely used [http://www.w3schools.com/xpath/xpath_functions.asp XSLT and xpath functions], organized by topic.<br/> | ||
To use a function is sufficient to select it in the appropriate folder and then to click where is preferred in the editor. For those functions which have a variable number of parameters, such as the 'concat' operation, a dedicated pop-up will open. Once done this steps, a graphical representation of the new function will be present in the graphical area. <br/> | To use a function is sufficient to select it in the appropriate folder and then to click where is preferred in the editor. For those functions which have a variable number of parameters, such as the 'concat' operation, a dedicated pop-up will open. Once done this steps, a graphical representation of the new function will be present in the graphical area. <br/> | ||
[[File:DTEFunction.png|thumb|DTE Function]] | [[File:DTEFunction.png|thumb|DTE Function]] | ||
− | + | At this point you need to create all links to define the input parameters and the one to define the element that will assume the output value of the function.<br/> | |
To give a constant value to a function parameter you must right-click on its graphical representation and then insert the value. To modify a parameter value simply set it in the corresponding property in the lower Property editor.<br/> | To give a constant value to a function parameter you must right-click on its graphical representation and then insert the value. To modify a parameter value simply set it in the corresponding property in the lower Property editor.<br/> | ||
− | If the desired function is not present inside function folders, it is possible to define it choosing from Custom folder. To do this you must enter values in | + | If the desired function is not present inside function folders, it is possible to define it choosing from Custom folder. To do this you must enter values in the following fields: |
− | + | *Name: the name of the function to create (eg.: java:it.greenvulcano.gvesb.datahandling.utils.GenericRetriever.getData). | |
− | + | *Label: the label displayed on the editor (eg.: getId). | |
− | + | *Numarg: the number of function arguments. | |
− | + | *Prefix: the namespace prefix used by the function (example: java). | |
− | + | *Namespace: the namespace of the function ( ''' Inserire il link --- nel DTE vecchio http://xml.apache.org/xalan/java) | |
− | |||
− | *Name: name of the function to create ( | ||
− | *Label: label displayed on the editor ( | ||
− | *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) | ||
===Creating additional nodes=== | ===Creating additional nodes=== |
Revision as of 11:42, 7 February 2012
Contents
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
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
Folders on the right of Graphic Editor contain the most largely used XSLT and xpath functions, organized by topic.
To use a function is sufficient to select it in the appropriate folder and then to click where is preferred in the editor. For those functions which have a variable number of parameters, such as the 'concat' operation, a dedicated pop-up will open. Once done this steps, a graphical representation of the new function will be present in the graphical area.
At this point you need to create all links to define the input parameters and the one to define the element that will assume the output value of the function.
To give a constant value to a function parameter you must right-click on its graphical representation and then insert the value. To modify a parameter value simply set it in the corresponding property in the lower Property editor.
If the desired function is not present inside function folders, it is possible to define it choosing from Custom folder. To do this you must enter values in the following fields:
- Name: the name of the function to create (eg.: java:it.greenvulcano.gvesb.datahandling.utils.GenericRetriever.getData).
- Label: the label displayed on the editor (eg.: getId).
- Numarg: the number of function arguments.
- Prefix: the namespace prefix used by the function (example: java).
- Namespace: the namespace of the function ( Inserire il link --- nel DTE vecchio http://xml.apache.org/xalan/java)
Creating additional nodes
Some changes need to create nodes by duplicating the basic knot. To realize this operation, simply select the node with the right base and create a new duplicate node. Next to the new node selected will be reported on the value of the Ordinary, a node associated with the numeral represents the only instance of n-th (n par value of the numeral) of that node. while if not has the numeral is associated with a node that represents all the nodes of that type.
{{#w4grb_rate:}} <w4grb_ratinglist latestvotes items="5" nosort/>