This example changes the existing behavior of a screen inside Web Determinations. The attached example provides a custom screen to that changes the behavior of an Entity collect screen from collecting all the instance of an entity on one screen to having 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 accompanying MultiScreenContainmentCollect.zip file 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 see 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.