|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pajes.db.entity.MaintenanceDisplayElement
org.pajes.db.entity.Viewer
org.pajes.db.entity.Editor
org.pajes.db.entity.DefaultEditor
public class DefaultEditor
Abstract super-class of all classes that create a Paje to edit or
display an Entity object.
All sub-classes MUST have a no-parameter constructor.
| Field Summary | |
|---|---|
static java.lang.String |
EDITOR_FACTORY
The name of the ServletContext attribute that can contain a PajeFactory instance that will generate generic forms for
displaying and editing Entity objects. |
| Constructor Summary | |
|---|---|
DefaultEditor()
|
|
| Method Summary | |
|---|---|
protected HTML |
getCancelButton(Form form,
InputHidden action)
Returns the HTML object that will allow the user to exit the Viewer. |
protected HTML |
getDeleteButton(Form form,
InputHidden action)
Returns the HTML object that will allow the user to delete the Entity being edited. |
protected Form |
getForm()
Returns the Form that can be used to display and/or edit
an Entity. |
Paje |
getPaje()
Returns a Paje to display and/or edit an Entity
object. |
protected HTML |
getSaveButton(Form form,
InputHidden action)
Returns the HTML object that will allow the user to save changes to the Entity being edited. |
protected void |
setEditorFactory(PajeFactory editor)
Sets the Editor factory object. |
| Methods inherited from class org.pajes.db.entity.Editor |
|---|
build, init, isNew, retrieve, setRequest |
| Methods inherited from class org.pajes.db.entity.Viewer |
|---|
getEntity, getScope, init, setRequest |
| Methods inherited from class org.pajes.db.entity.MaintenanceDisplayElement |
|---|
clone, getManager, getRequest, getServletContext, init, init, isInitialised |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String EDITOR_FACTORY
PajeFactory instance that will generate generic forms for
displaying and editing Entity objects.
| Constructor Detail |
|---|
public DefaultEditor()
| Method Detail |
|---|
public Paje getPaje()
throws java.io.IOException
Paje to display and/or edit an Entity
object.
The Paje to be returned will be determined as follows:
Editor has been defined, it will be
requested to create a document. Editor has been defined, the
ServletContext will be searched for an attribute named
EDITOR_FACTORY, and the object returned by
ServletContext.getAttribute will be requested to create a
document. Context default Editor factory objects should be created in
your Initialisation sub-class.
Once a document has been instantiated, the Container
identified by ViewerTemplate.ENTITY_CONTAINER_ID will be
retrieved. If this container is empty, the Form returned
by getForm() will be added to the container.
The Entity used to populate the input form will be placed into
the HttpSession with the following method call:
request.getSession().setAttribute(this.getManager().getPrimaryKeyValues(entity), entity);
For compatibility with PAJES 2.1.x, the Entity will also be
placed into the HttpSession with the following method call:
request.getSession().setAttribute(this.getManager().getAdminServletName(), entity);
getPaje in class Viewerjava.io.IOException - if an IO exception occurs.Viewer.build(org.pajes.html.TraversableElement)
protected HTML getCancelButton(Form form,
InputHidden action)
The default implementation returns a SubmitButton with the value
"Cancel".
form - the form on which the object will be placed.action - the hidden field, named MaintenanceServlet.ACTION_PARAMETER, that must be updated
with MaintenanceServlet.CANCEL_ACTION_VALUE when this
item is selected by the user
protected HTML getDeleteButton(Form form,
InputHidden action)
The default implementation returns a SubmitButton with the value
"Delete".
form - the form on which the object will be placed.action - the hidden field, named MaintenanceServlet.ACTION_PARAMETER, that must be updated
with MaintenanceServlet.DELETE_ACTION_VALUE when this
item is selected by the user
protected Form getForm()
throws java.io.IOException
Form that can be used to display and/or edit
an Entity. All fields will be displayed, except those where
Attributes.getEditorPosition() returns a number less than zero.
Note that this method should return a new instance with each invocation, either by direct creation or by cloning. Under no circumstances should one instance be returned mulitple times.
java.io.IOException - if an IO exception occurs.
protected HTML getSaveButton(Form form,
InputHidden action)
The default implementation returns a SubmitButton with the value
"Save".
form - the form on which the object will be placed.action - the hidden field, named MaintenanceServlet.ACTION_PARAMETER, that must be updated
with MaintenanceServlet.UPDATE_ACTION_VALUE when this
item is selected by the user
protected void setEditorFactory(PajeFactory editor)
editor - the Editor factory object.
|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||