Interface IFormReplacerParams

All Superinterfaces:
ILanguageTagProviding, IReplacerParams, Serializable
All Known Subinterfaces:
IPlaceholderValueParams
All Known Implementing Classes:
DefaultReplacerParameters

public interface IFormReplacerParams extends IReplacerParams, ILanguageTagProviding
Author:
XIMA MEDIA GmbH
  • Method Details

    • getClient

      Mandant getClient()
      Returns:
      The current client scope.
    • getRepetitionContainer

      @Deprecated default IRepetitionContainer getRepetitionContainer()
      Deprecated.
      Implement / use getFieldRepetitions().
      See getFieldRepetitions() for more details.
      Returns:
      The repetition context where the replacement is made. May be null.
    • getFieldRepetitions

      default Map<String,Integer> getFieldRepetitions()
      When a form element placeholder is replaced and the form element is repeated, all repeated values are joined with a comma by default and used as the replacement value. When a repetition container is given as the context for the replacement and the form element is inside the same repetition container, only the value at the given index gets used.

      For example, let's say we have a form with the following elements:

      • ed1
      • fs1 (repeated field set with the following elements)
        • tf1
        • tf2
      • fs2 (repeated field set with the following elements)
        • upl1
        • upl2
      Let's also say we have two repetitions for each field set, and the form elements have the value valTf1_1, valTf1_2, valTf2_1, valTf1_2, valUpl1_1, valUpl1_2, valUpl2_1, valUpl2_2.

      Now when we have the placeholder [%ed1%] [%tf1%] [%upl2%], it is replaced by valEd1_valTf1_1,valTf1_2 valUpl2_1,valUpl2_2 by default.

      But if we are making the replacement within the context of upl2, e.g. when that placeholder is used to compute the file name for upl2, we want to use only the value of the current repetition for upl2, not a values joined with a comma.

      To do this, we can set the field repetitions to (name="upl2", index=0). Then the placeholder evaluates to valEd1_valTf1_1,valTf1_2 valUpl2_1. If we set the repetitions to (name="upl1", index=1) instead, the placeholder evaluates to valEd1_valTf1_1,valTf1_2 valUpl2_2.

      When this logic should be applied to all items in a repeated container, this method may return just that container. If this logic should be applied only to some items of a repeated container, those items must be returned individually. When multiple of the returned containers match, the first is used. Note however, that if you return a container within a repeated container, the children of the inner (non-repeated) container are not resolved automatically.

      Returns:
      The repetition context where the replacement is made. A mapping between the name of a form element and the repetition index for that form element or container.
    • getEscaper

      default IPlaceholderEscaper getEscaper()
      Description copied from interface: IReplacerParams
      The placeholder escaper, which should applied for the replaced placeholder values before they returned to the document
      Specified by:
      getEscaper in interface IReplacerParams
      Returns:
      an instance of IPlaceholderEscaper
    • getLanguageTag

      default String getLanguageTag()
      Specified by:
      getLanguageTag in interface ILanguageTagProviding
      Returns:
      The language tag (Locale.toLanguageTag()) provided by this object.
    • getFormData

      IFormDataAdapter getFormData()
      Returns:
      The form data adapter with the data from the curren form record context, if any, for which the placeholder replacement is performed.
    • getFormVersion

      FormVersion getFormVersion()
      Returns:
      The form version context, if any, for which the placeholder replacement is performed.
    • getXForm

      default IXForm getXForm()
      Gets the descriptor of the form (as configured in the form designer), if a form context is available.
      Returns:
      The form description.
      Since:
      8.4.1
    • getProcess

      Vorgang getProcess()
      Returns:
      The form record context, if any, for which the placeholder replacement is performed.
    • isEncodeForHTML

      @Deprecated boolean isEncodeForHTML()
      Deprecated.
      Returns:
      Use getEscaper().
    • isEncodeFormValuesForPlaceholder

      default boolean isEncodeFormValuesForPlaceholder()
      Specified by:
      isEncodeFormValuesForPlaceholder in interface IReplacerParams
    • setFormData

      @Deprecated void setFormData(IFormDataAdapter formData)
      Deprecated.
      This interface should not allow for modification. Use whatever mechanism you like to fill in the data in your implementing class.
      Parameters:
      formData - New form data to use.
    • isReplaceFormPlaceholders

      default boolean isReplaceFormPlaceholders()
      Returns:
      When false, form placeholders must not be processed at all.
    • getFormValuePostProcessors

      default List<IFormValuePostProcessor> getFormValuePostProcessors()
      Gets the optional list of post processors that can be used to modify the form values after they have been resolved, but before they are converted to the result of the placeholder replacement operation. Could be used, for example, to parse strings as numbers and convert them to the default number format.
      Returns:
      The list of post processors or null if none.