Difference between revisions of "DataRetriever"

From GreenVulcano Wiki
Jump to: navigation, search
Line 1: Line 1:
''DataRetriever'' defines a helper function. Can contains the following placeholders:
+
''DataRetriever'' defines a helper function.  
 +
 
 +
It is defined by four parameters:
 +
 
 +
* '''cacheable''' (true|false): If true the calculated function value, for the given parameters set, is cached for future access during the service processing.<br/> The cache is canceled at service end. <br/>  Default false.
 +
 
 +
* '''DataRetriever''': can contains the following placeholders:
  
 
# fixed : a text string;
 
# fixed : a text string;
Line 14: Line 20:
 
# <nowiki>sqltable{{conn::statement}}</nowiki>: executes a select sql statement and returns all values of returned cursor as an XML.<br/> The 'conn' parameter is the JNDI name of a DataSource
 
# <nowiki>sqltable{{conn::statement}}</nowiki>: executes a select sql statement and returns all values of returned cursor as an XML.<br/> The 'conn' parameter is the JNDI name of a DataSource
 
# <nowiki>ognl{{script}}</nowiki> : evaluate a OGNL script
 
# <nowiki>ognl{{script}}</nowiki> : evaluate a OGNL script
 +
 +
* '''method''': Helper function name.
 +
 +
* '''signature''': Comma-separated list of parameters name to be substituted in the function.

Revision as of 17:53, 22 January 2012

DataRetriever defines a helper function.

It is defined by four parameters:

  • cacheable (true|false): If true the calculated function value, for the given parameters set, is cached for future access during the service processing.
    The cache is canceled at service end.
    Default false.
  • DataRetriever: can contains the following placeholders:
  1. fixed : a text string;
  2. ${{propname}}  : a System property name;
  3. sp{{propname}}  : a System property name;
  4. @{{propname}}  : a inProperties property name;
  5. timestamp{{pattern}} : return the current timestamp formatted as 'pattern'
  6. dateformat{{date::source-pattern::dest-pattern}} : reformat 'date' from 'source-pattern' to 'dest-pattern'
  7. decode{{field[::cond1::val1][::cond2::val2][cond...n::val...n]::default}} : evaluate as if-then-else; if 'field' is equal to cond1...n, return the value of val1...n, otherwise 'default'
  8. decodeL{{sep::field[::cond1::val1][::cond2::val2][cond...n::val...n]::default}} : is equivalent to 'decode', with the difference that 'condX' can be a list of values separated by 'sep'
  9. js{{scope::script}} : evaluate a JavaScript script, using the scope 'scope'
  10. sql{{conn::statement}}  : execute a select sql statement sql and return the value of the first field of the first selected record.
    The 'conn' parameter is the JNDI name of a DataSource
  11. sqllist{{conn[::sep]::statement}}: execute a select sql statement sql and return the value of the first field of all selected records as a 'sep' separated list.
    The 'conn' parameter is the JNDI name of a DataSource
    The 'sep' parameter defaults to comma
  12. sqltable{{conn::statement}}: executes a select sql statement and returns all values of returned cursor as an XML.
    The 'conn' parameter is the JNDI name of a DataSource
  13. ognl{{script}} : evaluate a OGNL script
  • method: Helper function name.
  • signature: Comma-separated list of parameters name to be substituted in the function.