|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.silverpeas.form.AbstractForm
public abstract class AbstractForm
This abstract class implements the form interface and provides for all concretes classes a default implementation of some displaying methods.
Field Summary | |
---|---|
static String |
CONTEXT_FORM_FILE
|
static String |
CONTEXT_FORM_IMAGE
|
static String |
REPEATED_FIELD_CSS_HIDE
|
static String |
REPEATED_FIELD_CSS_SHOW
|
static String |
REPEATED_FIELD_SEPARATOR
|
Constructor Summary | |
---|---|
AbstractForm(RecordTemplate template)
Creates a new form from the specified template of records. |
Method Summary | |
---|---|
void |
display(javax.servlet.jsp.JspWriter out,
PagesContext pagesContext)
Prints this form into the specified JSP writer according to the specified records of data that populate the form fields. |
abstract void |
display(javax.servlet.jsp.JspWriter out,
PagesContext pagesContext,
DataRecord record)
Prints this form into the specified JSP writer according to the specified records of data that populate the form fields. |
void |
displayScripts(javax.servlet.jsp.JspWriter jw,
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 of the fields that made this form. |
String |
getFormName()
|
String |
getName()
|
protected Field |
getSureField(FieldTemplate fieldTemplate,
DataRecord record,
int occurrence)
|
String |
getTitle()
Gets the title of this form. |
boolean |
isEmpty(List<org.apache.commons.fileupload.FileItem> items,
DataRecord record,
PagesContext pagesContext)
Is the form is empty? |
boolean |
isViewForm()
|
void |
setData(DataRecord data)
|
void |
setFormName(String name)
|
void |
setName(String name)
|
void |
setTitle(String title)
Sets the form title. |
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 |
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.silverpeas.form.Form |
---|
toString |
Field Detail |
---|
public static final String CONTEXT_FORM_FILE
public static final String CONTEXT_FORM_IMAGE
public static final String REPEATED_FIELD_CSS_SHOW
public static final String REPEATED_FIELD_CSS_HIDE
public static final String REPEATED_FIELD_SEPARATOR
Constructor Detail |
---|
public AbstractForm(RecordTemplate template) throws FormException
template
- the record template.
FormException
- if an error occurs while setting up the form.Method Detail |
---|
public void setFormName(String name)
setFormName
in interface Form
public String getFormName()
public List<FieldTemplate> getFieldTemplates()
public String getTitle()
getTitle
in interface Form
public void setTitle(String title)
title
- the new title of the form.public void displayScripts(javax.servlet.jsp.JspWriter jw, PagesContext pagesContext)
displayScripts
in interface Form
jw
- the JSP writer into which the javascript is written.pagesContext
- the JSP page context.public abstract void display(javax.servlet.jsp.JspWriter out, PagesContext pagesContext, DataRecord record)
display
in interface Form
out
- the JSP writer.pagesContext
- the JSP page context.record
- the record the data records embbed the form fields.public void display(javax.servlet.jsp.JspWriter out, PagesContext pagesContext)
display
in interface Form
out
- the JSP writer.pagesContext
- the JSP page context.public List<String> update(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext)
update
in interface Form
items
- the item of a form in which is embbeded multipart data.record
- the record of data.pagesContext
- the page context.public List<String> update(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext, boolean updateWysiwyg)
update
in interface Form
items
- the item of a form in which is embbeded multipart data.record
- the record of data.pagesContext
- the page context.updateWysiwyg
- flag indicating if all of WYSIWYG data can be updated.public List<String> updateWysiwyg(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext)
updateWysiwyg
in interface Form
items
- the item of a form in which is embbeded multipart data.record
- the record of data.pagesContext
- the page context.public boolean isEmpty(List<org.apache.commons.fileupload.FileItem> items, DataRecord record, PagesContext pagesContext)
isEmpty
in interface Form
items
- the items embbeding multipart data in the form.record
- the record of data.pagesContext
- the page context.
public void setName(String name)
public String getName()
protected Field getSureField(FieldTemplate fieldTemplate, DataRecord record, int occurrence)
public DataRecord getData()
public void setData(DataRecord data)
setData
in interface Form
public void setViewForm(boolean viewForm)
Form
setViewForm
in interface Form
viewForm
- true if this form is a 'view' formpublic boolean isViewForm()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |