Package com.groiss.dms
Interface XHTMLFormEventHandler<T extends DMSForm>
- All Superinterfaces:
ObjectFormHandler<T>
- All Known Subinterfaces:
XHTMLFolderFormEventHandler<T>
- All Known Implementing Classes:
XHTMLFolderFormEventAdapter
,XHTMLFormEventAdapter
This interface is used for writing callback classes enhancing
the functionality of forms. The methods onInsert, onUpdate, and onDelete are
called before the database operation is performed.
Additional information can be taken from the ThreadContext. If the database operation is done in the context of a HTTP interaction, the ThreadContext contains the HTTP-request with the following parameters:
In case of View Forms the resolution of the handlers to execute is as follows:
Additional information can be taken from the ThreadContext. If the database operation is done in the context of a HTTP interaction, the ThreadContext contains the HTTP-request with the following parameters:
- task: the oid of the activity instance (if it is a process form or sub-form)
- _src: the oid of the main form, if it is a subform
- _srcclass: the class name of the main form
- _id: the id of the form relation
In case of View Forms the resolution of the handlers to execute is as follows:
- If there are handlers defined for the
FormType
of the View Form those handlers will be called for the View Form itself. - If no handlers are defined for the
FormType
of the View Form but there are handlers defined for theFormType
of the base form of the View Form, those handlers will be performed on the base form object.
afterDelete(DMSForm)
afterInsert(DMSForm)
afterUpdate(DMSForm)
beforeDelete(DMSForm)
beforeInsert(DMSForm)
beforeInsert(DMSForm)
getName(DMSForm)
- API Note
- Objects of this class are cached in the form object for which they are used. As a consequence, consecutive calls of handler methods for that form will be performed by the very same handler objects.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
afterDelete
(T f) This method is called after the form has been deleted from the store.default void
afterInsert
(T f) This method is called after the form has been inserted into the store.default void
afterUpdate
(T f) This method is called after the form has been updated in the store.default void
beforeDelete
(T f) This method is called before the form is deleted.default void
beforeInsert
(T f) This method is called before the form is inserted into the store.default void
beforeShow
(T f, FormContext ctx, HttpServletRequest req) This method will be called before the page for the passed form is build.default void
beforeUpdate
(T f) This method is called before the form is updated in the store (the existing form in the store will be overwritten with the values of this form).default OrgUnit
Return the org.unit the form belongs to.default String[][]
A class may return key field groups in order to identify already existing objects of that class.default String
Returns the name of this form.default void
modifyModel
(T f, Element formElement, FormContext ctx) Callback for modifying the model element.default void
onShow
(T f, FormContext ctx, XHTMLPage p, HttpServletRequest req) This method is called before the form is sent to the browser.
-
Method Details
-
beforeInsert
This method is called before the form is inserted into the store.- Parameters:
f
- the form to insert- Throws:
Exception
-
beforeUpdate
This method is called before the form is updated in the store (the existing form in the store will be overwritten with the values of this form).- Parameters:
f
- the form to update- Throws:
Exception
-
beforeDelete
This method is called before the form is deleted.- Parameters:
f
- the form to delete- Throws:
Exception
-
afterInsert
This method is called after the form has been inserted into the store.- Parameters:
f
- the inserted form- Throws:
Exception
-
afterUpdate
This method is called after the form has been updated in the store.- Parameters:
f
- the updated form- Throws:
Exception
-
afterDelete
This method is called after the form has been deleted from the store.- Parameters:
f
- the deleted form- Throws:
Exception
-
beforeShow
This method will be called before the page for the passed form is build. This allows particularly to set default values for form attributes which will be used when building the page.- Specified by:
beforeShow
in interfaceObjectFormHandler<T extends DMSForm>
- Parameters:
f
- the form to showctx
- holds context information for the formreq
- the http request requesting the form's page- Throws:
Exception
-
onShow
This method is called before the form is sent to the browser.- Specified by:
onShow
in interfaceObjectFormHandler<T extends DMSForm>
- Parameters:
f
- the form to showctx
- holds context information for the formp
- the xhtml page which will be sent to the browserreq
- the http request requesting the form's page- Throws:
Exception
-
getName
Returns the name of this form. If null is returned the default naming mechanism will be used.- Parameters:
f
- the form which name is wanted- Returns:
- Default returns null.
- Throws:
Exception
-
getDefaultOrgUnit
Return the org.unit the form belongs to. This can be used for permission checks.- Returns:
- Default returns null
-
getKeys
A class may return key field groups in order to identify already existing objects of that class. A key field group must uniquely identify an object. Multiple such key field groups can be defined. Each of the key field groups must be unique for an object to be unique (thus, group1 matches OR group2 matches etc.).The first key field group is occasionally treated in a special manner as the primary business key. E.g. the export import functionality checks for object existence according to just the first key field group.
- Returns:
- An array of arrays containing object field names of those fields which
constitute key field groups for uniquely identifying objects of classes implementing this
interface. An example would be
{{"name", "birthdate"},{"ssn"}}
for a class defining two key field groups. The first one contains the fieldsname
andbirthdate
, the second key field group has just one fieldssn
. Default returns empty structure.
-
modifyModel
Callback for modifying the model element.
-