Built-in FormInterceptor plugins

NameDescription

SampleFormInterceptor

Reference implementation demonstrating all three interception points (add, get, set), tied to the demo "Consulting" metadata group (okp:consulting.input1, okp:consulting.input2). Every modification only applies when the current user's ID is "test" - with any other user it behaves as if the interceptor were not present, so the same environment can be used to compare both behaviours.

  • add: appends a suffix to okp:consulting.input1's value, and rejects okp:consulting.input2 when it is empty or shorter than 4 characters.
  • get: removes okp:consulting.input1 from both the properties map and the form elements, and adds an on-the-fly, read-only field okp:consulting.input3 that is never persisted.
  • set: re-applies the same length validation as add to okp:consulting.input2, and preserves okp:consulting.input1's current stored value even though the get stage removed it from the form.

Not wired to a metadata group automatically - it is referenced by canonical class name in the interceptorClassName attribute of a property-group element in the metadata XML definition. See Creating your own FormInterceptor plugin for the interface, the full XML example, and the metadata group definition this sample expects.

Table of contents [ Hide Show ]