jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.htform
Class QueryByExampleList

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byuk.co.weft.maybeupload.MaybeUploadServlet
              extended byuk.co.weft.htform.Servlet
                  extended byuk.co.weft.htform.WithExceptionHandlerServlet
                      extended byuk.co.weft.htform.Page
                          extended byuk.co.weft.htform.Form
                              extended byuk.co.weft.htform.AuthenticatedForm
                                  extended byuk.co.weft.htform.List
                                      extended byuk.co.weft.htform.QueryByExampleList
All Implemented Interfaces:
DocumentGenerator, ResourceConsumer, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class QueryByExampleList
extends List

a list which enables query-by-example. In the long run this probably replaces the existing List servlet, as it is more powerful /and/ simpler. Note that the query_template parameter from List cannot be used; instead, the store and keymust be used. In addition to the configuration parameters known to List, this class knows about

key
String: the name of the key field in my store; optional, defaults to the value of action_field
store
String: the name of my data store. The store must exist in the database indicated by db_url in the service time context, although this need not be an SQL database. In an SQL database, it may be either a table or a view. Not optional, no default.

See Also:
Serialized Form

Field Summary
protected  boolean exact
          do I require an exact match?
protected  java.lang.String key
          the name of the keyfield in my data store
static java.lang.String KEYCONFIGTOKEN
          a token upon which I shall look in my configuration for the name of the keyfield in my data store
protected  java.lang.String store
          the name of my data store
static java.lang.String STORECONFIGTOKEN
          a token upon which I shall look in my configuration for the name of my data store
 
Fields inherited from class uk.co.weft.htform.List
action, actionField, ACTIONFIELDCONFIGTOKEN, ACTIONLABELCONFIGTOKEN, ACTIONURLCONFIGTOKEN, canAdd, CANADDBEFORECONFIGTOKEN, CANADDCONFIGTOKEN, CANSEARCHCONFIGTOKEN, clickToOrder, CLICKTOORDERCONFIGTOKEN, formatter, FORMATTERCLASSCONFIGTOKEN, formatterName, linkField, LINKFIELDCONFIGTOKEN, listQueryTemplate, lowerFn, LOWERFNCONFIGTOKEN, matchDelimEnd, matchDelimStart, matchOp, noDefaultList, NODEFAULTLISTCONFIGTOKEN, orderBy, ORDERBYMAGICTOKEN, QUERYTEMPLATECONFIGTOKEN, recogniseLinks, RECOGNISELINKSCONFIGTOKEN, RESULTSMAXROWSMAGICTOKEN, RESULTSOFFSETMAGICTOKEN, SEARCHEXACTCONFIGTOKEN, searchField, SEARCHFIELDCONFIGTOKEN, searchHelp, SEARCHHELPCONFIGTOKEN, searchPrompt, SEARCHPROMPTCONFIGTOKEN, SEARCHSETCOOKIECONFIGTOKEN, searchSize, SEARCHSIZECONFIGTOKEN, searchToken, SEARCHTOKENCONFIGTOKEN, searchw, showCanAddBefore, showHeaders, SHOWHEADERSCONFIGTOKEN, showId, SHOWIDCONFIGTOKEN, slots, SORTDIRECTIONMAGICTOKEN, SORTORDERDESCENDINGMAGICVALUE
 
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.Form
actionExecutedToken, ACTIONEXECUTEDTOKEN, auxiliaries, contextMenuMagicToken, CONTEXTMENUMAGICTOKEN, cssHelp, CSSHELP, cssPrompt, CSSPROMPT, defaultScriptBase, mandatoryPrompt, MIN_WIDGETS, onloadFunctionToken, ONLOADFUNCTIONTOKEN, optionalPrompt, selectedWidgetSetMagicToken, SELECTEDWIDGETSETMAGICTOKEN, showHeadline, submitMethod, SUBMITMETHODCONFIGTOKEN, SUBMITMETHODGET, SUBMITMETHODPOST, validationWhingeToken, VALIDATIONWHINGETOKEN, whingeHeader, widgets, widgetSets
 
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.htform.Servlet
calendar, conf, contentType, CONTENTTYPECONFIGTOKEN, cookieDomain, cookiePath, COOKIESCONFIGTOKEN, cookieTTL, dbPassword, dbUrl, dbUsername, debug, DEBUGCONFIGTOKEN, driverName, embedded, here, identity, localeMagicToken, LOCALEMAGICTOKEN, outputStreamMagicToken, OUTPUTSTREAMMAGICTOKEN, parsePathInfo, PATHINFOMAGICTOKEN, ready, redirectMagicToken, REDIRECTMAGICTOKEN, requestMagicToken, REQUESTMAGICTOKEN, resourceBundleName, responseMagicToken, RESPONSEMAGICTOKEN, servletMagicToken, SERVLETMAGICTOKEN, sessionMagicToken, SESSIONMAGICTOKEN, USEHTTPSCONFIGTOKEN, zone
 
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
QueryByExampleList()
           
 
Method Summary
protected  Contexts fetch(Context context)
          Specialisation: use dbutil match operator instead of SQL.
 void init(Context config)
          Specialisation: set up my additional configuration paramaters; reject configuration which contains query template
 
Methods inherited from class uk.co.weft.htform.List
getTitle, postForm
 
Methods inherited from class uk.co.weft.htform.AuthenticatedForm
login, logout
 
Methods inherited from class uk.co.weft.htform.Form
addAuxiliary, addWidget, defaultActionHandler, doBody, doHead, doHeadBodySep, fixupMagicValues, generate, getLayout, getNextActionURL, getSelectedWidgetSet, getTransformURL, getWidgetSetByName, handleAction, hasWidgets, makeReady, 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

STORECONFIGTOKEN

public static final java.lang.String STORECONFIGTOKEN
a token upon which I shall look in my configuration for the name of my data store

See Also:
Constant Field Values

KEYCONFIGTOKEN

public static final java.lang.String KEYCONFIGTOKEN
a token upon which I shall look in my configuration for the name of the keyfield in my data store

See Also:
Constant Field Values

key

protected java.lang.String key
the name of the keyfield in my data store


store

protected java.lang.String store
the name of my data store


exact

protected boolean exact
do I require an exact match?

Constructor Detail

QueryByExampleList

public QueryByExampleList()
Method Detail

fetch

protected Contexts fetch(Context context)
                  throws DataStoreException
Specialisation: use dbutil match operator instead of SQL.

Overrides:
fetch in class List
Parameters:
context - the service context
Returns:
the matching rows
Throws:
DataStoreException
See Also:
List.fetch(uk.co.weft.dbutil.Context)

init

public void init(Context config)
          throws InitialisationException
Specialisation: set up my additional configuration paramaters; reject configuration which contains query template

Specified by:
init in interface DocumentGenerator
Overrides:
init in class List
Parameters:
config -
Throws:
InitialisationException
See Also:
List.init(uk.co.weft.dbutil.Context)

jacquard 1.12.0 by The Web Engineering Factory and Toolworks