|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.melati.servlet.ConfigServlet org.melati.servlet.PoemServlet org.melati.servlet.TemplateServlet org.melati.admin.Admin
public class Admin
Melati template servlet for database administration.
This class defines doTemplateRequest(Melati, ServletTemplateContext)
and methods it calls to interpret requests, depending on the current table
and object, if any.
Java methods with names ending "Template
" and taking a
ServletTemplateContext
and Melati
as arguments are generally
called by doTemplateRequest(Melati, ServletTemplateContext)
) to
implement corresponding request methods.
modifyTemplate(ServletTemplateContext, Melati)
and associated
methods are slight variations.
adminTemplate(String)
is called in all cases
to return the template path. The name of the template is usually the same as
the request method but not if the same template is used for more than one
method or the template served depends on how request processing proceeds.
These methods are called to modify the context:
TODO Review working of where clause for dates TODO Move Nav icons into PrimarySelect TODO Make Chooser JS agnostic TODO Make Navigation JS agnostic TODO Logout fails to work if remember me is ticked TODO Order by field f orders on fields troid, not field ordering TODO Enable non-paged output of selection by adding paged parameter to selectionTemplate FIXME primaryDisplayTable should not be static as this messes with DB switching
Field Summary |
---|
Fields inherited from class org.melati.servlet.TemplateServlet |
---|
templateEngine |
Fields inherited from class org.melati.servlet.ConfigServlet |
---|
melatiConfig, sysAdminEmail, sysAdminName |
Constructor Summary | |
---|---|
Admin()
|
Method Summary | |
---|---|
protected static String |
addTemplate(ServletTemplateContext context,
Melati melati)
Returns the Add template after placing the table and fields for the new row in the context using any field values already in the context. |
protected static String |
addUpdateTemplate(ServletTemplateContext context,
Melati melati)
Returns the Updated template after creating a new row using field data in the context. |
protected static String |
adminTemplate(String name)
Return the resource path for an admin template. |
protected static Persistent |
create(Table table,
ServletTemplateContext context)
Creates a row for a table using field data in a template context. |
protected static String |
deleteTemplate(ServletTemplateContext context,
Melati melati)
|
protected String |
doTemplateRequest(Melati melati,
ServletTemplateContext context)
Override this method to build up your own output. |
protected static String |
dsdTemplate(ServletTemplateContext context)
|
protected static String |
duplicateTemplate(ServletTemplateContext context,
Melati melati)
|
protected static String |
modifyTemplate(ServletTemplateContext context,
Melati melati)
Implements request method "Update". |
protected static ServletTemplateContext |
popupSelect(ServletTemplateContext context,
Melati melati)
|
protected static String |
popupSelectTemplate(ServletTemplateContext context,
Melati melati)
Implements the field search/selection request method. |
protected static String |
primarySelectTemplate(ServletTemplateContext context,
Melati melati)
|
protected static ServletTemplateContext |
selection(ServletTemplateContext context,
Melati melati,
boolean paged)
Modifies the context in preparation for serving a template to view a selection of rows. |
protected static String |
selectionRightTemplate(ServletTemplateContext context,
Melati melati)
Implements request to display a selection of records from a table in the right hand pane. |
protected static String |
selectionTemplate(ServletTemplateContext context,
Melati melati)
Return template for a selection of records from a table. |
protected static String |
selectionWindowPrimarySelectTemplate(ServletTemplateContext context,
Melati melati)
|
protected static String |
selectionWindowSelectionTemplate(ServletTemplateContext context,
Melati melati)
|
protected static String |
setupTemplate(ServletTemplateContext context,
Melati melati)
|
protected static String |
updateTemplate(ServletTemplateContext context,
Melati melati)
Returns the Updated template after modifying the current row according to field values in the context. |
protected static String |
uploadDoneTemplate(ServletTemplateContext context)
Finished uploading. |
protected static String |
uploadTemplate(ServletTemplateContext context)
|
Methods inherited from class org.melati.servlet.TemplateServlet |
---|
addExtension, doPoemRequest, error, init, prePoemSession |
Methods inherited from class org.melati.servlet.PoemServlet |
---|
_handleException, destroy, doConfiguredRequest, getSysAdminEmail, getSysAdminName, handleException, poemContext, poemContextWithLDB |
Methods inherited from class org.melati.servlet.ConfigServlet |
---|
doGet, doPost, httpStatusCode, melatiConfig, setSysAdminEmail, setSysAdminName, writeConnectionPendingException, writeError |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Admin()
Method Detail |
---|
protected static Persistent create(Table table, ServletTemplateContext context)
protected static String adminTemplate(String name)
protected static String dsdTemplate(ServletTemplateContext context)
protected static String primarySelectTemplate(ServletTemplateContext context, Melati melati) throws PoemException
PoemException
protected static String selectionTemplate(ServletTemplateContext context, Melati melati)
protected static String selectionRightTemplate(ServletTemplateContext context, Melati melati)
protected static ServletTemplateContext selection(ServletTemplateContext context, Melati melati, boolean paged)
Any form fields in the context with names starting "field_" are assumed to hold values that must be matched in selected rows (if not null).
An encoding of the resulting whereClause is added to the context. "AND" is replaced by an & separator.
A form field with name "start" is assumed to hold the number of the start row in the result set. The default is zero. The next 20 rows are selected and added as to the context as "results".
protected static String popupSelectTemplate(ServletTemplateContext context, Melati melati) throws PoemException
PoemException
protected static ServletTemplateContext popupSelect(ServletTemplateContext context, Melati melati) throws PoemException
PoemException
protected static String selectionWindowPrimarySelectTemplate(ServletTemplateContext context, Melati melati) throws PoemException
PoemException
protected static String selectionWindowSelectionTemplate(ServletTemplateContext context, Melati melati)
protected static String addTemplate(ServletTemplateContext context, Melati melati) throws PoemException
PoemException
protected static String addUpdateTemplate(ServletTemplateContext context, Melati melati) throws PoemException
If successful the template will say so while reloading according to the returnTarget and returnURL values from the Form in context.
PoemException
protected static String updateTemplate(ServletTemplateContext context, Melati melati) throws PoemException
If successful the template will say so while reloading according to the returnTarget and returnURL values from the Form in context.
PoemException
protected static String deleteTemplate(ServletTemplateContext context, Melati melati) throws PoemException
PoemException
protected static String duplicateTemplate(ServletTemplateContext context, Melati melati) throws PoemException
PoemException
protected static String modifyTemplate(ServletTemplateContext context, Melati melati) throws FormParameterException
Calls another method depending on the requested action.
FormParameterException
updateTemplate(ServletTemplateContext, Melati)
,
deleteTemplate(ServletTemplateContext, Melati)
,
duplicateTemplate(ServletTemplateContext, Melati)
protected static String uploadTemplate(ServletTemplateContext context) throws PoemException
PoemException
protected static String uploadDoneTemplate(ServletTemplateContext context) throws PoemException
context
- the ServletTemplateContext
in use
PoemException
protected static String setupTemplate(ServletTemplateContext context, Melati melati)
protected String doTemplateRequest(Melati melati, ServletTemplateContext context) throws Exception
TemplateServlet
doTemplateRequest
in class TemplateServlet
melati
- the current Melaticontext
- the current ServletTemplateContext
Exception
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |