Class FormRepetitionContextHelper


  • public final class FormRepetitionContextHelper
    extends Object
    Helper for repeated form fields.
    Since:
    8.2.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getAllFieldNameConventions

        public static Map<String,​IXItemFieldNameConventions> getAllFieldNameConventions​(UUID clientUuid)
        Gets all IXItemFieldNameConventions for the builtin widgets and widgets provided by plugins.

        The key of the map is the class name of the widget form item, e.g. XMap or XRating.

        Parameters:
        clientUuid - Client scope in which to look for plugins, null to only search the system scope.
        Returns:
        A map of all name conventions for builtin form items and form items provided by widgets, indexed by their class name.
        Since:
        8.1.0
      • getBuiltinFieldNameConventions

        public static Map<String,​IXItemFieldNameConventions> getBuiltinFieldNameConventions()
        Gets all IXItemFieldNameConventions for builtin form item types.

        The key of the map is the class name of the widget form item, e.g. XMap or XRating.

        Returns:
        A map of all name conventions for builtin form items, indexed by their class name.
        Since:
        8.1.0
      • getBuiltinFormItems

        public static Map<String,​IXItemBasic> getBuiltinFormItems()
        Returns a map of all builtin form items provided by the formcycle core, such as text fields and text areas.

        The key of the map is the class name of the widget form item, e.g. XTextField or XSpan .

        Returns:
        A map of all builtin form items, indexed by their class name.
        Since:
        8.1.0
      • getFormItems

        public static Map<String,​IXItemBasic> getFormItems​(UUID clientUuid)
        Returns a map of all form items, including builtins provided by the formcycle core (e.g. text fields and text areas), and widgets provided by plugins.

        The key of the map is the class name of the widget form item, e.g. XTextField or XSpan .

        Parameters:
        clientUuid - Client scope in which to look for plugins, null to only search the system scope.
        Returns:
        A map of all builtin and widget form items, indexed by their class name.
        Since:
        8.2.0
      • getWidgetFieldNameConventions

        public static Map<String,​IXItemFieldNameConventions> getWidgetFieldNameConventions​(UUID clientUuid)
        Reads all widget plugins from the system scope and from the given client scope, and returns a map with the IXItemFieldNameConventions for the widgets provided by these plugins.

        The key of the map is the class name of the widget form item, e.g. XMap or XRating.

        Parameters:
        clientUuid - Client scope in which to look for plugins, null to only search the system scope.
        Returns:
        A map of all name conventions for form items provided by widgets, indexed by their class name.
        Since:
        8.1.0
      • getWidgetFormItems

        public static Map<String,​IXItemBasic> getWidgetFormItems​(UUID clientUuid)
        Reads all widget plugins from the system scope and from the given client scope, and returns a map of all form items provided by these plugins.

        The key of the map is the class name of the widget form item, e.g. XMap or XRating.

        Parameters:
        clientUuid - Client scope in which to look for plugins, null to only search the system scope.
        Returns:
        A map of all form items provided by plugins, indexed by their class name.
        Since:
        8.1.0
      • resolveValuesAgainstRepetitionContext

        public static List<String[]> resolveValuesAgainstRepetitionContext​(List<String[]> values,
                                                                           IFormDataAdapter formData,
                                                                           String name,
                                                                           Map<String,​Integer> fieldRepetitions,
                                                                           UUID clientUuid)
        Resolves the values to a particular repetition context, if possible.
        Parameters:
        values - All values of the form field.
        formData - Form data adapter with all values.
        name - Name of the form field.
        fieldRepetitions - Mapping from the name of a repeated container to the 0-based repetition index to use for that container.
        clientUuid - UUID of the client to which the form belongs. Used to resolve widget plugins.
        Returns:
        The given values, limited to the repetition index as indicated by the given map.
        Since:
        8.2.0