| 
 | |||||||||
| 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
org.melati.servlet.ConfigServlet
org.melati.servlet.PoemServlet
org.melati.servlet.TemplateServlet
org.paneris.melati.shopping.Trolley
public class Trolley
A servlet that handles the user's interaction with the Shopping Trolley.
ShoppingTrolley, 
ShoppingTrolleyItem, 
DefaultShoppingTrolley, 
DefaultShoppingTrolleyItem, 
Serialized Form| Field Summary | |
|---|---|
|  MelatiShoppingConfig | config | 
| Fields inherited from class org.melati.servlet.TemplateServlet | 
|---|
| templateEngine | 
| Fields inherited from class org.melati.servlet.ConfigServlet | 
|---|
| melatiConfig, sysAdminEmail, sysAdminName | 
| Constructor Summary | |
|---|---|
| Trolley() | |
| Method Summary | |
|---|---|
| protected  java.lang.String | Abandon(org.melati.Melati melati)Abandon a trolley. | 
| protected  java.lang.String | Add(org.melati.Melati melati,
    java.lang.Integer id,
    double quantity)Add a single item to the trolley, or add to the quantity already in the trolley. | 
| protected  void | assertLogin(org.melati.Melati melati)Force a user to login. | 
| protected  java.lang.String | Confirm(org.melati.Melati melati)Update the user's information and return the confirmation page. | 
| protected  java.lang.String | Details(org.melati.Melati melati)Return the page where the user enters their details. | 
| protected  java.lang.String | doTemplateRequest(org.melati.Melati melati,
                  org.melati.template.ServletTemplateContext context)Main entry point for this servlet. | 
|  void | init(javax.servlet.ServletConfig conf)Inititialise the Shopping Trolley Engine. | 
| protected  java.lang.String | Load(org.melati.Melati melati,
     java.lang.Integer id)Load the trolley from something persistent. | 
| protected  java.lang.String | MultipleAdd(org.melati.Melati melati)Add multiple items to the trolley, or add to the quantities already in the trolley. | 
| protected  java.lang.String | Paid(org.melati.Melati melati)Complete the user's shopping experience, and remove their Shopping Trolley from the Session. | 
| protected  org.melati.PoemContext | poemContext(org.melati.Melati melati)Override the building of the PoemContext in order to glean the additional information required for the Shopping Trolley system. | 
| protected  java.lang.String | Remove(org.melati.Melati melati,
       java.lang.Integer id)Remove a single item from the trolley, the product is specified on the pathinfo which should be of the form: / | 
| protected  java.lang.String | Save(org.melati.Melati melati)Load the trolley from something persistent. | 
| protected  java.lang.String | Set(org.melati.Melati melati,
    java.lang.Integer id,
    double quantity)Set the quantity of an item in the trolley, the product and new quantity is specified on the pathinfo which should be of the form: / | 
| protected  java.lang.String | shoppingTemplate(org.melati.Melati melati,
                 java.lang.String name)Create the full name of the template to be returned. | 
| protected  java.lang.String | Update(org.melati.Melati melati)Update the entire trolley, changing quantities and removing items. | 
| protected  java.lang.String | View(org.melati.Melati melati)View the trolley. | 
| Methods inherited from class org.melati.servlet.TemplateServlet | 
|---|
| addExtension, doPoemRequest, error, prePoemSession | 
| Methods inherited from class org.melati.servlet.PoemServlet | 
|---|
| _handleException, dbBusyMessage, destroy, doConfiguredRequest, getSysAdminEmail, getSysAdminName, handleException, poemContextWithLDB | 
| Methods inherited from class org.melati.servlet.ConfigServlet | 
|---|
| doGet, doPost, 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 | 
| Field Detail | 
|---|
public MelatiShoppingConfig config
| Constructor Detail | 
|---|
public Trolley()
| Method Detail | 
|---|
public void init(javax.servlet.ServletConfig conf)
          throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class org.melati.servlet.TemplateServletconf - - the Servlet's config parameters
javax.servlet.ServletExceptionMelatiShoppingConfig
protected java.lang.String doTemplateRequest(org.melati.Melati melati,
                                             org.melati.template.ServletTemplateContext context)
                                      throws java.lang.Exception
doTemplateRequest in class org.melati.servlet.TemplateServletmelati - - the melati for this requestcontext - - the Template Context for this request
org.melati.servlet.InvalidUsageException - - if this request has an invalid form
java.lang.Exception
protected java.lang.String Load(org.melati.Melati melati,
                                java.lang.Integer id)
                         throws org.melati.util.InstantiationPropertyException
melati - - the melati for this requestid - - an id that can be used to identify the trolley to be loaded
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Save(org.melati.Melati melati)
                         throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String View(org.melati.Melati melati)
                         throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - if we cannot construct the trolley
protected java.lang.String Update(org.melati.Melati melati)
                           throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - if we cannot construct the trolley
protected java.lang.String MultipleAdd(org.melati.Melati melati)
                                throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Add(org.melati.Melati melati,
                               java.lang.Integer id,
                               double quantity)
                        throws org.melati.util.InstantiationPropertyException
melati - - the melati for this requestid - - the id of the item to be added
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Remove(org.melati.Melati melati,
                                  java.lang.Integer id)
                           throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Set(org.melati.Melati melati,
                               java.lang.Integer id,
                               double quantity)
                        throws org.melati.util.InstantiationPropertyException
melati - - the melati for this requestid - - the id of the item to be removed
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Details(org.melati.Melati melati)
                            throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Confirm(org.melati.Melati melati)
                            throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Paid(org.melati.Melati melati)
                         throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected java.lang.String Abandon(org.melati.Melati melati)
                            throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException - - if we cannot construct trolley
protected void assertLogin(org.melati.Melati melati)
                    throws org.melati.util.InstantiationPropertyException
melati - - the melati for this request
org.melati.util.InstantiationPropertyException
protected java.lang.String shoppingTemplate(org.melati.Melati melati,
                                            java.lang.String name)
melati - - the melati for this request (not used)name - - the name of the template
protected org.melati.PoemContext poemContext(org.melati.Melati melati)
                                      throws org.melati.servlet.PathInfoException
poemContext in class org.melati.servlet.PoemServletmelati - - the melati for this request
org.melati.servlet.PathInfoException - - if we don't understand the PathInfo| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||