Package org.alfresco.repo.forms
Class Form
java.lang.Object
org.alfresco.repo.forms.Form
Data representation of a form to be displayed in the UI.
- Author:
- Gavin Cornwell
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FormDataprotected List<FieldDefinition>protected Collection<FieldGroup>protected Itemprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds some data to be displayed by the formvoidAdds aFieldto the form by adding theFieldDefinitionand the value if any.voidaddFieldDefinition(FieldDefinition definition) Adds the given FieldDefinition to the form.voidaddFields(Collection<Field> fields) booleandataExists(String dataKey) Returns the list of field definitions for the formReturns the collection of field groups for the formReturns the data to display in the formgetItem()Returns the item the form is forReturns the submission URL to use for the formvoidsetFieldDefinitions(List<FieldDefinition> fieldDefinitions) Sets the list of FieldDefinition objects representing the fields the form is able to displayvoidsetFieldGroups(Collection<FieldGroup> fieldGroups) Sets the collection of FieldGroup objects representing the groups of fields the form should display and maintainvoidsetFormData(FormData data) Sets the data this form should display.voidsetSubmissionUrl(String url) Sets the submission URL the form should usetoString()
-
Field Details
-
item
-
submissionUrl
-
fieldDefinitions
-
fieldGroups
-
data
-
-
Constructor Details
-
Form
Constructs a Form- Parameters:
item- The item the form is for
-
-
Method Details
-
getItem
Returns the item the form is for- Returns:
- The item
-
getSubmissionUrl
Returns the submission URL to use for the form- Returns:
- URL to submit to
-
setSubmissionUrl
Sets the submission URL the form should use- Parameters:
url- URL to submit to
-
getFieldDefinitions
Returns the list of field definitions for the form- Returns:
- List of FieldDefinition objects or null if there are no fields
-
getFieldDefinitionNames
-
setFieldDefinitions
Sets the list of FieldDefinition objects representing the fields the form is able to display- Parameters:
fieldDefinitions- List of FieldDefinition objects
-
addFieldDefinition
Adds the given FieldDefinition to the form.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.
- Parameters:
definition- The FieldDefinition to add
-
getFieldGroups
Returns the collection of field groups for the form- Returns:
- Collection of FieldGroup objects or null if there are no groups
-
setFieldGroups
Sets the collection of FieldGroup objects representing the groups of fields the form should display and maintain- Parameters:
fieldGroups- Collection of FieldGroup objects
-
getFormData
Returns the data to display in the form- Returns:
- FormData object holding the data of the form or null if there is no data i.e. for a create form
-
setFormData
Sets the data this form should display. This will overwrite any existing form data being held- Parameters:
data- FormData instance containing the data
-
dataExists
- Parameters:
dataKey- The dataKey for the field.- Returns:
- boolean
-
addData
Adds some data to be displayed by the form- Parameters:
fieldName- Name of the field the data is forfieldData- The value
-
addField
Adds aFieldto the form by adding theFieldDefinitionand the value if any.- Parameters:
field- Field
-
addFields
-
toString
-