Package de.xima.fc.form
Class FormHelper
- java.lang.Object
- 
- de.xima.fc.form.FormHelper
 
- 
 public class FormHelper extends Object Class for different helper-methods for the usage with forms- Author:
- XIMA MEDIA GmbH
 
- 
- 
Constructor SummaryConstructors Constructor Description FormHelper()
 - 
Method Summary
 
- 
- 
- 
Method Detail- 
buildXFormpublic static IXForm buildXForm(IFormRenderContext renderCtx) throws com.alibaba.fastjson.JSONException, IOException - Throws:
- com.alibaba.fastjson.JSONException
- IOException
 
 - 
buildXFormConfigpublic static IXFormRenderConfig buildXFormConfig(IFormRenderContext renderCtx) throws IOException - Throws:
- IOException
 
 - 
renderAsString@Deprecated public static String renderAsString(IXForm form, IXFormRenderConfig config, Map<String,List<String[]>> valuesMap) throws com.alibaba.fastjson.JSONException, IOException Deprecated.- Throws:
- com.alibaba.fastjson.JSONException
- IOException
 
 - 
renderAsStringpublic static String renderAsString(IXForm form, IXFormRenderConfig config, Map<String,List<String[]>> valuesMap, Map<String,FormContainerMetaData> dynContainerMap) throws com.alibaba.fastjson.JSONException, IOException - Throws:
- com.alibaba.fastjson.JSONException
- IOException
 
 - 
renderToRequestContext@Deprecated public static void renderToRequestContext(IXForm form, IXFormRenderConfig config, Map<String,List<String[]>> valuesMap, IExtendedFormRequestContext requestCtx) 
 - 
renderToRequestContextpublic static void renderToRequestContext(IXForm form, IXFormRenderConfig config, Map<String,List<String[]>> valuesMap, Map<String,FormContainerMetaData> dynContainerMap, IExtendedFormRequestContext requestCtx) 
 - 
renderToRequestResponse@Deprecated public static void renderToRequestResponse(IXForm form, IXFormRenderConfig config, IXFormRenderContext formRenderContext, Map<String,List<String[]>> valuesMap, javax.servlet.http.HttpServletResponse response) throws com.alibaba.fastjson.JSONException Deprecated.- Throws:
- com.alibaba.fastjson.JSONException
 
 - 
renderToRequestResponsepublic static void renderToRequestResponse(IXForm form, IXFormRenderConfig config, IXFormRenderContext formRenderContext, Map<String,List<String[]>> valuesMap, Map<String,FormContainerMetaData> dynContainerMap, javax.servlet.http.HttpServletResponse response) throws com.alibaba.fastjson.JSONException - Throws:
- com.alibaba.fastjson.JSONException
 
 - 
renderAsStringpublic static String renderAsString(IXForm form, IXFormRenderConfig config, IXFormRenderContext formRenderCtx) throws com.alibaba.fastjson.JSONException, IOException - Throws:
- com.alibaba.fastjson.JSONException
- IOException
 
 - 
renderToRequestContext@Deprecated public static void renderToRequestContext(IXForm form, IXFormRenderConfig config, IExtendedFormRequestContext requestCtx, Map<String,List<String[]>> values) 
 - 
renderToRequestContextpublic static void renderToRequestContext(IXForm form, IXFormRenderConfig config, IExtendedFormRequestContext requestCtx, Map<String,List<String[]>> values, Map<String,FormContainerMetaData> dynContainerMap) 
 - 
renderToRequestContextpublic static void renderToRequestContext(IXForm form, IXFormRenderConfig config, IExtendedFormRequestContext requestCtx) 
 - 
renderToRequestResponsepublic static void renderToRequestResponse(IXForm form, IXFormRenderConfig config, IXFormRenderContext formRenderCtx, javax.servlet.http.HttpServletResponse response) throws com.alibaba.fastjson.JSONException - Throws:
- com.alibaba.fastjson.JSONException
 
 - 
getFormElementWidgetPluginpublic static IPluginFormElementWidget getFormElementWidgetPlugin(Mandant client, String pluginName) 
 - 
getFormElementWidgetPluginspublic static Map<String,IPluginFormElementWidget> getFormElementWidgetPlugins(Mandant client) 
 - 
getWidgetFormItemspublic static Map<String,IXItemBasic> getWidgetFormItems(Mandant client) Reads all widget plugins from the system scope and from the given client scope, and returns a map of all widgets provided by these plugins. The key of the map is the class name of the widget, e.g.XMaporXRating.- Parameters:
- client- Client scope in which to look for plugin,- nullto only search the system scope.
- Returns:
- A map of all plugin widgets, indexed by their class name.
- Since:
- 8.1.0
 
 - 
getWidgetFormItemspublic 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. XMaporXRating.- Parameters:
- clientUuid- Client scope in which to look for plugins,- nullto only search the system scope.
- Returns:
- A map of all form items provided by plugins, indexed by their class name.
- Since:
- 8.1.0
 
 - 
getBuiltinFieldNameConventionspublic static Map<String,IXItemFieldNameConventions> getBuiltinFieldNameConventions() Gets allIXItemFieldNameConventionsfor builtin form item types.The key of the map is the class name of the widget form item, e.g. XMaporXRating.- Returns:
- A map of all name conventions for builtin form items, indexed by their class name.
- Since:
- 8.1.0
 
 - 
getWidgetFieldNameConventionspublic 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 theIXItemFieldNameConventionsfor the widgets provided by these plugins.The key of the map is the class name of the widget form item, e.g. XMaporXRating.- Parameters:
- clientUuid- Client scope in which to look for plugins,- nullto 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
 
 - 
getAllFieldNameConventionspublic static Map<String,IXItemFieldNameConventions> getAllFieldNameConventions(UUID clientUuid) Gets allIXItemFieldNameConventionsfor the builtin widgets and widgets provided by plugins.The key of the map is the class name of the widget form item, e.g. XMaporXRating.- Parameters:
- clientUuid- Client scope in which to look for plugins,- nullto 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
 
 - 
getBuiltinFormItemspublic 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. XTextFieldorXSpan.- Returns:
- A map of all builtin form items, indexed by their class name.
- Since:
- 8.1.0
 
 - 
getFormElementWidgetPluginsWithInstanceTimepublic static Map<String,org.apache.commons.lang3.tuple.Pair<IPluginFormElementWidget,Long>> getFormElementWidgetPluginsWithInstanceTime(Mandant client) 
 - 
buildXFormJSON@Deprecated public static com.alibaba.fastjson.JSONObject buildXFormJSON(FormRenderContext renderCtx) throws IOException, com.alibaba.fastjson.JSONException Deprecated.- Throws:
- IOException
- com.alibaba.fastjson.JSONException
 
 - 
clearUploadspublic static void clearUploads(IXForm xForm, IXFormRenderConfig config, IExtendedFormRequestContext requestCtx, Map<String,List<String[]>> values) 
 - 
validateFD2Formpublic static boolean validateFD2Form(IXForm xForm, IXFormRenderConfig config, IExtendedFormRequestContext requestCtx) 
 - 
validateFD2Formpublic static boolean validateFD2Form(IXForm xForm, IXFormRenderConfig config, IExtendedFormRequestContext requestCtx, IFormRenderContext renderCtx) 
 - 
createClientResourceUrlpublic static String createClientResourceUrl(IFormRenderContext renderCtx, IXFormRenderConfig xformConfig, MandantRessource res) - Parameters:
- renderCtx- Form render context with the current client.
- xformConfig- Form render config with the base include URL
- res- Resource for which to create the URL.
- Returns:
- The URL for the given client resource that can be used in web forms.
 
 - 
createFieldFilterpublic static Predicate<String> createFieldFilter(FRQSession frqSession) Creates the filter for request values. The returned predicate takes the name of a request value (e.g.tf1orxfc-pp-inline) and returnsfalsewhen the server should not accept and discard the value. The filter checks for example the availability conditions and disabled conditions of form fields (e.g. when a form field is unavailable in a certain state or for a certain user group).- Parameters:
- frqSession- Current form request session.
- Returns:
- A predicate for deciding whether a request value with a given name should be accepted or discarded.
 
 - 
createProjectResourceUrlpublic static String createProjectResourceUrl(IFormRenderContext renderCtx, IXFormRenderConfig xformConfig, ProjektRessource res) - Parameters:
- renderCtx- Form render context with the current project.
- xformConfig- Form render config with the base include URL.
- res- Resource for which to create the URL.
- Returns:
- The URL for the given project resource that can be used in web forms.
 
 - 
createWidgetResourceUrlpublic static String createWidgetResourceUrl(IFormRenderContext renderCtx, IXFormRenderConfig xformConfig, XItemWidgetWrapper wrapper, IXItemWidget widget) - Parameters:
- renderCtx- Form render context with the current project.
- xformConfig- Form render config with the base include URL.
- wrapper- Wrapper for the widget.
- widget- Widget instance with a CSS resource for which to create a URL.
- Returns:
- The URL for the given widget CSS resource that can be used in web forms.
 
 - 
getFormDesignerResourcePluginpublic static IPluginFormDesignerResource getFormDesignerResourcePlugin(Mandant client, String pluginName) 
 - 
getFormDesignerResourcePluginspublic static Map<String,IPluginFormDesignerResource> getFormDesignerResourcePlugins(Mandant client) 
 - 
getFormDesignerResourcePluginsWithInstanceTimepublic static Map<String,org.apache.commons.lang3.tuple.Pair<IPluginFormDesignerResource,Long>> getFormDesignerResourcePluginsWithInstanceTime(Mandant client) 
 - 
createPluginResourceUrlpublic static String createPluginResourceUrl(IFormRenderContext renderCtx, IXFormRenderConfig xformConfig, IFormResource res, boolean useSystemPlugins) - Parameters:
- renderCtx- Form render context with the current client.
- xformConfig- Form render config with the base include URL
- res- Resource for which to create the URL.
- useSystemPlugins- Whether the resource was obtained from a system or client plugin.
- Returns:
- The URL for the given client resource that can be used in web forms.
 
 
- 
 
-