GenericRetriever

From GreenVulcano Wiki
Revision as of 16:38, 30 March 2012 by Anonymous (talk) ({{GVESB}} configuration)
Jump to: navigation, search

Description

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

We define the functions that run SQL select statement and return the first field of the first record.

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

GreenVulcano® ESB configuration

GenericRetriever 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.GenericRetriever

Might contain the sub-elements:


An example

Define the following GenericRetriever:

<GenericRetriever class="it.greenvulcano.gvesb.datahandling.utils.GenericRetriever"
                                              type="retriever">
       <DataRetriever cacheable="true" method="getCityID"   signature="NAME">
                 select ID from CITY
                 where NAME=‘@{{NAME}}’
       </DataRetriever>
       <DataRetriever method="getPersonID" signature="NAME,CITY">
                 select ID from PERSON
                 where NAME=‘@{{NAME}}’
                 and ID_CITY=(select ID from CITY where NAME=‘@{{CITY}}’)
        </DataRetriever>
</GenericRetriever>

to be applied to the transformation:

<xsl:variable name="name" select="/PersonsData/PersonData/Name"/>
    <xsl:variable name="city" select="/PersonsData/PersonData/City"/>
    <xsl:element name="col">
        <xsl:value-of select="java:it……utils.GenericRetriever.getData
              ('getPersonID',concat($name,';',$city))"/>
    </xsl:element>