|
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
uk.co.weft.htform.AuthenticatedForm
uk.co.weft.htform.TableWrapperForm
An HTML form wrapped around a single database table to allow editing of individual records. The basic component of a database editing suite. 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:
allow_delete is false,
confirm_before_delete is inoperative. Optional. Defaults to
true.
| Field Summary | |
protected boolean |
allowDelete
Whether the data item I represent can be deleted |
protected boolean |
confirmBeforeDelete
Whether or not to use two-stage 'confirmed' delete |
static java.lang.String |
confirmDeletionToken
Deprecated. use CONFIRMDELETIONTOKEN |
static java.lang.String |
CONFIRMDELETIONTOKEN
a magic token to select the really delete stuff |
static java.lang.String |
deletedToken
Deprecated. use DELETEDTOKEN |
static java.lang.String |
DELETEDTOKEN
The magic token to say we've deleted the context |
protected ActionWidget |
deleteWidget
The delete widget, created at instantiation time. |
protected java.lang.String |
identField
a field in this table with user-identifying information |
protected Widget |
identWidget
A hidden widget to pass through my identifier. |
protected java.lang.String |
keyField
the primary key field in this table |
protected WidgetSet |
maybeDeleteWidgets
An alternate set of widgets to be used for deletion if we use two-stage |
protected java.lang.String |
onDropRedirect
The URL to redirect to following a successful drop |
static java.lang.String |
ONDROPREDIRECTCONFIGTOKEN
A token on which I shall look in my configuration for a URL to redirect to following a successful store |
protected java.lang.String |
onStoreRedirect
The URL to redirect to following a successful store |
static java.lang.String |
ONSTOREREDIRECTCONFIGTOKEN
A token on which I shall look in my configuration for a URL to redirect to following a successful store |
static java.lang.String |
storedToken
Deprecated. use STOREDTOKEN |
static java.lang.String |
STOREDTOKEN
The magic token to say we've stored the context |
static java.lang.String |
STOREFAILEDTOKEN
The magic tokent to say we've failed to store the context |
static java.lang.String |
storeFailToken
Deprecated. use STOREFAILEDTOKEN |
protected java.lang.String |
table
the table this form populates. |
protected TableDescriptor |
tableDescriptor
a descriptor for that table |
protected ActionWidget |
updateWidget
The update widget, created at instantiation time. |
| Fields inherited from class uk.co.weft.htform.AuthenticatedForm |
allowLogout, ALLOWLOGOUTCONFIGTOKEN, AUTHENTICATEDUSERMAGICTOKEN, authenticator, AUTHENTICATORCLASSMAGICTOKEN, authentificationWidgets, logoutPrompt, LOGOUTPROMPTCONFIGTOKEN, logoutWidget, onLogoutRedirect |
| 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 | |
TableWrapperForm()
|
|
| Method Summary | |
protected void |
defaultActionHandler(Context context,
Context whinges)
The default action of a table wrapper form is to fetch the data for the current record from its table, provided there is a value for keyField in the context and the authenticator is happy. |
protected void |
drop(Context context)
Wrap the deletion of objects in a method so that it can be specialised to do any tidy-up e.g. |
protected void |
drop(Context context,
java.lang.Object id,
java.util.Stack queries)
a wrapper round drop to allow an arbitrary number of SQL queries to be evaluated first -- intended to allow the dropping of link-table or dependent records. |
protected void |
drop(Context context,
java.lang.Object id,
java.lang.String query)
a wrapper round drop to allow an arbitrary SQL query to be evaluated first -- intended to allow the dropping of link-table or dependent records. |
protected void |
fetch(Context context)
Pull my values out of the database and use them to populate me. |
protected TableDescriptor |
getDescriptor(Context c)
Get my table descriptor, first caching it if necessary. |
protected java.lang.String |
getTitle(Context context)
construct and return a suitable title for this form. |
protected java.lang.String |
identify(Context context)
produce a string identifying this record, by printing the value of the field indicated by the identField iv. |
protected java.lang.Object |
inferKey(Context context)
find the value of my keyfield in the context; if it's not in the context itself then assume what's in the pathinfo part is the keyfield, possibly with '.html' appended. |
void |
init(Context config)
My initialiser; sets up the Id widget. |
protected void |
logout(Context c)
Set my keyfield value to null so that I don't try to refetch values from the database over my now non-existent connection |
protected void |
makeReady(Context context)
Nasty gotcha: we create the identity widget in init, at which time we don't know the name of the key field, because sub-class inits may call superclass inits first... |
protected boolean |
store(Context context)
Store the current context into my table descriptor. |
protected boolean |
store(Context context,
java.sql.Connection db)
Store the current context into my table descriptor. |
| Methods inherited from class uk.co.weft.htform.AuthenticatedForm |
login |
| Methods inherited from class uk.co.weft.htform.Form |
addAuxiliary, addWidget, doBody, doHead, doHeadBodySep, fixupMagicValues, generate, getLayout, getNextActionURL, getSelectedWidgetSet, getTransformURL, getWidgetSetByName, handleAction, hasWidgets, postForm, postProcess, preForm, preProcess, selectNextWidgetSet, setContextMenuQuery |
| 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 CONFIRMDELETIONTOKEN
public static final java.lang.String STOREDTOKEN
public static final java.lang.String STOREFAILEDTOKEN
public static final java.lang.String DELETEDTOKEN
public static final java.lang.String confirmDeletionToken
public static final java.lang.String storedToken
public static final java.lang.String storeFailToken
public static final java.lang.String deletedToken
public static final java.lang.String ONSTOREREDIRECTCONFIGTOKEN
public static final java.lang.String ONDROPREDIRECTCONFIGTOKEN
protected ActionWidget deleteWidget
super.init()
protected ActionWidget updateWidget
super.init()
protected java.lang.String identField
protected java.lang.String keyField
protected java.lang.String onDropRedirect
protected java.lang.String onStoreRedirect
protected java.lang.String table
protected TableDescriptor tableDescriptor
protected Widget identWidget
protected WidgetSet maybeDeleteWidgets
protected boolean allowDelete
protected boolean confirmBeforeDelete
| Constructor Detail |
public TableWrapperForm()
| Method Detail |
public void init(Context config)
throws InitialisationException
init in interface DocumentGeneratorinit in class AuthenticatedFormInitialisationException
protected TableDescriptor getDescriptor(Context c)
throws DataStoreException,
javax.servlet.ServletException
DataStoreException
javax.servlet.ServletExceptionprotected java.lang.String getTitle(Context context)
getTitle in class Form
protected void defaultActionHandler(Context context,
Context whinges)
throws java.lang.Exception
defaultActionHandler in class Formcontext - 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 drop(Context context)
throws DataStoreException,
javax.servlet.ServletException
DataStoreException
javax.servlet.ServletException
protected void drop(Context context,
java.lang.Object id,
java.lang.String query)
throws DataStoreException,
javax.servlet.ServletException
DataStoreException
javax.servlet.ServletException
protected void drop(Context context,
java.lang.Object id,
java.util.Stack queries)
throws DataStoreException,
javax.servlet.ServletException
context - the context in which this drop is being performedid - the id of the object to be droppedqueries - a stack of SQL queries to be executed before the drop is
performed. If any of the queries passed fails, the drop will
be aborted and a DataFormatException thrown.
throws - a DataFormatException if any of the passed queries
fails; the drop has been aborted.
throws - a DataStoreException if the delete fails or any other
more general database failure occurs
DataStoreException
javax.servlet.ServletException
protected void fetch(Context context)
throws DataStoreException,
javax.servlet.ServletException
context - the context for this service
DataStoreException - usually indicates user is not logged in
javax.servlet.ServletExceptionprotected java.lang.String identify(Context context)
protected java.lang.Object inferKey(Context context)
context - the context of this service
protected void logout(Context c)
logout in class AuthenticatedForm
protected void makeReady(Context context)
throws DataStoreException,
javax.servlet.ServletException
makeReady in class FormDataStoreException
javax.servlet.ServletException
protected boolean store(Context context)
throws DataStoreException,
javax.servlet.ServletException
context - a Context containing the data to store
DataStoreException
javax.servlet.ServletException
protected boolean store(Context context,
java.sql.Connection db)
throws DataStoreException,
javax.servlet.ServletException
context - a Context containing the data to storedb - a database connection for transactions
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 | |||||||||