Class EasyFormsRunnerServices

java.lang.Object
io.vertigo.easyforms.runner.services.EasyFormsRunnerServices
All Implemented Interfaces:
io.vertigo.core.node.component.Component, io.vertigo.core.node.component.CoreComponent

public class EasyFormsRunnerServices extends Object implements io.vertigo.core.node.component.Component
  • Constructor Details

    • EasyFormsRunnerServices

      public EasyFormsRunnerServices()
  • Method Details

    • getEasyFormById

      public EasyForm getEasyFormById(io.vertigo.datamodel.data.model.UID<EasyForm> efoUid)
      Retrieves an EasyForm by its unique identifier.
      Parameters:
      efoUid - The unique identifier of the EasyForm.
      Returns:
      The EasyForm associated with the given unique identifier.
    • getEasyFormListByIds

      public io.vertigo.datamodel.data.model.DtList<EasyForm> getEasyFormListByIds(Collection<io.vertigo.datamodel.data.model.UID<EasyForm>> efoUids)
      Retrieves a list of EasyForms by their unique identifiers.
      Parameters:
      efoUids - The unique identifiers of the EasyForms.
      Returns:
      A list of EasyForms associated with the given unique identifiers.
    • formatAndCheckFormulaire

      public <E extends io.vertigo.datamodel.data.model.DataObject> void formatAndCheckFormulaire(E formOwner, io.vertigo.datamodel.data.definitions.DataFieldName<E> formDataFieldName, EasyFormsTemplate formTempalte, io.vertigo.vega.webservice.validation.UiMessageStack uiMessageStack, Map<String,Serializable> contextValues)
      Formats and checks the form data.
      Parameters:
      formOwner - The owner of the form.
      formDataFieldName - The field name of the form data.
      formTempalte - The template of the form.
      uiMessageStack - The stack of UI messages.
      contextValues - The context values.
    • formatAndCheckSingleField

      public Object formatAndCheckSingleField(io.vertigo.datamodel.data.model.DataObject formOwner, String fieldCode, EasyFormsTemplateItemField field, Object inputValue, EasyFormsData formData, Map<String,Serializable> contextValues, io.vertigo.vega.webservice.validation.UiMessageStack uiMessageStack)
      Formats and checks a single field of the form data.
      Parameters:
      formOwner - The owner of the form.
      fieldCode - The code of the field.
      field - The field to format and check.
      inputValue - The value of the field.
      formData - The form data.
      contextValues - The context values.
      uiMessageStack - The stack of UI messages.
      Returns:
      The formatted and checked value of the field.
    • persistFiles

      public void persistFiles(Optional<EasyFormsData> oldDataOpt, EasyFormsData newData)
      Persists the files from the new form data and removes any files from the old form data that are not present in the new form data.
      Parameters:
      oldDataOpt - The old form data.
      newData - The new form data.
    • getDefaultDataValues

      public EasyFormsData getDefaultDataValues(EasyFormsTemplate easyFormsTemplate, Map<String,Serializable> contextData)
      Retrieves the default data values for a given form template.
      Parameters:
      easyFormsTemplate - The form template.
      contextValues - The context values.
      Returns:
      The default data values for the given form template.
    • setDefaultValuesOnHidden

      public void setDefaultValuesOnHidden(EasyFormsTemplate formTempalte, EasyFormsData formData, Map<String,Serializable> contextData)
      Sets the default values on hidden fields.
      Parameters:
      formTempalte - The form template.
      formData - The form data
      contextValues - The context values.
    • createTmpFileInfo

      public io.vertigo.datastore.filestore.model.FileInfo createTmpFileInfo(io.vertigo.datastore.filestore.model.VFile vFile)
      Creates a temporary FileInfo from a given VFile.
      Parameters:
      vFile - The VFile.
      Returns:
      The temporary FileInfo.
    • saveTmpFile

      public io.vertigo.datastore.filestore.model.FileInfo saveTmpFile(io.vertigo.datastore.filestore.model.VFile vFile)
      Saves a temporary file from a given VFile.
      Parameters:
      vFile - The VFile.
      Returns:
      The FileInfo of the saved file.
    • downloadFile

      public io.vertigo.datastore.filestore.model.VFile downloadFile(io.vertigo.datastore.filestore.model.FileInfoURI fileInfoUri)
      Downloads a file from a given FileInfoURI.
      Parameters:
      fileInfoUri - The FileInfoURI of the file to download.
      Returns:
      The downloaded VFile.
    • getFileInfos

      public List<io.vertigo.ui.core.UiFileInfo> getFileInfos(List<io.vertigo.datastore.filestore.model.FileInfoURI> fileInfoUris)
      Retrieves the list of UiFileInfo from a given list of FileInfoURI.
      Parameters:
      fileInfoUris - The list of FileInfoURI.
      Returns:
      The list of UiFileInfo.
    • getFileInfo

      public io.vertigo.ui.core.UiFileInfo getFileInfo(io.vertigo.datastore.filestore.model.FileInfoURI fileInfoUri)
      Retrieves the UiFileInfo from a given FileInfoURI.
      Parameters:
      fileInfoUri - The FileInfoURI.
      Returns:
      The UiFileInfo
    • getEasyFormRead

      public EasyFormsDataRead getEasyFormRead(EasyFormsTemplate easyFormsTemplate, EasyFormsData easyForm, Map<String,Serializable> context, boolean addEmptyFields)
      Retrieves the read form of an EasyForm from a given template and data.
      Parameters:
      easyFormsTemplate - The form template.
      easyForm - The form data.
      context - The context values.
      addEmptyFields - Whether to add empty fields.
      Returns:
      The read form of the EasyForm. We uses a LinkedHashMap to keep the order of the fields.
    • resolveCtxName

      public Optional<String> resolveCtxName(String listSupplier)
      Resolves the context name from a given list supplier.
      Parameters:
      listSupplier - The list supplier.
      Returns:
      The context name, if it can be resolved.