Interface IPluginFormElementCatalogue

  • All Superinterfaces:
    IFCPlugin, INamedUiElement, INameProviding, ITransferable, Serializable

    public interface IPluginFormElementCatalogue
    extends IFCPlugin
    Interface for plugins that may add a set of form items to the designer. Each catalog plugin may provide one or many catalogs, each catalogs consist of one or more form items. The available catalogs and form items are shown in the designer in the catalog tab of the element panel to the left.
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getCatalogueData

        com.alibaba.fastjson.JSONArray getCatalogueData​(String catalogId,
                                                        Locale locale)
        This methods should return all catalog form items contained in the given catalog. Each item must contain the following keys:
        className
        The type of the form element, e.g. XFooter, XHeader, XPage, XContainer, XFieldSet, XSpan, XTextField, XTextArea, XSelect, XButtonList, XCheckbox, XImage, XLine, XSpacer, or XUpload
        properties
        A JSON object with the properties of the item. The key is one of the possible values defined in Enum.name()
        The following properties should be present at the very least:
        use_name_idx
        Optional boolean flag. When true and a new item is created, the name of the item includes an incremental index, such as tf1, tf2 etc.

        In addition, each form item should also have more properties dependent of the type of form item (className). See IXItemBasic.getAvailableProperties(Locale) for a list of properties required for each item type, e.g. XButtonList.getAvailableProperties(Locale) or XTextField.getAvailableProperties(Locale).

        You can also see which keys are used by existing FORMCYCLE form item types by opening the designer in a browser. Open the developer tools and inspect the following JavaScript object:

         window.designer.config.xitemdesc
         
        To see the values the properties of an existing form item, inspect the following JavaScript object.
         window.designer.items["<item-id>"]
         
        You can find the ID of a form item by inspecting xi attribute of the HTML container element with the class xm-item-div. For example, the first input field added to a new form will have the ID xi-tf-1.
        Parameters:
        catalogId - An catalog ID, as returned by getCatalogueList(Locale).
        locale - The locale for which the catalog should be returned. May be used for locale-specific catalogs.
        Returns:
        An array of catalog form items contained in the given catalog.
      • getCatalogueList

        com.alibaba.fastjson.JSONArray getCatalogueList​(Locale locale)
        This methods should return a list of all available form catalogs. Each catalog descriptor is a JSONObject with the following properties:
        id
        A unique ID for the catalog, which must not depend on the given locale.
        name
        A human-readable name of the catalog, which may depend on the given locale.
        Parameters:
        locale - The current locale for which the list of catalogs is shown. The name of the catalog may depend on this locale.
        Returns:
        A List of available catalogs.
      • getCatalogueName

        String getCatalogueName​(Locale locale)
        Parameters:
        locale - The current locale for which this catalog plugin is shown.
        Returns:
        The name of this catalog plugin.
      • getId

        String getId()
        Returns:
        The ID of this catalog plugin.