Search in sources :

Example 36 with WebSessionCtx

use of org.compiere.util.WebSessionCtx in project adempiere by adempiere.

the class WValuePreference method doPost.

//  doGet
/**
	 *  Process the HTTP Post request.
	 *  Get Parameters and Process
	 *	@param request 
	 *	@param response 
	 *	@throws ServletException 
	 *	@throws IOException 
	 */
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    WebDoc doc = null;
    //  Get Session attributes
    WebSessionCtx wsc = WebSessionCtx.get(request);
    WWindowStatus ws = WWindowStatus.get(request);
    String m_UpdateResult = "";
    if (wsc == null) {
        WebUtil.createTimeoutPage(request, response, this, null);
        return;
    }
    log.info("This is #1");
    m_Client = WebUtil.getParameterAsBoolean(request, "Client");
    m_User = WebUtil.getParameterAsBoolean(request, "User");
    m_Window = WebUtil.getParameterAsBoolean(request, "Window");
    m_Org = WebUtil.getParameterAsBoolean(request, "Org");
    log.info("This is #2");
    String m_Action = WebUtil.getParameter(request, "PostAction");
    setExplanation();
    log.info("This is the m_Action" + m_Action);
    if (m_Action.equals("Delete"))
        m_UpdateResult = delete(m_Client, m_User, m_Window, m_Org);
    else if (m_Action.equals("Add"))
        m_UpdateResult = insert(m_Client, m_User, m_Window, m_Org);
    log.info("This is the call");
    doc = createParameterPage(ws, wsc, request, m_UpdateResult);
    WebUtil.createResponse(request, response, this, null, doc, false);
    return;
//Modified by Rob Klein 6/01/07
//WebDoc doc = createProcessPage(request, AD_Process_ID, AD_Window_ID);
//createProcessPage(request, response, AD_Process_ID, AD_Window_ID);
//
}
Also used : WebDoc(org.compiere.util.WebDoc) WebSessionCtx(org.compiere.util.WebSessionCtx)

Example 37 with WebSessionCtx

use of org.compiere.util.WebSessionCtx in project adempiere by adempiere.

the class WWorkflow method doPost.

//  doGet
/**
	 *  Process the HTTP Post request - Initial Call.
	 *
	 *  Execute the received command
	 *  Update session attributes
	 *  Create output
	 *
	 *  @param request
	 *  @param response
	 *  @throws ServletException
	 *  @throws IOException
	 */
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    //WUtil.debug(new String("In do Post"),"");
    HttpSession sess = request.getSession();
    WebSessionCtx wsc = WebSessionCtx.get(request);
    Properties ctx = wsc.ctx;
    if (ctx == null) {
        WebUtil.createTimeoutPage(request, response, this, null);
        return;
    }
    //String loginInfo = (String)sess.getAttribute(WEnv.SA_LOGININFO);
    //get session attributes
    MWorkflow wf = (MWorkflow) sess.getAttribute(WORKFLOW);
    MWFNode[] nodes = (MWFNode[]) sess.getAttribute(NODES);
    ArrayList nodes_ID = (ArrayList) sess.getAttribute(NODES_ID);
    int[][] imageMap = (int[][]) sess.getAttribute(IMAGE_MAP);
    int activeNode = ((Integer) sess.getAttribute(ACTIVE_NODE)).intValue();
    //execute commnad
    String m_command = request.getParameter(M_Command);
    int j_command = WebUtil.getParameterAsInt(request, J_Command);
    //WUtil.debug(m_command,"m_command");
    //WUtil.debug(""+j_command,"j_command");
    executeCommand(m_command, j_command, wf, activeNode, nodes, nodes_ID, sess);
    //get updated session attributes
    wf = (MWorkflow) sess.getAttribute(WORKFLOW);
    nodes = (MWFNode[]) sess.getAttribute(NODES);
    nodes_ID = (ArrayList) sess.getAttribute(NODES_ID);
    imageMap = (int[][]) sess.getAttribute(IMAGE_MAP);
    activeNode = ((Integer) sess.getAttribute(ACTIVE_NODE)).intValue();
    //create layout
    WebDoc doc = preparePage("loginInfo");
    doc = createLayout(doc, wf, activeNode, nodes, nodes_ID, imageMap);
    WebUtil.createResponse(request, response, this, null, doc, false);
}
Also used : HttpSession(javax.servlet.http.HttpSession) WebDoc(org.compiere.util.WebDoc) MWorkflow(org.compiere.wf.MWorkflow) ArrayList(java.util.ArrayList) MWFNode(org.compiere.wf.MWFNode) WebSessionCtx(org.compiere.util.WebSessionCtx) Properties(java.util.Properties)

Example 38 with WebSessionCtx

use of org.compiere.util.WebSessionCtx in project adempiere by adempiere.

the class WProcess method doPost.

//  doGet
/**
	 *  Process the HTTP Post request.
	 *  Get Parameters and Process
	 *	@param request 
	 *	@param response 
	 *	@throws ServletException 
	 *	@throws IOException 
	 */
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    //  Get Session attributes
    WebSessionCtx wsc = WebSessionCtx.get(request);
    if (wsc == null) {
        WebUtil.createTimeoutPage(request, response, this, null);
        return;
    }
    int AD_Process_ID = WebUtil.getParameterAsInt(request, "AD_Process_ID");
    //Modified by Rob Klein 4/29/07
    int AD_Window_ID = WebUtil.getParameterAsInt(request, "AD_Window_ID");
    int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID");
    int AD_Record_ID = WebUtil.getParameterAsInt(request, "AD_Record_ID");
    if (AD_Process_ID == 0) {
        WebUtil.createErrorPage(request, response, this, "No Process");
        return;
    }
    //Modified by Rob Klein 6/01/07
    //WebDoc doc = createProcessPage(request, AD_Process_ID, AD_Window_ID);
    createProcessPage(request, response, AD_Process_ID, AD_Window_ID);
//
}
Also used : WebSessionCtx(org.compiere.util.WebSessionCtx)

Aggregations

WebSessionCtx (org.compiere.util.WebSessionCtx)38 WebDoc (org.compiere.util.WebDoc)21 File (java.io.File)13 HttpSession (javax.servlet.http.HttpSession)11 SQLException (java.sql.SQLException)8 Properties (java.util.Properties)6 MPrintFormat (org.compiere.print.MPrintFormat)6 IOException (java.io.IOException)4 PreparedStatement (java.sql.PreparedStatement)4 ResultSet (java.sql.ResultSet)4 ServletException (javax.servlet.ServletException)4 GridField (org.compiere.model.GridField)4 org.apache.ecs.xhtml.body (org.apache.ecs.xhtml.body)3 org.apache.ecs.xhtml.input (org.apache.ecs.xhtml.input)3 org.apache.ecs.xhtml.p (org.apache.ecs.xhtml.p)3 org.apache.ecs.xhtml.td (org.apache.ecs.xhtml.td)3 ReportEngine (org.compiere.print.ReportEngine)3 ProcessInfo (org.compiere.process.ProcessInfo)3 KeyNamePair (org.compiere.util.KeyNamePair)3 Trx (org.compiere.util.Trx)3