Class EasyFormsRunnerController

java.lang.Object
io.vertigo.easyforms.runner.controllers.EasyFormsRunnerController

@Controller public final class EasyFormsRunnerController extends Object
  • 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 viewContext
      efoUid - UID of the form
      templateKey - 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 viewContext
      efoUidList - List of UID of the forms
      templateKey - 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 viewContext
      efoUid - UID of the form
      templateKey - ViewContextKey where the template is published
      formulaireResponse - Data of the form (user input)
      isCreation - if the form is being created
      additionalContextKeys - 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 - viewContext
      templateKey - 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 check
      formOwner - entity holding the form
      formDataFieldName - field name of the form in the entity
      throwUserErrors - if true, throw UserException if errors
      Returns:
      if the form is valid