Every table object specified by a
/dbforms-config/table
element uses by default the standard
event configuration. A developer can choose to override the event class associated
to a certain event type, by adding and configuring the events element in the dbforms-config file as shown below:
<dbforms-config> ... <table name="MYTABLE"> <field name="TABLEID" fieldType="varchar" size="10" isKey="true"/> <field name="NAME" fieldType="varchar" size="16"/> ... <interceptor className="foo.bar.MyInterceptor"/> <!-- - Here you can specify custom event classes that override the default ones. - Event properties can be configured using "property" elements. --> <events> <event type="insert" id="insert2"> <!-- event properties configuration --> <property name="sourceView" value="VIEW_USER" /> <property name="targetTable" value="USER" /> </event> </events> </table> ... </dbforms-config>
Every
/dbforms-config/table/events/event
element uses the following mandatory attributes:
attribute name | description | |
---|---|---|
type | the event type. Must be a supported type value. | |
id |
the event identifier. Must be equal to the identifier attribute of an event specified by a
/dbforms-config/events/database-events/database-event or
/dbforms-config/events/navigation-events/navigation-event element.
|
Every
/dbforms-config/table/events/event
can be configured using a set of properties (obviously, those properties are useful only if the event class support them). To declare the properties, the developer must add to the element a set of children elements and configure their attributes.
Every
/dbforms-config/table/events/event
element uses the following mandatory attributes:
attribute name | description | |
---|---|---|
name | the name of the event property. | |
value | the value of the event property. |
The following example shows how to override an update event in an alias of a table.
<dbforms-config> <table name="explanations" ...> ... </table> <query name="explanations_with_custom_update" from="explanations"> <interceptor className="your.package.dbi.interceptor_class_name"/> <events> <event type="update" id="update2"/> </events> </query> <events> <!-- define database custom events here --> <database-events> <database-event id="update2" type="update" className="your.package.pluggableEvents.MyUpdateEvent"/> </database-events> </events> </dbforms-config>