TableRetriever

From GreenVulcano Wiki
Jump to: navigation, search

Description

The TableRetriever element allows you to define a helper to use into the XSL transformations.

We define the functions that run SQL select and return the result as an XML string in the following form:

<?xml version="1.0" encoding="UTF-8"?>
<RowSet>
  <data>
     <row>
        <col>value1</col>
        <col>value2</col>
        <col>value3</col>
     </row>
     <row>
        <col>value4</col>
        <col>value5</col>
        <col>value6</col>
     </row>
        ..
     <row>
        <col>valuex</col>
        <col>valuey</col>
        <col>valuez</col>
     </row>
  </data>
</RowSet>

The statement to be executed can contain metadata resolved at runtime.

GreenVulcano® ESB configuration

TableRetriever element is used by RetrieverConfig.

The following table shows its attributes:

Attribute Type Description
type fixed retriever (unmodifiable)
class fixed it.greenvulcano.gvesb.datahandling.utils.TableRetriever

Might contain the sub-elements:


An example

Define the following TableRetriever:

    <TableRetriever class="it.greenvulcano.gvesb.datahandling.utils.TableRetriever" type="retriever">
        <DataRetriever cacheable="true" method="..."   signature="...">
             ...
        </DataRetriever>
        <DataRetriever method="..." signature="...">
             ...
        </DataRetriever>
    </TableRetriever>

to be applied to the transformation:

......
    <xsl:element name="col">
        <xsl:value-of select="java:it.greenvulcano.gvesb.datahandling.utils.TableRetriever.getData('....',.....)"/>
    </xsl:element>