-
Book Overview & Buying
-
Table Of Contents
Apache OfBiz Cookbook
You can use Groovy scripting language to prepare data for any presentation layer screen rendering tool, including the FreeMarker templating engine and OFBiz widgets.
Groovy has been integrated into the OFBiz framework, so using it is as simple as creating a text file with Groovy code and then pointing one or more Screen widget actions declarations to the location of the Groovy file.
Note: a side effect of integration is that execution context information, including the HTTP/HTTPS request message and request parameters, are always available in the Groovy runtime context.
By convention, Groovy files are located in the webapp/WEB-INF/actions directory of a containing Component. For example, we could have a Groovy file named myGroovyFile.groovy located in the ~myComponent/webapp/WEB-INF/actions directory.
To prepare "Groovy" data, follow these steps:
1. Create a new text file or open an existing file.
2. Import any required Java classes...
Change the font size
Change margin width
Change background colour