|
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.configurator.BasicConfigurator
A configurator is a servlet which knows about a war archive, a list of 'to be configured' files within that archive, and a list of configuration parameters. It shows a form of the configuration parameters, allows the user to supply values, unpacks the war file in temporary space, makes the substitutions, repacks the war archive, and delivers it over the HTTP connection. There is at present one magic paramater, appname, which must be in the parameters file because it controls the name of the war file which gets built.
To specialise this class it should be sufficient to specialise the method validate( Context), q.v.
| Nested Class Summary | |
protected class |
BasicConfigurator.ConfiguredWidgetSet
a widget set to be selected when the configured package is available in the stageing area |
protected class |
BasicConfigurator.ConfigureWidget
|
| Field Summary | |
static java.lang.String |
APPNAMETOKEN
token for the name of the webapp I am to buils |
static java.lang.String |
CACHENAME
the name of the directory within the stage in which I unpack the payload |
static java.lang.String |
CONFIGURATIONTAG
the configuration tag |
static java.lang.String |
DEFAULTATTR
the default value attibute of the parameter tag |
static java.lang.String |
DELIVERYPACKAGEURLTOKEN
token for the URL of the configured package for delivery |
static java.lang.String |
DESTINATIONATTR
the destination attribute of the file tag |
static java.lang.String |
FILETAG
the file tag |
static java.lang.String |
HELPTAG
the help tag - child of parameter tag |
protected Element |
intro
An XML element whose value should be printed out as my introductory material; may include HTML markup. |
static java.lang.String |
INTROTAG
the intro tag |
static java.lang.String |
MANDATORYATTR
the mandatory attribute of the parameter tag |
static java.lang.String |
NAMEATTR
the name attribute of the parameter tag |
static java.lang.String |
NOAMPERSANDVALUESTOKEN
token whose value in the config should be a space separated list of tokens whose values in the service time context should be checked for unescaped ampersands - any found which are not already part of recognisable XML entities being replaced by &. |
static java.lang.String |
OPTIONTAG
the option tag - child of parameter tag |
static java.lang.String |
PARAMETERTAG
the parameter tag |
static java.lang.String |
PARAMSTOKEN
token for the full or relative pathname or URL of the file from which I will read parameters |
protected java.lang.String |
payloadName
name of my payload |
static java.lang.String |
PAYLOADNAMETOKEN
token for the name (perhaps including version number) of the payload I'm delivering |
protected java.lang.String |
payloadPath
location of my payload. |
static java.lang.String |
PAYLOADTOKEN
token for the full or relative pathname or url of the war archive which is my payload |
static java.lang.String |
PROMPTATTR
the prompt attribute of the parameter tag |
static java.lang.String |
SIZEATTR
the size attribute of the parameter tag |
static java.lang.String |
SOURCEATTR
the source attribute of the file tag |
protected java.lang.String |
stagePath
location of my staging area. |
static java.lang.String |
STAGINGAREATOKEN
token for the full or relative path name of the directory where we unpack and repack our payload |
static java.lang.String |
TITLETAG
the title tag |
| 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 | |
BasicConfigurator()
|
|
| Method Summary | |
protected void |
configure(Context context)
actually do the work. |
protected void |
deleteDir(java.io.File target)
delete the file, or, recursively, the directory, passed as argument |
protected java.io.File |
fetchPayload(java.io.File dir)
fetch my payload into the specified directory and unpack it there |
protected java.lang.String |
fixXMLSyntaxChars(java.lang.String tofix)
fix any XML syntax chars in tofix with the appropriate entities - unless they are themselves part of entities. |
protected java.util.Vector |
getParameters(Context config)
Parse my parameters file, and return explicitly a list of my parameters. |
void |
init(Context config)
Read my config and set up my widgets |
protected void |
patchFile(java.lang.String sourcepath,
java.lang.String destpath,
Context context)
patch the specified file by substituting the user-supplied values |
protected void |
preForm(Context context)
Say what we're currently delivering |
protected void |
preProcess(Context context)
Check tokens listed in NOAMPERSANDVALUESTOKEN for unprotected ampersands - useful for things which will be output in [X|HT]ML documents |
protected void |
repack(Context context,
java.io.File dir)
repack the contents of the specified directory into a WAR archive file |
protected boolean |
validate(Context context)
determine whether or not to configure using this context. |
protected java.net.URL |
validatePayload(Context config)
return a URL (possibly a file URL) for my payload, ideally having checked it exists and seems to be the right sort of thing |
protected java.io.File |
validateStage(Context config)
validate that my stage exists, is a directory, and is writable by me; return it as a File. |
| Methods inherited from class uk.co.weft.htform.Form |
addAuxiliary, addWidget, defaultActionHandler, doBody, doHead, doHeadBodySep, fixupMagicValues, generate, getLayout, getNextActionURL, getSelectedWidgetSet, getTitle, getTransformURL, getWidgetSetByName, handleAction, hasWidgets, makeReady, postForm, postProcess, 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 CACHENAME
public static final java.lang.String PARAMSTOKEN
public static final java.lang.String PAYLOADTOKEN
public static final java.lang.String PAYLOADNAMETOKEN
public static final java.lang.String APPNAMETOKEN
public static final java.lang.String STAGINGAREATOKEN
public static final java.lang.String DELIVERYPACKAGEURLTOKEN
public static final java.lang.String NOAMPERSANDVALUESTOKEN
public static final java.lang.String CONFIGURATIONTAG
public static final java.lang.String FILETAG
public static final java.lang.String HELPTAG
public static final java.lang.String INTROTAG
public static final java.lang.String OPTIONTAG
public static final java.lang.String PARAMETERTAG
public static final java.lang.String TITLETAG
public static final java.lang.String DEFAULTATTR
public static final java.lang.String DESTINATIONATTR
public static final java.lang.String MANDATORYATTR
public static final java.lang.String NAMEATTR
public static final java.lang.String PROMPTATTR
public static final java.lang.String SIZEATTR
public static final java.lang.String SOURCEATTR
protected Element intro
protected java.lang.String payloadName
protected java.lang.String payloadPath
protected java.lang.String stagePath
| Constructor Detail |
public BasicConfigurator()
| Method Detail |
public void init(Context config)
throws InitialisationException
init in interface DocumentGeneratorinit in class FormInitialisationException
protected java.util.Vector getParameters(Context config)
throws InitialisationException
config - the configuration of this servlet.
InitialisationException
protected void configure(Context context)
throws java.lang.Exception
java.lang.Exceptionprotected void deleteDir(java.io.File target)
target - the file or directory to delete
protected java.io.File fetchPayload(java.io.File dir)
throws java.io.IOException
dir - the directory into which I unpack
java.io.IOException - if anyhing failsprotected java.lang.String fixXMLSyntaxChars(java.lang.String tofix)
tofix - the string to be fixed.
protected void patchFile(java.lang.String sourcepath,
java.lang.String destpath,
Context context)
throws SubstitutionException
sourcepath - the name of the file to patchdestpath - where to store the processed filecontext - a context containing the substitutions to make
java.io.IOException - if anything goes wrong
SubstitutionException
protected void preForm(Context context)
throws java.lang.Exception
preForm in class Formjava.lang.Exception
protected void preProcess(Context context)
throws DataStoreException,
javax.servlet.ServletException
preProcess in class Formcontext - the context in which this response is being generated
DataStoreException
javax.servlet.ServletException
protected void repack(Context context,
java.io.File dir)
throws java.io.IOException
dir - the directory to pack
java.io.IOException - if anything goes wrong
protected boolean validate(Context context)
throws ConfigurationException
If you are satisfied with the context and wish the configuration to go ahead, return true. Otherwise, do not return false - instead, throw a ConfigurationException with your reason in the message. Otherwise your users will not know what is wrong.
context - the service context, containing values for all the
configuration parameters
ConfigurationException - if you consider the context is not
valid.
protected java.net.URL validatePayload(Context config)
throws InitialisationException
config - my servlet configuration
InitialisationException - if it can't be found
protected java.io.File validateStage(Context config)
throws InitialisationException
config - my servlet configuration
InitialisationException - if it can't be found or isn't
writable
|
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 | |||||||||