Class WidgetPluginHelper


  • public final class WidgetPluginHelper
    extends Object
    Utilities for handling widget plugins in the form designer, see FormDesignerPluginBean.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • createPluginCssFontFaceInfoStreamedContentForResource

        public static org.primefaces.model.StreamedContent createPluginCssFontFaceInfoStreamedContentForResource​(long clientId,
                                                                                                                 String pluginName,
                                                                                                                 String languageTag,
                                                                                                                 boolean devMode)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        Returns:
        The font face info for the CSS of the given resource plugin, used by the designer to extract those styles from the shadow DOM to the outside.
      • createPluginCssFontFaceInfoStreamedContentForWidget

        public static org.primefaces.model.StreamedContent createPluginCssFontFaceInfoStreamedContentForWidget​(long clientId,
                                                                                                               String pluginName)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        Returns:
        The font face info for the CSS of the given widget plugin, used by the designer to extract those styles from the shadow DOM to the outside.
      • createPluginCssForDesignerUiStreamedContentForResource

        public static org.primefaces.model.StreamedContent createPluginCssForDesignerUiStreamedContentForResource​(long clientId,
                                                                                                                  String pluginName,
                                                                                                                  String languageTag,
                                                                                                                  boolean devMode)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        languageTag - Requested language tag.
        devMode - Whether to get the dev resource.
        Returns:
        The CSS for the designer UI required by widget plugin for the given client.
      • createPluginCssForDesignerUiStreamedContentForWidget

        public static org.primefaces.model.StreamedContent createPluginCssForDesignerUiStreamedContentForWidget​(long clientId,
                                                                                                                String pluginName)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        Returns:
        The CSS for the designer UI required by widget plugin for the given client.
      • createPluginCssForDesignerUiUrls

        public static List<String> createPluginCssForDesignerUiUrls​(javax.faces.context.FacesContext context,
                                                                    Mandant client,
                                                                    String conversationId)
        Parameters:
        context - Current faces context.
        client - Client who owns the form currently opened in the designer.
        conversationId - Current designer conversation ID.
        Returns:
        The URL for the resource that serves the CSS for the designer UI required by widget plugins.
      • createPluginCssStreamedContentForResource

        public static org.primefaces.model.StreamedContent createPluginCssStreamedContentForResource​(long clientId,
                                                                                                     String pluginName,
                                                                                                     String languageTag,
                                                                                                     boolean devMode)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        languageTag - Requested language tag.
        devMode - Whether to get the dev resource.
        Returns:
        The CSS for the form within the designer required by a resource plugin from the given client.
      • createPluginCssStreamedContentForWidget

        public static org.primefaces.model.StreamedContent createPluginCssStreamedContentForWidget​(long clientId,
                                                                                                   String pluginName)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        Returns:
        The CSS for the form within the designer required by a widget plugin from the given client.
      • createPluginCssUrls

        public static List<CssWithFontFacesInfo> createPluginCssUrls​(javax.faces.context.FacesContext context,
                                                                     Mandant client,
                                                                     String conversationId)
        Parameters:
        context - Current faces context.
        client - Client who owns the form currently opened in the designer.
        conversationId - Current designer conversation ID.
        Returns:
        The URL for the resource that serves the CSS for the form within the designer required by widget plugins.
      • createPluginData

        public static com.alibaba.fastjson.JSONObject createPluginData​(IFormDesignerEnvironmentData environmentData)
        Reads the plugins that provide additional runtime data and returns a JSON object with all runtime data.
        Parameters:
        environmentData - Data with the current project, client etc.
        Returns:
        The JSON object with the runtime data of all form element widgets for the given client from the params.
      • createPluginJavaScriptStreamedContentForResource

        public static org.primefaces.model.StreamedContent createPluginJavaScriptStreamedContentForResource​(long clientId,
                                                                                                            String pluginName,
                                                                                                            String languageTag,
                                                                                                            boolean devMode)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        languageTag - Requested language tag.
        devMode - Whether to get the dev resource.
        Returns:
        The JavaScript required by a resource plugin for the given client.
      • createPluginJavaScriptStreamedContentForWidget

        public static org.primefaces.model.StreamedContent createPluginJavaScriptStreamedContentForWidget​(long clientId,
                                                                                                          String pluginName)
        Parameters:
        clientId - ID of the client who owns the form currently opened in the designer.
        pluginName - Name of the widget plugin.
        Returns:
        The JavaScript required by a widget plugin for the given client.
      • createPluginJavaScriptUrls

        public static List<String> createPluginJavaScriptUrls​(javax.faces.context.FacesContext context,
                                                              Mandant client,
                                                              String conversationId)
        Parameters:
        context - Current faces context.
        client - Client who owns the form currently opened in the designer.
        conversationId - Current designer conversation ID.
        Returns:
        The URL for the resource that serves the JavaScript required by widget plugins.