|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.ui.util.PageProcessor
com.waveset.ui.util.GenericEditForm
An implementation of PageProcessor that supports the editing of any object that can expose itself as a GenericObject "view" with a Form object that describes the layout of the page.
This can serve as the foundation for many editing pages. The class has a number of methods that are called during normal control flow to allow sublcasses to insert custom behavior.
Field Summary | |
static java.lang.String |
CMD_CANCEL
|
static java.lang.String |
CMD_OK
|
static java.lang.String |
CMD_RECALCULATE
|
static java.lang.String |
CMD_RECALCULATE_AND_VALIDATE
|
static java.lang.String |
CMD_SAVE
Command button identifiers. |
static java.lang.String |
CMD_SAVE_NO_VALIDATE
|
static java.lang.String |
code_id
|
static java.lang.String |
FORM_BUTTON
The name of a magic post data parameter that may be used to hold a form button name distinct from the command name. |
static java.lang.String |
URL_GENERATE
A special URL that can be returned from the preProcess method to indicate that we should skip processing and go directly to form generation. |
Fields inherited from class com.waveset.ui.util.PageProcessor |
_command, _trace, trace |
Constructor Summary | |
GenericEditForm()
Create the edit form. |
Method Summary | |
void |
addButtons(com.waveset.ui.util.html.HtmlPage page)
Add the standard button and extended button sets. |
void |
addExtendedButtons(com.waveset.ui.util.html.Panel panel)
Called by generate() to let the subclass add command buttons to the bottom of the form. |
void |
assimilatePostData()
Called immediately after post data for items defined in the Form have been assimilated back into the _view. |
ViewSource |
createViewSource()
Create a new view source. |
com.waveset.ui.util.html.HtmlPage |
generate()
Generate the form. |
FormConverter |
getFormConverter()
Build a FormConverter if we don't already have one. |
java.lang.Object |
getMessage(java.lang.Throwable t,
java.util.Locale locale)
|
java.lang.String |
getMessageConfirmationButtonText()
Return the text to be displayed in the confirmatino button when status messages are displayed after a SAVE command. |
java.lang.String |
getNiceMessage(java.lang.Throwable t,
java.util.Locale locale)
Get the localized message from an excpetion. |
java.lang.Object |
getNiceMessageObject(java.lang.Throwable t,
java.util.Locale locale)
Get the localized message from an excpetion. |
java.lang.String |
getNicerLockMessage(java.lang.Throwable t,
java.util.Locale locale)
|
GenericObject |
getView()
Convenience method to get the view from the view source. |
ViewSource |
getViewSource()
Return the known ViewSource object, or create a new one. |
boolean |
isAdminSubject(LighthouseContext context)
Helper method that checks to see if an Administrator is logged in to the session. |
java.lang.String |
postProcess(java.lang.String nextURL)
Called immediately after all processing has finished, and we're about to calculate the next URL. |
java.lang.String |
preProcess()
Called immediately prior to processing. |
java.lang.String |
process(RequestState reqState)
Process the form produced by the generate() method. |
java.lang.String |
processCommand()
Process an extended command. |
java.lang.String |
processResult(WavesetResult result)
This will walk a WavesetResult object and set the _error attributes. |
protected void |
refreshViewIfNeeded()
|
void |
setAlwaysRefresh(boolean b)
Set the option to always refresh the view rather than cache it in the HttpSession. |
void |
setOption(java.lang.String name,
java.lang.Object value)
Set a view option. |
void |
setResultAttribute(java.lang.String name)
|
void |
setSessionAttribute(java.lang.String name)
Set the HttpSession attribute used to store this view. |
void |
setViewId(java.lang.String s)
Called to specify the view id of the object to create or edit. |
void |
setViewSource(ViewSource vs)
Allow a ViewSource to be given to us. |
Methods inherited from class com.waveset.ui.util.PageProcessor |
addComment, addComments, addError, addErrors, addMessage, addMessages, clearErrors, clearMessages, generateHTML, generateHTML, generateHTML, getAppBaseURL, getCancelURL, getCommand, getComments, getErrors, getHtmlFormName, getMessages, getNextURL, getObjectRef, getParameter, getPostURL, getRequestState, getSubTitle, getTitle, isCommand, isErrors, println, setAppBaseURL, setCancelURL, setCommand, setHiddenId, setHtmlFormName, setNextURL, setPostURL, setRequestState, setSubTitle, setTitle, setTrace, stripDirectory, transferPageState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String CMD_SAVE
public static final java.lang.String CMD_CANCEL
public static final java.lang.String CMD_OK
public static final java.lang.String CMD_RECALCULATE
public static final java.lang.String CMD_RECALCULATE_AND_VALIDATE
public static final java.lang.String CMD_SAVE_NO_VALIDATE
public static final java.lang.String FORM_BUTTON
public static final java.lang.String URL_GENERATE
Constructor Detail |
public GenericEditForm()
Method Detail |
public void setViewId(java.lang.String s) throws WavesetException
WavesetException
public void setOption(java.lang.String name, java.lang.Object value) throws WavesetException
WavesetException
public void setSessionAttribute(java.lang.String name) throws WavesetException
WavesetException
public void setAlwaysRefresh(boolean b) throws WavesetException
WavesetException
public void setResultAttribute(java.lang.String name)
public void setViewSource(ViewSource vs)
public ViewSource getViewSource() throws WavesetException
WavesetException
public ViewSource createViewSource() throws WavesetException
WavesetException
public java.lang.String preProcess() throws WavesetException
WavesetException
public void assimilatePostData() throws WavesetException
WavesetException
public java.lang.String processCommand() throws WavesetException
WavesetException
public java.lang.String processResult(WavesetResult result) throws WavesetException
Need a general way to describe what we want to see from a WaveseResult and extract it. !! The WavesetResult model sucks, need to clarify what the types mean and unify how we represent errors.
If the return value is non-null, it is assumed to be the next URL.
WavesetException
public java.lang.String postProcess(java.lang.String nextURL) throws WavesetException
WavesetException
public void addExtendedButtons(com.waveset.ui.util.html.Panel panel) throws WavesetException
WavesetException
public GenericObject getView() throws WavesetException
WavesetException
public FormConverter getFormConverter() throws WavesetException
WavesetException
public java.lang.String process(RequestState reqState) throws WavesetException
process
in class PageProcessor
WavesetException
protected void refreshViewIfNeeded() throws WavesetException
WavesetException
public java.lang.String getNiceMessage(java.lang.Throwable t, java.util.Locale locale)
public java.lang.Object getNiceMessageObject(java.lang.Throwable t, java.util.Locale locale)
public java.lang.Object getMessage(java.lang.Throwable t, java.util.Locale locale)
public java.lang.String getNicerLockMessage(java.lang.Throwable t, java.util.Locale locale)
public boolean isAdminSubject(LighthouseContext context)
public com.waveset.ui.util.html.HtmlPage generate() throws WavesetException
If you want more control, overload the postProcessForm method.
We let FormConverter do most of the work. The balance of power between GenericEditForm and FormConverter has shifted as we we went, now its a little awkward how the form gets pre & post processed, I'm especially not happy with how buttons get added here. Need to think about this!!
generate
in class PageProcessor
WavesetException
public java.lang.String getMessageConfirmationButtonText()
public void addButtons(com.waveset.ui.util.html.HtmlPage page) throws WavesetException
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |