Listeners
|
Copyright 2008-2010 ManyDesigns srl. All rights reserved.
PurposeListener allow you to intercept (create, update, delete) operations on objects. Listeners in ManyDesigns Portofino are similar to triggers in relational databases.When are listeners executed?Every listener has six actions that are executed in six different situations, as shown in the following table:
The difference between a "pre" and a "post" operation is in the temporal relationship with respect to the DML commands (INSERT, UPDATE, DELETE) Portofino uses to persist its objects. The order is:
Types of listenersThere are two types of listeners: script class listeners and Java class listeners. They fill exactly the same purpose and functionality. What varies is their implementation. Script class listeners are written as BeanShell scripts through Portofino's web interface. Java class listeners are written as a Java classes and need to be complied outside Portofino.All listeners have the following common fields:
Script class listenersA script class listener has six text fields where you can write a script directly in BeanShell syntax:
Java class listenersA Java class listener has one specific attribute:
Previous: Custom operations
Next: Single sign-on
|