OpenWGA is an open source java based content management system using the Mozilla JavaScript engine Rhino as scripting and expression engine. OpenWGA supports JSS in version 5.4.1 or later.

The OpenWGA plugin "OpenWGA Application Framework" - which is preinstalled in every OpenWGA distribution - provides an includable WebTML module "toCSS" in medium "jss", which you can use to create CSS styles from JSS.

Sample:

<tml:include designdb="@afw" ref="toCSS" o_scope="#header">

padding:20,

h1: {

font_size: "200%"

}

</tml:include>

Note: For this include to work you need to define a design shortcut named "afw" in the configuration of your OpenWGA design. Make it type "plugin" and specify "de.innovationgate.wga-app-framework" as reference.

Using Variables in OpenWGA JSS

OpenWGA has its own integrated way to define variables for template code. These are called WebTML variables and are usable in JSS as well, for example:

<tml:include designdb="@afw" ref="toCSS" o_scope="#header">


<tml:script>

_padding = 20;

_color = "white";

</tml:script>


padding: _padding,

width: 200 - _padding,

color: _color


</tml:include>

In addition the toCSS module accepts an WebTML option "vars" where you can specify variables like you would specify fields inside a JavaScript object. These variables are available as fields of object "JSS" inside your JSS code:

<tml:include designdb="@afw" ref="toCSS" o_scope="#header">


<tml:option name="vars">

padding: 20,

color: "white"

</tml:option>


padding: JSS.padding,

width: 200 - JSS.padding,

color: JSS.color


</tml:include>"