Interface FormProcessor<T>
-
- Type Parameters:
T
- formBean type
public interface FormProcessor<T>
Helper class for working with iKnowBase form backing beans in Spring MVC Controllers and FreeMarker views.Provides conversion between a form bean with @AttributeMapping annotated properties and iKnowBase documents for simplified load/insert/update operations of iKnowBase documents. The form bean is further used when rendering HTML with FreeMarker views and when mapping and validating submitted form data.
Provides optional callback/delegation methods that can be implemented in form backing beans. This helps keep the Controller clean when handling multiple forms in the same Controller.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bindingError(BindingResult bindingResult)
T
getFormBean()
void
init()
void
load(Integer documentId)
void
registerFormMacro(Model model, String formModelName)
void
registerFormMacro(Model model, String formModelName, String macroName)
DocumentReference
save()
Saves the document using the document identifier found in the form bean.DocumentReference
save(Integer documentId)
Saves the document using a given document IDboolean
validate(BindingResult bindingResult)
-
-
-
Method Detail
-
getFormBean
T getFormBean()
-
init
void init()
-
load
void load(Integer documentId)
-
validate
boolean validate(BindingResult bindingResult)
-
bindingError
void bindingError(BindingResult bindingResult)
-
save
DocumentReference save()
Saves the document using the document identifier found in the form bean. Null document identifier means insert. Non-null means update.- Returns:
- new (insert) or existing (update) document reference
-
save
DocumentReference save(Integer documentId)
Saves the document using a given document ID- Parameters:
documentId
- null means insert. Non-null means update.- Returns:
- new (insert) or existing (update) document reference
-
-