docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 5.1Web Developer ManualEmit Tags
Copyright  2013, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com



<emit>
<emit atlas>
<emit captcha>
<emit cimg>
<emit dir>
<emit exec>
<emit fonts>
<emit js-dynamic-popup>
<emit js-hide-popup>
<emit languages>
<emit ldap>
<emit path>
<emit sources>
<emit sql>
<emit timerange>
<emit values>
<emit ws-dir>

<emit source="exec"></emit>

Provided by module: Tags: Exec emit plugin

This plugin makes it possible to call an external application and retrieve the output written to stdout. To call an application it has to be specified in the Available Applications module variable. The result can be parsed and variables can be extracted by settting delimiter characters. The return value and the raw result from the application can be retrieved with special variables.

Note!

All <emit> attributes apply.


Attributes

<emit source='exec' application='uptime' raw-variable='var.raw'/> <sscanf format='%*s load average: %f, %f, %f' variables='var.load-1,var.load-5,var.load-15'>&var.raw;</sscanf> Load 1 min: &var.load-1;<br/> Load 5 min: &var.load-5;<br/> Load 15 min: &var.load-15;<br/>
<emit source='exec' application='cat' arguments='/proc/meminfo' value-split=':'> MemTotal: &_.MemTotal;<br/> MemFree: &_.MemFree;<br/> </emit>
application="string"

A symbolic name of the application to execute. The path to the application is looked up in the Available Applications module variable. The application has to be defined in the list, an error will be generated otherwise.


arguments="string"

Defines the arguments sent to the application.


timeout="seconds"(60)

This attribute defines the timeout for the external application. After the specified amount of seconds the application is killed.


loop-split="string"

This attribute defines the delimiter to use when the result is split to extract each loop step.


entity-split="string"(newline)

This attribute defines the delimiter to use when each loop of the result is split to extract entities.


value-split="string"(=)

This attribute defines the delimiter to use when each entity of the result is split to extract the entry name and its value.


raw-variable="variable name"

Define this attribute to a variable name to store the raw result from the application in this variable. The variable will also be available after the emit


return-variable="variable name"

Define this attribute to a variable name to store the return value from the application in this variable. The variable will also be available after the emit