Difference between revisions of "Placeholders Example"

From GreenVulcano Wiki
Jump to: navigation, search
(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...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The following table shows how to use the metadata using specific examples:
+
The following table shows how to use some metadata using specific examples:
  
 
{|class="gvtable"
 
{|class="gvtable"
 
! Metadata !! Example !! Returns
 
! Metadata !! Example !! Returns
 
|-
 
|-
| SQL || sql{{ds.test_gv::select ‘OK’ from dual}} || the String ‘OK’
+
| SQL || <nowiki>sql{{ds.test_gv::select ‘OK’ from dual}}</nowiki> || the String ‘OK’
 
|-
 
|-
| SQLLIST || [sqllist{{ds.test_gv::,::select name from city order by 1}}] || a list of City, separated by "," ordered alfabetically and enclosed into “[“ and “]”
+
| SQLLIST || <nowiki>[sqllist{{ds.test_gv::,::select name from city order by 1}}]</nowiki> || a list of City, separated by "," ordered alfabetically and enclosed into “[“ and “]”
 
|-
 
|-
| TIMESTAMP || timestamp{{yyyyMMdd HH:mm:ss}} || the current timestamp with the indicated format
+
| TIMESTAMP || <nowiki>timestamp{{yyyyMMdd HH:mm:ss}}</nowiki> || the current timestamp with the indicated format
 
|-
 
|-
| OGNL || Service: ognl{{#object.getService()}} || the service field of the input [[GVBuffer]]
+
| OGNL || Service: <nowiki>ognl{{#object.getService()}}</nowiki> || the service field of the input [[GVBuffer]]
 
|-
 
|-
| JAVASCRIPT || System: js{{gvesb::object.getSystem()}} || the system field of the input [[GVBuffer]]
+
| JAVASCRIPT || System: <nowiki>js{{gvesb::object.getSystem()}}</nowiki> || the system field of the input [[GVBuffer]]
 
|-
 
|-
| SYSTEM || Server Name: ${{jboss.server.name}} || the indicated system property value
+
| SYSTEM || Server Name: <nowiki>${{jboss.server.name}}</nowiki> || the indicated system property value
 
|-
 
|-
| CLASS || %{{fqclass}} || the FQN (Fully Qualified Name) of the input [[GVBuffer]]: it.greenvulcano.gvesb.buffer.GVBuffer
+
| CLASS || <nowiki>%{{fqclass}}</nowiki> || 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
+
| DECODE || <span style="color:green">decode{{</span><span style="color:red">ognl{{<nowiki>#object</nowiki>.getProperty(‘SQL’)}}</span><span style="color:green">::OK::Sql OK::Sql KO}}</span> || 'Sql OK' if ognl evaluates to 'OK'. 'Sql KO' otherwise
 
|-
 
|-
| MINUTE: Minute decode{{js{{gvesb::timestamp{{mm}} % 2 == 0}}::true::EVEN::ODD}} || 'EVEN' if js returns 'true'. 'ODD' otherwise. <br/> timestamp: returns the current minute and js: verifies if the current minute is even or odd.
+
| MINUTE || Minute <span style="color:green">decode{{</span><span style="color:red">js{{gvesb::</span><span style="color:blue"><nowiki>timestamp{{mm}}</nowiki></span><span style="color:red"> % 2 == 0}}</span><span style="color:green">::true::EVEN::ODD}}</span> || 'EVEN' if js evaluates to 'true'. 'ODD' otherwise. <br/> timestamp: returns the current minute and js: verifies if the current minute is even or odd.
 +
|-
 +
| NOW_PLUS_30s || <nowiki>js{{gvesb::DateUtils.dateToString(DateUtils.addTime(DateUtils.createCalendar().getTime(), Calendar.SECOND, 30), DateUtils.FORMAT_ISO_DATETIME_L)}}</nowiki> || the current time plus 30 seconds in [[DateUtils|Long ISO date/time format]].
 
|}
 
|}
  
See [[GVExample_TestProperty|TestProperty]] example for seeing how configure it using {{L_VULCON}}.
+
See [[GVExample_TestProperty|TestProperty]] example for seeing how configure some of it using {{L_VULCON}}.

Latest revision as of 14:43, 31 October 2013

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

Metadata Example Returns
SQL sql{{ds.test_gv::select ‘OK’ from dual}} the String ‘OK’
SQLLIST [sqllist{{ds.test_gv::,::select name from city order by 1}}] a list of City, separated by "," ordered alfabetically and enclosed into “[“ and “]”
TIMESTAMP timestamp{{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: js{{gvesb::object.getSystem()}} the system field of the input GVBuffer
SYSTEM Server Name: ${{jboss.server.name}} the indicated system property value
CLASS %{{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 evaluates to 'OK'. 'Sql KO' otherwise
MINUTE Minute decode{{js{{gvesb::timestamp{{mm}} % 2 == 0}}::true::EVEN::ODD}} 'EVEN' if js evaluates to 'true'. 'ODD' otherwise.
timestamp: returns the current minute and js: verifies if the current minute is even or odd.
NOW_PLUS_30s js{{gvesb::DateUtils.dateToString(DateUtils.addTime(DateUtils.createCalendar().getTime(), Calendar.SECOND, 30), DateUtils.FORMAT_ISO_DATETIME_L)}} the current time plus 30 seconds in Long ISO date/time format.

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