Package com.groiss.dms
Interface FormEventHandler<T extends DMSForm>
- All Known Implementing Classes:
FormEventAdapter
public interface FormEventHandler<T extends DMSForm>
This interface is used for writing callback classes enhancing
the functionality of forms. The methods beforeInsert, beforeUpdate, and beforeDelete 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 String
Returns the name of this form.default void
onShow
(T f, ActivityInstance ai, HTMLPage 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.- 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.- Parameters:
f
- the form to showai
- the actual activity instance (in case of process forms)p
- the html 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
-