Example: Override the behaviour of an existing screen
This example changes the existing behavior of a screen inside Web Determinations. The supplied example (MultiScreenContainmentCollect.zip) provides a custom screen that changes the behavior of an Entity collect screen, so that instead of collecting all the instances of an entity on one screen, it will have one entity collected per screen. In this example, every time the user clicks the Add button, they are taken to a new screen.
The Example
The supplied file (MultiScreenContainmentCollect.zip) contains the following components
- The java plugin (MultiScreenContainmentCollect.jar)
- The full source of the plugin (src/)
- An example rulebase project (development/)
Installation
For general details on how to install a plugin and the rulebase, refer to the appropriate release documentation.
Quick start for Apache Tomcat
This guide assumes that Apache Tomcat 5.5 or 6.0 is install and Web Determinations 10.0 has been deployed
- download and unzip the attached file
- Compile the rulebase contained in the archive using Oracle Policy Automation 10.0
- Deploy the rulebase zip file to the Web Determinations rulebase directory (by default this will be <tomcat install dir>/webapps/web-determinations/WEB-INF/classes/rulebases)
- Copy the plugin file (MultiScreenContainmentCollect.jar) to the plugins directory (by default this will be <tomcat install dir>/webapps/web-determinations/WEB-INF/classes/plugins)
- Restart Tomcat
How it works
The example contains four components:
- CustomScreenProvider - This class is responsible to for creating and returning the custom screen. Invoking the custom screen is done via adding the custom property "MultiScreenContainmentCollect" to an entity collect and setting its value to true.
- MultiScreenContainmentCollect - Is the custom screen implementation for this plugin. It provides the controller logic for rendering the collect screen, adding, deleting, submitting and moving between entity instances.
- SingleEntityScreen - Is the implementation of the entity collect screen containing the current entity instance.
- SingleEntityInstanceCollectGroup - A control that modifies the default behavior of an entity instance displayed on an entity collect screen.
Refer to the code documentation provided in the example for more details.