public class Form extends Object
Modifier and Type | Field and Description |
---|---|
protected FormData |
data |
protected List<FieldDefinition> |
fieldDefinitions |
protected Collection<FieldGroup> |
fieldGroups |
protected Item |
item |
protected String |
submissionUrl |
Modifier and Type | Method and Description |
---|---|
void |
addData(String fieldName,
Object fieldData)
Adds some data to be displayed by the form
|
void |
addField(Field field)
Adds a
Field to the form by adding the FieldDefinition
and the value if any. |
void |
addFieldDefinition(FieldDefinition definition)
Adds the given FieldDefinition to the form.
|
void |
addFields(Collection<Field> fields)
|
boolean |
dataExists(String dataKey)
|
List<String> |
getFieldDefinitionNames() |
List<FieldDefinition> |
getFieldDefinitions()
Returns the list of field definitions for the form
|
Collection<FieldGroup> |
getFieldGroups()
Returns the collection of field groups for the form
|
FormData |
getFormData()
Returns the data to display in the form
|
Item |
getItem()
Returns the item the form is for
|
String |
getSubmissionUrl()
Returns the submission URL to use for the form
|
void |
setFieldDefinitions(List<FieldDefinition> fieldDefinitions)
Sets the list of FieldDefinition objects representing the fields the
form is able to display
|
void |
setFieldGroups(Collection<FieldGroup> fieldGroups)
Sets the collection of FieldGroup objects representing the groups of
fields the form should display and maintain
|
void |
setFormData(FormData data)
Sets the data this form should display.
|
void |
setSubmissionUrl(String url)
Sets the submission URL the form should use
|
String |
toString() |
protected Item item
protected String submissionUrl
protected List<FieldDefinition> fieldDefinitions
protected Collection<FieldGroup> fieldGroups
protected FormData data
public Form(Item item)
item
- The item the form is forpublic Item getItem()
public String getSubmissionUrl()
public void setSubmissionUrl(String url)
url
- URL to submit topublic List<FieldDefinition> getFieldDefinitions()
public void setFieldDefinitions(List<FieldDefinition> fieldDefinitions)
fieldDefinitions
- List of FieldDefinition objectspublic void addFieldDefinition(FieldDefinition definition)
NOTE: Multiple fields with the same name can be added to the list, it is therefore the form processor and the client of the FormService responsibility to differentiate the fields in some way i.e. by type, property vs. association.
definition
- The FieldDefinition to addpublic Collection<FieldGroup> getFieldGroups()
public void setFieldGroups(Collection<FieldGroup> fieldGroups)
fieldGroups
- Collection of FieldGroup objectspublic FormData getFormData()
public void setFormData(FormData data)
data
- FormData instance containing the datapublic boolean dataExists(String dataKey)
dataKey
- The dataKey for the field.public void addData(String fieldName, Object fieldData)
fieldName
- Name of the field the data is forfieldData
- The valuepublic void addField(Field field)
Field
to the form by adding the FieldDefinition
and the value if any.field
- Fieldpublic void addFields(Collection<Field> fields)
Copyright © 2005–2017 Alfresco Software. All rights reserved.