KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > wstore > SingleItem


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2002 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.wstore;
15
16 import javax.servlet.*;
17 import javax.servlet.http.*;
18 import java.io.*;
19 import java.util.*;
20 import java.sql.*;
21
22 import org.apache.ecs.*;
23 import org.apache.ecs.xhtml.*;
24 import org.apache.log4j.Logger;
25
26 import org.compiere.util.*;
27 import org.compiere.www.*;
28
29 /**
30  * Single Item Purchase
31  *
32  * @author Jorg Janke
33  * @version $Id: SingleItem.java,v 1.1 2002/10/30 05:05:16 jjanke Exp $
34  */

35 public class SingleItem extends HttpServlet
36 {
37     /** Logging */
38     private Logger log = Logger.getLogger(getClass());
39     /** Client */
40     private int m_AD_Client_ID = -1;
41
42     /**
43      * Initialize global variables
44      * @param config servlet configuration
45      * @throws ServletException
46      */

47     public void init(ServletConfig config) throws ServletException
48     {
49         super.init(config);
50         if (!WEnv.initWeb(config))
51             throw new ServletException("SingleItem");
52         // Get Client
53
m_AD_Client_ID = WEnv.getAD_Client_ID(config);
54         log.info("init - AD_Client_ID=" + m_AD_Client_ID);
55     } // init
56

57     /**
58      * Clean up resources
59      */

60     public void destroy()
61     {
62         log.info("destroy");
63     } // destroy
64

65     // Parameter Names
66
private static final String JavaDoc P_ITEM_NAME = "item_name";
67     private static final String JavaDoc P_ITEM_NUMBER = "item_number";
68     private static final String JavaDoc P_AMOUNT = "amount";
69     private static final String JavaDoc P_QUANTITY = "quantity";
70     private static final String JavaDoc P_UNDEFINED_QUANTITY = "undefined_quantity";
71     private static final String JavaDoc P_RETURN_URL = "return";
72     private static final String JavaDoc P_CANCEL_URL = "cancel_return";
73     //
74
private static final String JavaDoc P_SUBMIT = "SUBMIT";
75
76     /*************************************************************************/
77
78     /**
79      * Process the initial HTTP Get request
80      * @param request request
81      * @param response response
82      * @throws ServletException
83      * @throws IOException
84      */

85     public void doGet(HttpServletRequest request, HttpServletResponse response)
86         throws ServletException, IOException
87     {
88         log.info("doGet from " + request.getRemoteHost() + " - " + request.getRemoteAddr());
89     } // doGet
90

91
92     /**
93      * Process the HTTP Post request
94      * @param request request
95      * @param response response
96      * @throws ServletException
97      * @throws IOException
98      */

99     public void doPost(HttpServletRequest request, HttpServletResponse response)
100         throws ServletException, IOException
101     {
102         log.info("doPost from " + request.getRemoteHost() + " - " + request.getRemoteAddr());
103     } // doPost
104

105 } // SingleItem
Popular Tags