Placeholders Example

From GreenVulcano Wiki
Revision as of 02:02, 11 February 2012 by Anonymous (talk) (Created page with "The following table shows how to use the metadata using specific examples: {|class="gvtable" ! Metadata !! Example !! Returns |- | SQL || sql{{ds.test_gv::select ‘OK’ from d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The following table shows how to use the metadata using specific examples:

Metadata Example Returns
SQL sqlTemplate:Ds.test gv::select ‘OK’ from dual the String ‘OK’
SQLLIST [sqllistTemplate:Ds.test gv::,::select name from city order by 1] a list of City, separated by "," ordered alfabetically and enclosed into “[“ and “]”
TIMESTAMP timestampTemplate:YyyyMMdd HH:mm:ss the current timestamp with the indicated format
OGNL Service: ognl{{#object.getService()}} the service field of the input GVBuffer
JAVASCRIPT System: jsTemplate:Gvesb::object.getSystem() the system field of the input GVBuffer
SYSTEM Server Name: $Template:Jboss.server.name the indicated system property value
CLASS %Template:Fqclass the FQN (Fully Qualified Name) of the input GVBuffer: it.greenvulcano.gvesb.buffer.GVBuffer
DECODE decode{{ognl{{#object.getProperty(‘SQL’)}}::OK::Sql OK::Sql KO}} 'Sql OK' if ognl 'OK'. 'Sql KO' otherwise
MINUTE: Minute decode{{js{{gvesb::timestampTemplate:Mm % 2 == 0}}::true::EVEN::ODD}} 'EVEN' if js returns 'true'. 'ODD' otherwise.
timestamp: returns the current minute and js: verifies if the current minute is even or odd.

See TestProperty example for seeing how configure it using VulCon®.