com.silverpeas.form
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
 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.
 String getTitle()
          Get the form title
 boolean 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 fields
 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 :


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 :

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

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

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

getTitle

String getTitle()
Get the form title


toString

String toString(PagesContext pagesContext,
                DataRecord record)

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


Copyright © 2016 Silverpeas. All Rights Reserved.