Class FormElement
java.lang.Object
com.appiancorp.suiteapi.process.forms.FormElement
- All Implemented Interfaces:
DeepCloneable
,JSONable
,JSONCacheable
,XMLable
,Serializable
,Cloneable
public class FormElement
extends Object
implements XMLable, JSONCacheable, DeepCloneable, Serializable
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant for element type Buttonstatic final int
Constant for element type Checkboxstatic final int
Constant for element type Community Pickerstatic final int
Constant for element type Content Pickerstatic final int
Constant for element type Datestatic final int
Constant for element type Date Timestatic final int
Constant for element type Document Pickerstatic final int
Constant for element type Doublestatic final int
Constant for element type Dropdownstatic final int
Constant for element of type Email Recipientstatic final int
Constant for element of type Email Recipientstatic final int
Constant for element type Folder Pickerstatic final int
Constant for layout of type Formstatic final int
Constant for element type Forum Pickerstatic final int
Constant for element type Group Pickerstatic final int
Constant for element type Hiddenstatic final int
Constant for element type HTML Areastatic final int
Constant for element type KC Pickerstatic final int
Constant for element type Labelstatic final int
Constant for element type Local Filestatic final int
Constant for element type Longstatic final int
Constant for element type Message Pickerstatic final int
Constant for element type Page Pickerstatic final int
Constant for element of type Paragraphsstatic final int
Constant for element type Passwordstatic final int
Constant for element type People Pickerstatic final int
Constant for element of type Process Modelstatic final int
Constant for element of type Processstatic final int
Constant for element type Radiostatic final int
Constant for layout of type Tabsstatic final int
Constant for element type Textstatic final int
Constant for element type Text Areastatic final int
Constant for element type Thread Pickerstatic final int
Constant for element type Timestatic final int
Constant for element type User Pickerprotected static final org.apache.log4j.Logger
Fields inherited from interface com.appiancorp.suiteapi.common.JSONable
hiddenAttributes$TRANSIENT
Fields inherited from interface com.appiancorp.suiteapi.common.XMLable
DEFAULT_BUFFER_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
addExpression
(TypedVariable expression_) clone()
Clone this object.static FormElement
Creates a form element from xmlstatic FormElement
fromXML
(Node feNode, FormElement.InferFormElementCallback callback) getExpression
(int index_) int
Returns aTypedVariable[]
of expressions.getExtra()
Gets the JSON representation of the FE this bean represents.boolean
Get if the form element is hiddenReturns the set of attributes (properties) that should not be included in the JSON representation of the object.Gets the instructions for the form elementgetLabel()
Gets the label for the form elementGet the acp or process parameter the form element is mapped toint
If the form element is mapped to a bean array, gets the index in the bean array the form element is mapped toIf the mappedTo is a bean array, gets the bean array that the form element is mapped toboolean
Gets if the form element allows multiple entriesboolean
Gets whether the form element is mutablegetName()
Gets the nameOption[]
Gets the form element optionsDetermines the pickerType to be used as the picker for this element.boolean
Gets if the form element is requiredint
getType()
Gets the form element typeDetermines the name of the type of input widget that should be used to render this element based on the _type property.getValue()
Gets the valueboolean
boolean
Whether the form element type has optionsvoid
setExpressions
(TypedVariable[] expressions_) Sets aTypedVariable[]
of expressions.void
Sets the JSON representation of the FE this bean represents.void
setHidden
(boolean hidden_) Sets if the form element is hiddenvoid
setInstructions
(String instructions_) Sets the instructions for the form elementvoid
Sets the label for the form elementvoid
setMappedTo
(String mappedTo_) Sets what the acp or process parameter the form element is mapped tovoid
setMappedToArrayIndex
(int mappedToArrayIndex_) Sets the index in a bean array that the form element is mapped tovoid
setMappedToBeanArray
(String mappedToBeanArray_) Sets the bean array that the form element is mapped tovoid
setMultiple
(boolean multiple_) Sets if the form element allows multiple entriesvoid
setMutable
(boolean mutable_) Sets whether the form element is mutablevoid
Sets the namevoid
setOptions
(Option[] options_) Sets the form element optionsvoid
setRequired
(boolean required_) Sets if the form element is requiredvoid
setType
(int type_) Sets the form element typevoid
Sets the valuetoString()
toXML()
Converts the form element to xmlvoid
toXML
(StringBuilder buffer_) Converts the form element to xml
-
Field Details
-
LOG
protected static final org.apache.log4j.Logger LOG -
ELEMENT_TYPE_LONG
public static final int ELEMENT_TYPE_LONGConstant for element type Long- See Also:
-
ELEMENT_TYPE_DOUBLE
public static final int ELEMENT_TYPE_DOUBLEConstant for element type Double- See Also:
-
ELEMENT_TYPE_TEXT
public static final int ELEMENT_TYPE_TEXTConstant for element type Text- See Also:
-
ELEMENT_TYPE_TEXTAREA
public static final int ELEMENT_TYPE_TEXTAREAConstant for element type Text Area- See Also:
-
ELEMENT_TYPE_USER_PICKER
public static final int ELEMENT_TYPE_USER_PICKERConstant for element type User Picker- See Also:
-
ELEMENT_TYPE_GROUP_PICKER
public static final int ELEMENT_TYPE_GROUP_PICKERConstant for element type Group Picker- See Also:
-
ELEMENT_TYPE_PEOPLE_PICKER
public static final int ELEMENT_TYPE_PEOPLE_PICKERConstant for element type People Picker- See Also:
-
ELEMENT_TYPE_DATE
public static final int ELEMENT_TYPE_DATEConstant for element type Date- See Also:
-
ELEMENT_TYPE_TIME
public static final int ELEMENT_TYPE_TIMEConstant for element type Time- See Also:
-
ELEMENT_TYPE_DATETIME
public static final int ELEMENT_TYPE_DATETIMEConstant for element type Date Time- See Also:
-
ELEMENT_TYPE_KC_PICKER
public static final int ELEMENT_TYPE_KC_PICKERConstant for element type KC Picker- See Also:
-
ELEMENT_TYPE_FOLDER_PICKER
public static final int ELEMENT_TYPE_FOLDER_PICKERConstant for element type Folder Picker- See Also:
-
ELEMENT_TYPE_DOC_PICKER
public static final int ELEMENT_TYPE_DOC_PICKERConstant for element type Document Picker- See Also:
-
ELEMENT_TYPE_COMMUNITY_PICKER
public static final int ELEMENT_TYPE_COMMUNITY_PICKERConstant for element type Community Picker- See Also:
-
ELEMENT_TYPE_RADIO
public static final int ELEMENT_TYPE_RADIOConstant for element type Radio- See Also:
-
ELEMENT_TYPE_CHECKBOX
public static final int ELEMENT_TYPE_CHECKBOXConstant for element type Checkbox- See Also:
-
ELEMENT_TYPE_DROPDOWN
public static final int ELEMENT_TYPE_DROPDOWNConstant for element type Dropdown- See Also:
-
ELEMENT_TYPE_LABEL
public static final int ELEMENT_TYPE_LABELConstant for element type Label- See Also:
-
ELEMENT_TYPE_FORUM_PICKER
public static final int ELEMENT_TYPE_FORUM_PICKERConstant for element type Forum Picker- See Also:
-
ELEMENT_TYPE_THREAD_PICKER
public static final int ELEMENT_TYPE_THREAD_PICKERConstant for element type Thread Picker- See Also:
-
ELEMENT_TYPE_MESSAGE_PICKER
public static final int ELEMENT_TYPE_MESSAGE_PICKERConstant for element type Message Picker- See Also:
-
ELEMENT_TYPE_LOCAL_FILE
public static final int ELEMENT_TYPE_LOCAL_FILEConstant for element type Local File- See Also:
-
ELEMENT_TYPE_HIDDEN
public static final int ELEMENT_TYPE_HIDDENConstant for element type Hidden- See Also:
-
ELEMENT_TYPE_CONTENT_PICKER
public static final int ELEMENT_TYPE_CONTENT_PICKERConstant for element type Content Picker- See Also:
-
ELEMENT_TYPE_PAGE_PICKER
public static final int ELEMENT_TYPE_PAGE_PICKERConstant for element type Page Picker- See Also:
-
ELEMENT_TYPE_HTMLAREA
public static final int ELEMENT_TYPE_HTMLAREAConstant for element type HTML Area- See Also:
-
ELEMENT_TYPE_BUTTON
public static final int ELEMENT_TYPE_BUTTONConstant for element type Button- See Also:
-
ELEMENT_TYPE_PASSWORD
public static final int ELEMENT_TYPE_PASSWORDConstant for element type Password- See Also:
-
ELEMENT_TYPE_PARAGRAPHS
public static final int ELEMENT_TYPE_PARAGRAPHSConstant for element of type Paragraphs- See Also:
-
ELEMENT_TYPE_EMAIL_ADDRESS
public static final int ELEMENT_TYPE_EMAIL_ADDRESSConstant for element of type Email Recipient- See Also:
-
ELEMENT_TYPE_EMAIL_RECIPIENT_PICKER
public static final int ELEMENT_TYPE_EMAIL_RECIPIENT_PICKERConstant for element of type Email Recipient- See Also:
-
ELEMENT_TYPE_FORM
public static final int ELEMENT_TYPE_FORMConstant for layout of type Form- See Also:
-
ELEMENT_TYPE_TABS
public static final int ELEMENT_TYPE_TABSConstant for layout of type Tabs- See Also:
-
ELEMENT_TYPE_PROCESS_MODEL_PICKER
public static final int ELEMENT_TYPE_PROCESS_MODEL_PICKERConstant for element of type Process Model- See Also:
-
ELEMENT_TYPE_PROCESS_PICKER
public static final int ELEMENT_TYPE_PROCESS_PICKERConstant for element of type Process- See Also:
-
-
Constructor Details
-
FormElement
public FormElement()
-
-
Method Details
-
getHiddenAttributes
Description copied from interface:JSONable
Returns the set of attributes (properties) that should not be included in the JSON representation of the object.- Specified by:
getHiddenAttributes
in interfaceJSONable
- Returns:
- the set of hidden attributes
-
clone
Clone this object.- Specified by:
clone
in interfaceDeepCloneable
- Overrides:
clone
in classObject
- Returns:
-
toString
-
getHidden
public boolean getHidden()Get if the form element is hidden- Returns:
- if the form element is hidden
-
setHidden
public void setHidden(boolean hidden_) Sets if the form element is hidden- Parameters:
hidden_
- whether or not the form element is to be hidden- See Also:
-
getInstructions
Gets the instructions for the form element- Returns:
- the instructions for the form element
-
setInstructions
Sets the instructions for the form element- Parameters:
instructions_
- the instructions to set- See Also:
-
getLabel
Gets the label for the form element- Returns:
- the label for the form element
-
setLabel
Sets the label for the form element- Parameters:
label_
- the label to set- See Also:
-
getMappedTo
Get the acp or process parameter the form element is mapped to- Returns:
- what the form element is mapped to
-
setMappedTo
Sets what the acp or process parameter the form element is mapped to- Parameters:
mappedTo_
- what to set the form element mapping to- See Also:
-
getMultiple
public boolean getMultiple()Gets if the form element allows multiple entries- Returns:
- if the form element allows multiple entires
-
setMultiple
public void setMultiple(boolean multiple_) Sets if the form element allows multiple entries- Parameters:
multiple_
- multiple entry allowance to set- See Also:
-
getMutable
public boolean getMutable()Gets whether the form element is mutable- Returns:
- whether the form element is mutable
-
setMutable
public void setMutable(boolean mutable_) Sets whether the form element is mutable- Parameters:
mutable_
- mutable entry allowance to set- See Also:
-
getName
Gets the name- Returns:
- the name
-
setName
Sets the name- Parameters:
name_
- the name- See Also:
-
getOptions
Gets the form element options- Returns:
- an array of form element
Option
objects
-
setOptions
Sets the form element options- Parameters:
options_
- the options to set for the form element- See Also:
-
getType
public int getType()Gets the form element type- Returns:
- the form element type. See
ELEMENT_TYPE_XXX
in this file for types.
-
setType
public void setType(int type_) Sets the form element type- Parameters:
type_
- the type to set- See Also:
-
getRequired
public boolean getRequired()Gets if the form element is required- Returns:
- whether or not the form element is required
-
setRequired
public void setRequired(boolean required_) Sets if the form element is required- Parameters:
required_
- the entry requirements to set- See Also:
-
getValue
Gets the value- Returns:
- the value
-
setValue
Sets the value- Parameters:
value_
- the value to set- See Also:
-
toXML
Converts the form element to xml -
toXML
Converts the form element to xml -
fromXML
Creates a form element from xml- Parameters:
feNode
- the xml to create a form element from- Returns:
- the created
FormElement
-
fromXML
-
getMappedToArrayIndex
public int getMappedToArrayIndex()If the form element is mapped to a bean array, gets the index in the bean array the form element is mapped to- Returns:
- the index in the bean array the form element is mapped to
-
setMappedToArrayIndex
public void setMappedToArrayIndex(int mappedToArrayIndex_) Sets the index in a bean array that the form element is mapped to- Parameters:
mappedToArrayIndex_
- the index in the bean array to map the form element to
-
getMappedToBeanArray
If the mappedTo is a bean array, gets the bean array that the form element is mapped to- Returns:
- the bean array that the form element is mapped to
-
setMappedToBeanArray
Sets the bean array that the form element is mapped to- Parameters:
mappedToBeanArray_
- the bean array to set the mappedTo for the form element
-
getTypeName
Determines the name of the type of input widget that should be used to render this element based on the _type property.- Returns:
- the name of the type
-
getPickerType
Determines the pickerType to be used as the picker for this element. If this element is not one whose typeName is picker or singlepicker, returns -1.- Returns:
- the type of the picker
-
isTypeWithOptions
public boolean isTypeWithOptions()Whether the form element type has options- Returns:
- if the form element type has options
-
getExtra
Gets the JSON representation of the FE this bean represents. This only applies to elements generated by the new Forms Designer.- Returns:
- Returns
String
data in JSON format
-
setExtra
Sets the JSON representation of the FE this bean represents. This field should never be overwritten manually.- Parameters:
extra_
- AString
in JSON format which describes the FE this bean represents.- See Also:
-
getExpressions
Returns aTypedVariable[]
of expressions. Any expression stored in a new field (in theextra
field) is extracted from the JSON String and put in this array.- Returns:
- An array of fields to expressions.
- See Also:
-
setExpressions
Sets aTypedVariable[]
of expressions. This should never be overwritten manually.- See Also:
-
addExpression
-
getExpression
-
getExpressionCount
public int getExpressionCount()- Returns:
- count of expressions, the length that would be returned by getExpressions()
-
isBooleanType
public boolean isBooleanType()
-