|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
uk.co.weft.maybeupload.MaybeUploadServlet
uk.co.weft.htform.Servlet
uk.co.weft.htform.WithExceptionHandlerServlet
uk.co.weft.htform.Page
uk.co.weft.htform.Form
An HTML page which is principally a form. The layout of the form is controlled by a Layout, q.v., but the default Layout lays widgets out as a table over four columns; specialisations could choose other layouts (for example, help-texts could be implemented as mouse-overs, narrow widgets could be laid out side by side, etc).
Note that a Form no longer automatically has a submit widget in it. You can supply one simply by adding an ActionWidget -- you don't need to specialise ActionWidget, because if your form has one and only one action you can just specialise defaultActionHandler().
This class (and consequently all servlets which are subclasses of this class) know about the following configuration parameters, in addition to those handled by Servlet:
Page,
Layout,
Serialized Form| Field Summary | |
protected java.lang.String |
action
the URL to pass collected data to |
static java.lang.String |
actionExecutedToken
Deprecated. use ACTIONEXECUTEDTOKEN |
static java.lang.String |
ACTIONEXECUTEDTOKEN
the magic token in the context which holds a token representing the action performed. |
protected java.util.Vector |
auxiliaries
My auxiliary tables |
static java.lang.String |
contextMenuMagicToken
Deprecated. use CONTEXTMENUMAGICTOKEN |
static java.lang.String |
CONTEXTMENUMAGICTOKEN
a magic token to retrieve menus for this service from the context |
static java.lang.String |
cssHelp
Deprecated. use CSSHELP |
static java.lang.String |
CSSHELP
A CSS class name for help text |
static java.lang.String |
cssPrompt
Deprecated. use CSSPROMPT |
static java.lang.String |
CSSPROMPT
A CSS class name for prompts |
protected static java.lang.String |
defaultScriptBase
where to look for java scripts -- can be overridden with servlet property script_url_base |
protected java.lang.String |
mandatoryPrompt
Text to append to widget prompts where widget is mandatory |
static int |
MIN_WIDGETS
the minimum number of widgets a widget set can really have. |
static java.lang.String |
onloadFunctionToken
Deprecated. use ONLOADFUNCTIONTOKEN |
static java.lang.String |
ONLOADFUNCTIONTOKEN
the magic token in the context which holds the name of the JavaScript function to run when the page is loaded, if any |
protected java.lang.String |
optionalPrompt
Text to append to widget prompts where widget is not mandatory |
static java.lang.String |
selectedWidgetSetMagicToken
Deprecated. use SELECTEDWIDGETSETMAGICTOKEN |
static java.lang.String |
SELECTEDWIDGETSETMAGICTOKEN
a magic token to retrieve the widget set for this service from the context |
protected boolean |
showHeadline
do I show the forms headline? For most things it's a great convenience, for some a nuisance |
protected java.lang.String |
submitMethod
what method shall I use for submitting my form? |
static java.lang.String |
SUBMITMETHODCONFIGTOKEN
a magic token to determine the submit method for this form from the config |
static java.lang.String |
SUBMITMETHODGET
the canonical name of the submit method 'get' |
static java.lang.String |
SUBMITMETHODPOST
the canonical name of the submit method 'post' |
static java.lang.String |
validationWhingeToken
Deprecated. use VALIDATIONWHINGETOKEN |
static java.lang.String |
VALIDATIONWHINGETOKEN
the magic token in the context which holds the data validation whinges which arose while preprocessing widgets, if any. |
protected java.lang.String |
whingeHeader
Header text for the list of validation errors if any |
protected WidgetSet |
widgets
My default widgets |
protected java.util.Vector |
widgetSets
All my widget sets |
| Fields inherited from class uk.co.weft.htform.Page |
DOCTYPECONFIGTOKEN, dynamicFootInclude, dynamicHeadInclude, footInclude, footIncludeURL, headInclude, headIncludeURL, imageUrlBase, layout, printStylesheet, PRINTSTYLESHEETCONFIGTOKEN, stylesheet, STYLESHEETCONFIGTOKEN, title, titleMagicToken, TITLEMAGICTOKEN |
| Fields inherited from class uk.co.weft.htform.WithExceptionHandlerServlet |
EXCEPTIONHANDLERCLASSCONFIGTOKEN |
| Fields inherited from class uk.co.weft.maybeupload.MaybeUploadServlet |
allowOverwrite, maxUpload, saveUploadedFilesToDisk, silentlyRename, uploadDir, uploadDirPath, uploadDirURL |
| Fields inherited from interface uk.co.weft.htform.ResourceConsumer |
RESOURCEBUNDLEMAGICTOKEN |
| Constructor Summary | |
Form()
|
|
| Method Summary | |
protected Auxiliary |
addAuxiliary(Auxiliary aux)
Add this auxiliary to my auxiliaries. |
protected Widget |
addWidget(Widget w)
Add this widget to the front of my default widget set |
protected void |
defaultActionHandler(Context context,
Context whinges)
Final fall-back action handler for this form. |
protected void |
doBody(Context context)
Produce the body for a form, establishing the values in the context of this request and printing out the form header, the widgets, and the form footer |
protected void |
doHead(Context context)
Output my HTML HEAD section, up to but not including the closing /HEAD tag. |
protected void |
doHeadBodySep(Context context)
Output the close of the head tag and the opening of the body tag. |
protected Context |
fixupMagicValues(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Fix up the magic values stored on the context by this class |
Document |
generate(Context context)
Deprecated. this is the future, but it isn't finished yet; expect some changes to the interface definition and XML |
Layout |
getLayout(Context context)
Return my layout engine for this context. |
java.lang.String |
getNextActionURL(Context context)
Return my action: a method, to allow for specialisation. |
WidgetSet |
getSelectedWidgetSet(Context context)
return the widget set in use. |
protected java.lang.String |
getTitle(Context context)
return a suitable title for this service of this form |
java.lang.String |
getTransformURL(Context context)
get the URL of my preferred XSL transform as a String. |
protected WidgetSet |
getWidgetSetByName(java.lang.String name)
Return, strictly, my first widget set with this name |
protected void |
handleAction(Context context)
The action despatcher. |
boolean |
hasWidgets()
Do I already have widgets? |
void |
init(Context config)
Basic initialisation, taking my configuration from this Context. |
protected void |
makeReady(Context context)
Second-stage initialisation hook. |
protected void |
postForm(Context context)
Layout material which appears in the page below the main form area. |
protected void |
postProcess(Context context)
perform any processing of the contents of the context which has been passed back by the application, prior to passing it on to the user. |
protected void |
preForm(Context context)
Do any arbitrary processing after the body of the page has been set up but before emitting the form; default lists the validation whinges |
protected void |
preProcess(Context context)
perform any processing of the contents of the context which has been passed in by the user, prior to passing it on to application layer processing. |
WidgetSet |
selectNextWidgetSet(Context context,
Context whinges)
Return the widget set which puts in the highest bid. |
protected void |
setContextMenuQuery(Context context,
java.lang.String name,
java.lang.String query)
set the query used by this menu in this context to this |
| Methods inherited from class uk.co.weft.htform.Page |
doFoot, doFoot, generateContent, getFootInclude, getFootIncludeURL, getFootIncludeURL, getHeadInclude, getHeadIncludeURL, getHeadIncludeURL, getStylesheet, getStylesheets, getTables, getTitle, outputRedirectBlock, readStringFromURL |
| Methods inherited from class uk.co.weft.htform.WithExceptionHandlerServlet |
whinge, whinge, whinge |
| Methods inherited from class uk.co.weft.htform.Servlet |
addCookie, addCookie, coerceCookiesToContext, coerceToContext, coerceToContext, coerceToContext, coerceToContext, coerceToUrl, createContext, doGet, doPost, getCalendar, getContentType, getDebug, getLocale, getOutputStream, getResource, getResourceString, getServletInfo, grs, grs, handleCookies, handleRedirect, init, setCookieValues, storeOnSession |
| Methods inherited from class uk.co.weft.maybeupload.MaybeUploadServlet |
doDelete, doHead, doOptions, doPut, doTrace, getUploadDir, getUploadURL, service |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface uk.co.weft.domutil.DocumentGenerator |
destroy |
| Field Detail |
public static final java.lang.String SUBMITMETHODCONFIGTOKEN
public static final java.lang.String SUBMITMETHODGET
public static final java.lang.String SUBMITMETHODPOST
public static final java.lang.String CONTEXTMENUMAGICTOKEN
public static final java.lang.String SELECTEDWIDGETSETMAGICTOKEN
public static final java.lang.String ONLOADFUNCTIONTOKEN
public static final java.lang.String VALIDATIONWHINGETOKEN
public static java.lang.String ACTIONEXECUTEDTOKEN
public static final java.lang.String CSSPROMPT
public static final java.lang.String CSSHELP
public static final java.lang.String contextMenuMagicToken
public static final java.lang.String selectedWidgetSetMagicToken
public static final java.lang.String onloadFunctionToken
public static final java.lang.String validationWhingeToken
public static final java.lang.String cssPrompt
public static final java.lang.String cssHelp
public static java.lang.String actionExecutedToken
protected static java.lang.String defaultScriptBase
public static int MIN_WIDGETS
protected java.lang.String action
protected java.lang.String mandatoryPrompt
protected java.lang.String optionalPrompt
protected java.lang.String submitMethod
protected java.lang.String whingeHeader
protected java.util.Vector auxiliaries
protected java.util.Vector widgetSets
protected WidgetSet widgets
protected boolean showHeadline
| Constructor Detail |
public Form()
| Method Detail |
public Layout getLayout(Context context)
throws javax.servlet.ServletException
getLayout in class Pagecontext - is passed because later we may want to use different
layout engines for different browsers (or, conceivably,
different levels of security clearance or whatever)
javax.servlet.ServletExceptionLayout
public java.lang.String getNextActionURL(Context context)
throws java.lang.Exception
java.lang.Exceptionpublic WidgetSet getSelectedWidgetSet(Context context)
context - the context in which we're looking for the widget set
public java.lang.String getTransformURL(Context context)
throws GenerationException
getTransformURL in interface DocumentGeneratorcontext - the context for the present service
GenerationException
public Document generate(Context context)
throws java.lang.Exception
generate in interface DocumentGeneratorjava.lang.Exceptionpublic boolean hasWidgets()
public void init(Context config)
throws InitialisationException
init in interface DocumentGeneratorinit in class PageInitialisationException
public WidgetSet selectNextWidgetSet(Context context,
Context whinges)
throws java.lang.Exception
context - the context for this servicewhinges - a context for collecting exceptions thrown by widgets;
the keys should be the names of widgets throwing exceptions,
the values the exceptions thrown
java.lang.Exception
protected void setContextMenuQuery(Context context,
java.lang.String name,
java.lang.String query)
context - the contextname - the name of the menu widget whose menu is being setquery - the query to use in this contextprotected java.lang.String getTitle(Context context)
getTitle in class Pagecontext - the context for this service
protected WidgetSet getWidgetSetByName(java.lang.String name)
protected Auxiliary addAuxiliary(Auxiliary aux)
protected Widget addWidget(Widget w)
throws InitialisationException
InitialisationException
protected void defaultActionHandler(Context context,
Context whinges)
throws java.lang.Exception
context - the context for this servicewhinges - a context for collecting exceptions thrown by widgets;
the keys should be the names of widgets throwing exceptions,
the values the exceptions thrown
java.lang.Exception
protected void doBody(Context context)
throws java.lang.Exception
doBody in class Pagejava.lang.Exception
protected void doHead(Context context)
throws java.lang.Exception
doHead in class Pagejava.lang.Exception
protected void doHeadBodySep(Context context)
throws java.lang.Exception
doHeadBodySep in class Pagejava.lang.Exception
protected Context fixupMagicValues(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
fixupMagicValues in class Servletcontext - the context in which the values are to be fixedrequest - the request for this serviceresponse - the response to this request
protected void handleAction(Context context)
throws java.lang.Exception
handleAction in class Servletcontext - the context for this service
java.lang.ExceptionhandleAction(uk.co.weft.dbutil.Context)
protected void makeReady(Context context)
throws DataStoreException,
javax.servlet.ServletException
makeReady in class Servletcontext - my first context.
DataStoreException
javax.servlet.ServletException
protected void postForm(Context context)
throws java.lang.Exception
java.lang.Exception
protected void postProcess(Context context)
throws DataStoreException,
javax.servlet.ServletException
context - the context in which this response is being generated
doesn - 't really throw any exceptions but things which
specialise it may want to.
DataStoreException
javax.servlet.ServletException
protected void preForm(Context context)
throws java.lang.Exception
java.lang.Exception
protected void preProcess(Context context)
throws DataStoreException,
javax.servlet.ServletException
context - the context in which this response is being generated
doesn't - really throw any exceptions but things which
specialise it may want to.
DataStoreException
javax.servlet.ServletException
|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||