|
||||||||||
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 | +--pandora.CommandCtrl
Controller servlet used in combination with CommandBean (model) and command.jsp (view).
Copyright (c) 2002-2003 Alexis Grandemange
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License lesser.txt should be included in the distribution.
Field Summary | |
(package private) java.lang.String |
addr
Delivery information (office #, mail address, phone#...) |
(package private) javax.servlet.RequestDispatcher |
authDispatcher
Dispatcher to authError.html |
(package private) CommandBean |
cb
Model object |
(package private) CheckSandbox |
cs
To exercise the sandbox |
(package private) javax.servlet.ServletContext |
ctx
Unique to the Web application |
(package private) java.lang.String |
delivery
URL of the delivery Web service |
(package private) javax.servlet.RequestDispatcher |
dispatcher
Dispatcher to command.jsp |
(package private) PageBoxAPI |
inst
PageBox API instance |
(package private) PageBoxLib.LogIF |
log
Logging object |
(package private) java.lang.String |
payment
URL of the payment Web service |
private long |
period
Time between two publications |
static Publish |
publish
Thread that publishes updates on the central server |
(package private) java.lang.String |
user
User information (ID, name, billable account...) |
(package private) java.lang.String |
workDir
Directory where API.txt is defined |
Fields inherited from class javax.servlet.http.HttpServlet |
|
Fields inherited from class javax.servlet.GenericServlet |
|
Constructor Summary | |
CommandCtrl()
|
Method Summary | |
private java.lang.String |
add(java.lang.Integer id,
int qty)
Add a new row to a command. |
private boolean |
checkReferrer(javax.servlet.http.HttpServletRequest request)
Checks that the user and addr are stored in the session or were in request. |
private java.lang.String |
commit()
Write a command on the database. |
private CommandBean |
createCb()
Retrieves the article list from the article table and creates a CommandBean instance. |
private java.lang.String |
delete(java.lang.Integer id)
Delete a row from a command. |
void |
destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
GET request handling. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
POST request handling. |
void |
init(javax.servlet.ServletConfig config)
Invoked by Servlet container. |
private java.lang.String |
update(java.lang.Integer id,
int qty)
Change the number of items of a given article in a command. |
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 |
Field Detail |
javax.servlet.RequestDispatcher dispatcher
javax.servlet.RequestDispatcher authDispatcher
PageBoxAPI inst
PageBoxLib.LogIF log
CommandBean cb
java.lang.String user
java.lang.String addr
java.lang.String payment
java.lang.String delivery
public static Publish publish
java.lang.String workDir
javax.servlet.ServletContext ctx
CheckSandbox cs
private long period
Constructor Detail |
public CommandCtrl()
Method Detail |
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
config
- servlet configuration
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
private CommandBean createCb()
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
request
- HttpServletRequestresponse
- HttpServletResponse
javax.servlet.ServletException
java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
request
- HttpServletRequestresponse
- HttpServletResponse
javax.servlet.ServletException
java.io.IOException
private java.lang.String update(java.lang.Integer id, int qty)
id
- article IDqty
- number of items
private java.lang.String add(java.lang.Integer id, int qty)
id
- article IDqty
- number of items
private java.lang.String commit()
private java.lang.String delete(java.lang.Integer id)
id
- article ID
private boolean checkReferrer(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest
true if the user is authenticated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |