Package de.xima.fc.form.common.models
Class XForm
- java.lang.Object
-
- de.xima.fc.form.common.models.XForm
-
- All Implemented Interfaces:
IXForm
,Serializable
,Cloneable
public class XForm extends Object implements IXForm, Cloneable
Diese Klasse kapselt das Formular-Persist, ermöglicht es dieses mit Werten zu befüllen, zu validieren und entsprechend zu rendern.- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Method Summary
-
-
-
Constructor Detail
-
XForm
public XForm()
Creates an empty form with no form elements.
-
XForm
public XForm(com.alibaba.fastjson.JSONObject persist) throws com.alibaba.fastjson.JSONException
Konstruktor mit Formularwerten und Render-Konfiguration- Parameters:
persist
- das Persistance-Objekt des Formulars- Throws:
com.alibaba.fastjson.JSONException
- When the persist contains an invalid data structure.
-
-
Method Detail
-
setXItems
public void setXItems(LinkedHashMap<String,XItem> xItems)
-
getHiddenInputParameter
public Map<String,String> getHiddenInputParameter()
- Specified by:
getHiddenInputParameter
in interfaceIXForm
-
setHiddenInputParameter
public void setHiddenInputParameter(Map<String,String> hiddenInputParameter)
- Specified by:
setHiddenInputParameter
in interfaceIXForm
-
addHiddenInputParameter
public void addHiddenInputParameter(String key, String value)
- Specified by:
addHiddenInputParameter
in interfaceIXForm
-
getServerValItems
public List<String> getServerValItems()
- Specified by:
getServerValItems
in interfaceIXForm
-
getReadOnlyCondItems
public List<String> getReadOnlyCondItems()
- Specified by:
getReadOnlyCondItems
in interfaceIXForm
-
getRenderCondItems
public List<String> getRenderCondItems()
- Specified by:
getRenderCondItems
in interfaceIXForm
-
setServerValItems
public void setServerValItems(List<String> serverValItems)
- Specified by:
setServerValItems
in interfaceIXForm
-
setReadOnlyCondItems
public void setReadOnlyCondItems(List<String> readOnlyCondItems)
- Specified by:
setReadOnlyCondItems
in interfaceIXForm
-
setRenderCondItems
public void setRenderCondItems(List<String> renderCondItems)
- Specified by:
setRenderCondItems
in interfaceIXForm
-
getParentItemMap
@Deprecated public LinkedHashMap<String,String> getParentItemMap()
Deprecated.- Specified by:
getParentItemMap
in interfaceIXForm
- Returns:
- Map from the ID of a form item to the ID of its parent (if any).
-
getParentIdMap
public Map<String,String> getParentIdMap()
- Specified by:
getParentIdMap
in interfaceIXForm
- Returns:
- Map from the ID of a form item to the ID of its parent (if any).
-
setParentIdMap
public void setParentIdMap(Map<String,String> parentItemMap)
- Specified by:
setParentIdMap
in interfaceIXForm
- Parameters:
parentItemMap
- Map from the ID of a form item to the ID of its parent (if any).
-
setParentItemMap
@Deprecated public void setParentItemMap(LinkedHashMap<String,String> parentItemMap)
Deprecated.- Specified by:
setParentItemMap
in interfaceIXForm
- Parameters:
parentItemMap
- Map from the ID of a form item to the ID of its parent (if any).
-
isShowLogo
public boolean isShowLogo()
- Specified by:
isShowLogo
in interfaceIXForm
-
getVersion
public com.alibaba.fastjson.JSONObject getVersion()
- Specified by:
getVersion
in interfaceIXForm
-
getVariables
public com.alibaba.fastjson.JSONArray getVariables()
Description copied from interface:IXForm
Retrieves the list of all variables (hidden input fields) that are present in the form. Each variable is a JSON object with the following properties:- aliasname - Alias of the variable, which can be used e.g. in placeholders instead of the name and allows all characters.
- name - The name of the variable, which is also the name of the hidden input field. It only allows certain characters (digits, letters, underscore)
- serveronly - Whether the variable exists only on the server.
- value - The default value of the variable.
- Specified by:
getVariables
in interfaceIXForm
- Returns:
- A list of all variables.
-
getMetaData
public String getMetaData()
- Specified by:
getMetaData
in interfaceIXForm
-
getUserCSS
public String getUserCSS()
- Specified by:
getUserCSS
in interfaceIXForm
-
clone
public XForm clone() throws CloneNotSupportedException
- Specified by:
clone
in interfaceIXForm
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getFormI18N
public com.alibaba.fastjson.JSONObject getFormI18N()
- Specified by:
getFormI18N
in interfaceIXForm
-
getFormProperties
public XFormProperties getFormProperties()
- Specified by:
getFormProperties
in interfaceIXForm
-
getxItems
@Deprecated public Map<String,XItem> getxItems()
Deprecated.usegetXItems()
-
setxItems
@Deprecated public void setxItems(LinkedHashMap<String,XItem> xItems)
Deprecated.
-
isResponsive
@Deprecated public boolean isResponsive()
Deprecated.- Specified by:
isResponsive
in interfaceIXForm
-
isUseModernTheme
@Deprecated public boolean isUseModernTheme()
Deprecated.- Specified by:
isUseModernTheme
in interfaceIXForm
- Returns:
true
to use the modern CSS theme,false
to not use it.
-
isPrevReplacement
@Deprecated public boolean isPrevReplacement()
Deprecated.- Specified by:
isPrevReplacement
in interfaceIXForm
- Returns:
- Whether to replace placeholders with their values in the preview.
-
getMaxSize
@Deprecated public String getMaxSize()
Deprecated.- Specified by:
getMaxSize
in interfaceIXForm
- Returns:
- Maximum width of the form, as a CSS unit with "px".
-
getMinSize
@Deprecated public String getMinSize()
Deprecated.- Specified by:
getMinSize
in interfaceIXForm
- Returns:
- Minimum width of the form, as a CSS unit with "px".
-
getResponseSize
@Deprecated public String getResponseSize()
Deprecated.- Specified by:
getResponseSize
in interfaceIXForm
- Returns:
- Responsive width of the form, as a CSS unit with "px".
-
getErrorStyle
@Deprecated public String getErrorStyle()
Deprecated.- Specified by:
getErrorStyle
in interfaceIXForm
- Returns:
- Style class to apply to the form, which controls how validation errors are displayed.
-
isAttributeW3CMode
@Deprecated public boolean isAttributeW3CMode()
Deprecated.- Specified by:
isAttributeW3CMode
in interfaceIXForm
- Returns:
true
to use only attributes allowed by the W3C spec,false
to use the legacy mode.
-
isElementClassNameMode
@Deprecated public boolean isElementClassNameMode()
Deprecated.- Specified by:
isElementClassNameMode
in interfaceIXForm
- Returns:
true
when the name of the element should be added as a CSS style class,false
otherwise.
-
isValidateSubmitAction
@Deprecated public boolean isValidateSubmitAction()
Deprecated.- Specified by:
isValidateSubmitAction
in interfaceIXForm
- Returns:
true
when submit buttons should be validated to ensure only existing buttons are pressed.
-
isLegacyUseOptionTextForAutocomplete
@Deprecated public boolean isLegacyUseOptionTextForAutocomplete()
Deprecated.- Specified by:
isLegacyUseOptionTextForAutocomplete
in interfaceIXForm
- Returns:
- In versions [7.0.0, 7.4.0) of formcycle there was a bug for autocomplete select fields, where the option text instead of the option was used instead of its value when evaluating conditions. This flag enables this legacy behavior.
-
-