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:
  • Field Details

    • LOG

      protected static final org.apache.log4j.Logger LOG
    • ELEMENT_TYPE_LONG

      public static final int ELEMENT_TYPE_LONG
      Constant for element type Long
      See Also:
    • ELEMENT_TYPE_DOUBLE

      public static final int ELEMENT_TYPE_DOUBLE
      Constant for element type Double
      See Also:
    • ELEMENT_TYPE_TEXT

      public static final int ELEMENT_TYPE_TEXT
      Constant for element type Text
      See Also:
    • ELEMENT_TYPE_TEXTAREA

      public static final int ELEMENT_TYPE_TEXTAREA
      Constant for element type Text Area
      See Also:
    • ELEMENT_TYPE_USER_PICKER

      public static final int ELEMENT_TYPE_USER_PICKER
      Constant for element type User Picker
      See Also:
    • ELEMENT_TYPE_GROUP_PICKER

      public static final int ELEMENT_TYPE_GROUP_PICKER
      Constant for element type Group Picker
      See Also:
    • ELEMENT_TYPE_PEOPLE_PICKER

      public static final int ELEMENT_TYPE_PEOPLE_PICKER
      Constant for element type People Picker
      See Also:
    • ELEMENT_TYPE_DATE

      public static final int ELEMENT_TYPE_DATE
      Constant for element type Date
      See Also:
    • ELEMENT_TYPE_TIME

      public static final int ELEMENT_TYPE_TIME
      Constant for element type Time
      See Also:
    • ELEMENT_TYPE_DATETIME

      public static final int ELEMENT_TYPE_DATETIME
      Constant for element type Date Time
      See Also:
    • ELEMENT_TYPE_KC_PICKER

      public static final int ELEMENT_TYPE_KC_PICKER
      Constant for element type KC Picker
      See Also:
    • ELEMENT_TYPE_FOLDER_PICKER

      public static final int ELEMENT_TYPE_FOLDER_PICKER
      Constant for element type Folder Picker
      See Also:
    • ELEMENT_TYPE_DOC_PICKER

      public static final int ELEMENT_TYPE_DOC_PICKER
      Constant for element type Document Picker
      See Also:
    • ELEMENT_TYPE_COMMUNITY_PICKER

      public static final int ELEMENT_TYPE_COMMUNITY_PICKER
      Constant for element type Community Picker
      See Also:
    • ELEMENT_TYPE_RADIO

      public static final int ELEMENT_TYPE_RADIO
      Constant for element type Radio
      See Also:
    • ELEMENT_TYPE_CHECKBOX

      public static final int ELEMENT_TYPE_CHECKBOX
      Constant for element type Checkbox
      See Also:
    • ELEMENT_TYPE_DROPDOWN

      public static final int ELEMENT_TYPE_DROPDOWN
      Constant for element type Dropdown
      See Also:
    • ELEMENT_TYPE_LABEL

      public static final int ELEMENT_TYPE_LABEL
      Constant for element type Label
      See Also:
    • ELEMENT_TYPE_FORUM_PICKER

      public static final int ELEMENT_TYPE_FORUM_PICKER
      Constant for element type Forum Picker
      See Also:
    • ELEMENT_TYPE_THREAD_PICKER

      public static final int ELEMENT_TYPE_THREAD_PICKER
      Constant for element type Thread Picker
      See Also:
    • ELEMENT_TYPE_MESSAGE_PICKER

      public static final int ELEMENT_TYPE_MESSAGE_PICKER
      Constant for element type Message Picker
      See Also:
    • ELEMENT_TYPE_LOCAL_FILE

      public static final int ELEMENT_TYPE_LOCAL_FILE
      Constant for element type Local File
      See Also:
    • ELEMENT_TYPE_HIDDEN

      public static final int ELEMENT_TYPE_HIDDEN
      Constant for element type Hidden
      See Also:
    • ELEMENT_TYPE_CONTENT_PICKER

      public static final int ELEMENT_TYPE_CONTENT_PICKER
      Constant for element type Content Picker
      See Also:
    • ELEMENT_TYPE_PAGE_PICKER

      public static final int ELEMENT_TYPE_PAGE_PICKER
      Constant for element type Page Picker
      See Also:
    • ELEMENT_TYPE_HTMLAREA

      public static final int ELEMENT_TYPE_HTMLAREA
      Constant for element type HTML Area
      See Also:
    • ELEMENT_TYPE_BUTTON

      public static final int ELEMENT_TYPE_BUTTON
      Constant for element type Button
      See Also:
    • ELEMENT_TYPE_PASSWORD

      public static final int ELEMENT_TYPE_PASSWORD
      Constant for element type Password
      See Also:
    • ELEMENT_TYPE_PARAGRAPHS

      public static final int ELEMENT_TYPE_PARAGRAPHS
      Constant for element of type Paragraphs
      See Also:
    • ELEMENT_TYPE_EMAIL_ADDRESS

      public static final int ELEMENT_TYPE_EMAIL_ADDRESS
      Constant for element of type Email Recipient
      See Also:
    • ELEMENT_TYPE_EMAIL_RECIPIENT_PICKER

      public static final int ELEMENT_TYPE_EMAIL_RECIPIENT_PICKER
      Constant for element of type Email Recipient
      See Also:
    • ELEMENT_TYPE_FORM

      public static final int ELEMENT_TYPE_FORM
      Constant for layout of type Form
      See Also:
    • ELEMENT_TYPE_TABS

      public static final int ELEMENT_TYPE_TABS
      Constant for layout of type Tabs
      See Also:
    • ELEMENT_TYPE_PROCESS_MODEL_PICKER

      public static final int ELEMENT_TYPE_PROCESS_MODEL_PICKER
      Constant for element of type Process Model
      See Also:
    • ELEMENT_TYPE_PROCESS_PICKER

      public static final int ELEMENT_TYPE_PROCESS_PICKER
      Constant for element of type Process
      See Also:
  • Constructor Details

    • FormElement

      public FormElement()
  • Method Details

    • getHiddenAttributes

      public HashSet 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 interface JSONable
      Returns:
      the set of hidden attributes
    • clone

      public Object clone()
      Clone this object.
      Specified by:
      clone in interface DeepCloneable
      Overrides:
      clone in class Object
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public String getInstructions()
      Gets the instructions for the form element
      Returns:
      the instructions for the form element
    • setInstructions

      public void setInstructions(String instructions_)
      Sets the instructions for the form element
      Parameters:
      instructions_ - the instructions to set
      See Also:
    • getLabel

      public String getLabel()
      Gets the label for the form element
      Returns:
      the label for the form element
    • setLabel

      public void setLabel(String label_)
      Sets the label for the form element
      Parameters:
      label_ - the label to set
      See Also:
    • getMappedTo

      public String getMappedTo()
      Get the acp or process parameter the form element is mapped to
      Returns:
      what the form element is mapped to
    • setMappedTo

      public void setMappedTo(String mappedTo_)
      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

      public String getName()
      Gets the name
      Returns:
      the name
    • setName

      public void setName(String name_)
      Sets the name
      Parameters:
      name_ - the name
      See Also:
    • getOptions

      public Option[] getOptions()
      Gets the form element options
      Returns:
      an array of form element Option objects
    • setOptions

      public void setOptions(Option[] options_)
      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

      public String getValue()
      Gets the value
      Returns:
      the value
    • setValue

      public void setValue(String value_)
      Sets the value
      Parameters:
      value_ - the value to set
      See Also:
    • toXML

      public String toXML()
      Converts the form element to xml
      Specified by:
      toXML in interface XMLable
      Returns:
      the xml representation of the form element
    • toXML

      public void toXML(StringBuilder buffer_)
      Converts the form element to xml
      Specified by:
      toXML in interface XMLable
      Parameters:
      buffer_ - the buffer to store the xml representation of form element in
    • fromXML

      public static FormElement fromXML(Node feNode)
      Creates a form element from xml
      Parameters:
      feNode - the xml to create a form element from
      Returns:
      the created FormElement
    • fromXML

      public static FormElement fromXML(Node feNode, FormElement.InferFormElementCallback callback)
    • 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

      public String 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

      public void setMappedToBeanArray(String mappedToBeanArray_)
      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

      public String 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

      public String 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

      public String 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

      public void setExtra(String extra_)
      Sets the JSON representation of the FE this bean represents. This field should never be overwritten manually.
      Parameters:
      extra_ - A String in JSON format which describes the FE this bean represents.
      See Also:
    • getExpressions

      public TypedVariable[] getExpressions()
      Returns a TypedVariable[] of expressions. Any expression stored in a new field (in the extra field) is extracted from the JSON String and put in this array.
      Returns:
      An array of fields to expressions.
      See Also:
    • setExpressions

      public void setExpressions(TypedVariable[] expressions_)
      Sets a TypedVariable[] of expressions. This should never be overwritten manually.
      See Also:
    • addExpression

      public int addExpression(TypedVariable expression_)
    • getExpression

      public TypedVariable getExpression(int index_)
    • getExpressionCount

      public int getExpressionCount()
      Returns:
      count of expressions, the length that would be returned by getExpressions()
    • isBooleanType

      public boolean isBooleanType()