Class EasyFormsRunnerController
java.lang.Object
io.vertigo.easyforms.runner.controllers.EasyFormsRunnerController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E extends io.vertigo.datamodel.data.model.Entity>
booleancheckAndProcessUiFormResponse(EasyFormsTemplate easyFormsTemplate, E formOwner, io.vertigo.datamodel.data.definitions.DataFieldName<E> formDataFieldName, boolean throwUserErrors) Validate EasyFormData with the given template and process UI data conversion.getDefaultDataValues(io.vertigo.ui.core.ViewContext viewContext, io.vertigo.ui.core.ViewContextKey<EasyFormsTemplate> templateKey) Get default template values. initReadContext or initEditContext must have been previously called.voidinitEditContext(io.vertigo.ui.core.ViewContext viewContext, io.vertigo.datamodel.data.model.UID<EasyForm> efoUid, io.vertigo.ui.core.ViewContextKey<EasyFormsTemplate> templateKey, EasyFormsData formulaireResponse, boolean isCreation, io.vertigo.ui.core.ViewContextKey<?>... additionalContextKeys) Initialize the context for editing a form.voidinitMultipleReadContext(io.vertigo.ui.core.ViewContext viewContext, Collection<io.vertigo.datamodel.data.model.UID<EasyForm>> efoUidList, io.vertigo.ui.core.ViewContextKey<ArrayList<EasyFormsTemplate>> templateKey) Initialize the context for reading multiple forms.voidinitReadContext(io.vertigo.ui.core.ViewContext viewContext, io.vertigo.datamodel.data.model.UID<EasyForm> efoUid, io.vertigo.ui.core.ViewContextKey<EasyFormsTemplate> templateKey) Initialize the context for reading a form.
-
Constructor Details
-
EasyFormsRunnerController
public EasyFormsRunnerController()
-
-
Method Details
-
initReadContext
public void initReadContext(io.vertigo.ui.core.ViewContext viewContext, io.vertigo.datamodel.data.model.UID<EasyForm> efoUid, io.vertigo.ui.core.ViewContextKey<EasyFormsTemplate> templateKey) Initialize the context for reading a form.- Parameters:
viewContext- Current viewContextefoUid- UID of the formtemplateKey- ViewContextKey where the template is published
-
initMultipleReadContext
public void initMultipleReadContext(io.vertigo.ui.core.ViewContext viewContext, Collection<io.vertigo.datamodel.data.model.UID<EasyForm>> efoUidList, io.vertigo.ui.core.ViewContextKey<ArrayList<EasyFormsTemplate>> templateKey) Initialize the context for reading multiple forms.- Parameters:
viewContext- Current viewContextefoUidList- List of UID of the formstemplateKey- ViewContextKey where the template is published
-
initEditContext
public void initEditContext(io.vertigo.ui.core.ViewContext viewContext, io.vertigo.datamodel.data.model.UID<EasyForm> efoUid, io.vertigo.ui.core.ViewContextKey<EasyFormsTemplate> templateKey, EasyFormsData formulaireResponse, boolean isCreation, io.vertigo.ui.core.ViewContextKey<?>... additionalContextKeys) Initialize the context for editing a form.- Parameters:
viewContext- Current viewContextefoUid- UID of the formtemplateKey- ViewContextKey where the template is publishedformulaireResponse- Data of the form (user input)isCreation- if the form is being createdadditionalContextKeys- additional context keys needed for the form (eg, resolving conditional blocs)
-
getDefaultDataValues
public EasyFormsData getDefaultDataValues(io.vertigo.ui.core.ViewContext viewContext, io.vertigo.ui.core.ViewContextKey<EasyFormsTemplate> templateKey) Get default template values. initReadContext or initEditContext must have been previously called.- Parameters:
viewContext- viewContexttemplateKey- ViewContextKey where the template is published
-
checkAndProcessUiFormResponse
public <E extends io.vertigo.datamodel.data.model.Entity> boolean checkAndProcessUiFormResponse(EasyFormsTemplate easyFormsTemplate, E formOwner, io.vertigo.datamodel.data.definitions.DataFieldName<E> formDataFieldName, boolean throwUserErrors) Validate EasyFormData with the given template and process UI data conversion. Can be only used with EasyFormsData coming from UI, not from database.- Type Parameters:
E- Entity type- Parameters:
easyFormsTemplate- template to checkformOwner- entity holding the formformDataFieldName- field name of the form in the entitythrowUserErrors- if true, throw UserException if errors- Returns:
- if the form is valid
-