Class HtmlForm
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.AbstractForm
-
- org.silverpeas.core.contribution.content.form.form.HtmlForm
-
- All Implemented Interfaces:
Form
public class HtmlForm extends AbstractForm
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
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.contribution.content.form.AbstractForm
REPEATED_FIELD_CSS_HIDE, REPEATED_FIELD_CSS_SHOW, REPEATED_FIELD_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description HtmlForm(RecordTemplate template)
Creates a new HTML form from the specified template of records.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
display(javax.servlet.jsp.JspWriter jw, PagesContext pagesContext, DataRecord record)
Prints the HTML layout of the dataRecord using the RecordTemplate to extract labels and extra informations.String
getTitle()
Get the form title No title for HTML formvoid
setFileName(String fileName)
Sets the HTML file into which the form should be printed.String
toString(PagesContext pageContext, DataRecord record)
Prints the HTML layout of the dataRecord using the RecordTemplate to extract labels and extra informations.-
Methods inherited from class org.silverpeas.core.contribution.content.form.AbstractForm
display, displayScripts, getData, getFieldDisplayer, getFieldTemplates, getFormName, getJavascriptSnippet, getName, getSkippableSnippet, getSureField, isEmpty, isViewForm, setData, setFormName, setName, setTitle, setViewForm, toString, update, update, updateWysiwyg
-
-
-
-
Constructor Detail
-
HtmlForm
public HtmlForm(RecordTemplate template) throws FormException
Creates a new HTML form from the specified template of records.- Parameters:
template
- the record template from which the form is built.- Throws:
FormException
- if an error occurs while setting up the form.
-
-
Method Detail
-
setFileName
public void setFileName(String fileName)
Sets the HTML file into which the form should be printed.- Parameters:
fileName
- the HTML file.
-
display
public void display(javax.servlet.jsp.JspWriter jw, PagesContext pagesContext, DataRecord record)
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.
- Specified by:
display
in interfaceForm
- Specified by:
display
in classAbstractForm
- Parameters:
jw
- the JSP writer.pagesContext
- the JSP page context.record
- the record the data records embbed the form fields.
-
toString
public String toString(PagesContext pageContext, DataRecord record)
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.
- Returns:
- the string to be displayed
-
getTitle
public String getTitle()
Get the form title No title for HTML form- Specified by:
getTitle
in interfaceForm
- Overrides:
getTitle
in classAbstractForm
- Returns:
- the title of this form or an empty string if it isn't set.
-
-