Interface Form
-
- All Known Implementing Classes:
AbstractForm
,HtmlForm
,XmlForm
,XmlSearchForm
public interface Form
A Form is an object which can display in HTML the content of a DataRecord to a end user and can retrieve via HTTP any updated values.- See Also:
DataRecord
,RecordTemplate
,FieldDisplayer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
display(javax.servlet.jsp.JspWriter out, PagesContext pagesContext)
void
display(javax.servlet.jsp.JspWriter out, PagesContext pagesContext, DataRecord record)
Prints the HTML layout of the dataRecord using the RecordTemplate to extract labels and extra informations.void
displayScripts(javax.servlet.jsp.JspWriter out, PagesContext pagesContext)
Prints the javascripts which will be used to control the new values given to the data record fields.DataRecord
getData()
List<FieldTemplate>
getFieldTemplates()
Gets the template of all fields that make this formString
getFormName()
String
getTitle()
Get the form titleboolean
isEmpty(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext)
void
setData(DataRecord data)
void
setFormName(String name)
void
setViewForm(boolean viewForm)
Defines if this form is a 'view' form (opposite to an 'update' form) A 'view' form may have some specific behaviors like to not display empty fieldsString
toString(PagesContext pagesContext)
String
toString(PagesContext pagesContext, DataRecord record)
List<String>
update(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext)
Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status).List<String>
update(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext, boolean updateWysiwyg)
Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status).List<String>
updateWysiwyg(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext)
Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status).
-
-
-
Method Detail
-
displayScripts
void displayScripts(javax.servlet.jsp.JspWriter out, PagesContext pagesContext)
Prints the javascripts which will be used to control the new values given to the data record fields. The error messages may be adapted to a local language. The RecordTemplate gives the field type and constraints. The RecordTemplate gives the local label too. Never throws an Exception but log a silvertrace and writes an empty string when :- a field is unknown by the template.
- a field has not the required type.
-
display
void display(javax.servlet.jsp.JspWriter out, PagesContext pagesContext, DataRecord record) throws FormException
Prints the HTML layout of the dataRecord using the RecordTemplate to extract labels and extra informations. The value formats may be adapted to a local language. Never throws an Exception but log a silvertrace and writes an empty string when :- a field is unknown by the template.
- a field has not the required type.
- Throws:
FormException
-
display
void display(javax.servlet.jsp.JspWriter out, PagesContext pagesContext) throws FormException
- Throws:
FormException
-
updateWysiwyg
List<String> updateWysiwyg(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext) throws FormException
Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from the request. this method treats only wysiwyg fields.- Throws:
FormException
- if the field type is not a managed type or if the field doesn't accept the new value.
-
update
List<String> update(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext) throws FormException
Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from the request.- Throws:
FormException
- if the field type is not a managed type or if the field doesn't accept the new value.
-
update
List<String> update(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext, boolean updateWysiwyg) throws FormException
Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from the request.- Throws:
FormException
- if the field type is not a managed type or if the field doesn't accept the new value.
-
getTitle
String getTitle()
Get the form title
-
getFieldTemplates
List<FieldTemplate> getFieldTemplates()
Gets the template of all fields that make this form- Returns:
- a List of FieldTemplate
-
toString
String toString(PagesContext pagesContext, DataRecord record)
-
toString
String toString(PagesContext pagesContext)
-
isEmpty
boolean isEmpty(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext)
-
setFormName
void setFormName(String name)
-
setData
void setData(DataRecord data)
-
setViewForm
void setViewForm(boolean viewForm)
Defines if this form is a 'view' form (opposite to an 'update' form) A 'view' form may have some specific behaviors like to not display empty fields- Parameters:
viewForm
- true if this form is a 'view' form
-
getFormName
String getFormName()
-
getData
DataRecord getData()
-
-