Search in sources :

Example 51 with WebDoc

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

the class WForm method doPost.

public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    WebDoc doc = WebDoc.create("WForm - Post - Not Implemented Yet");
    WebUtil.createResponse(request, response, this, null, doc, false);
}
Also used : WebDoc(org.compiere.util.WebDoc)

Example 52 with WebDoc

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

the class WAttachment method doGet.

/**
	 * 	Process the HTTP Get request.
	 * 	Initial display and streaming 
	 *  @param request request
	 *  @param response response
	 */
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    log.info("From " + request.getRemoteHost() + " - " + request.getRemoteAddr());
    HttpSession session = request.getSession(false);
    WWindowStatus ws = WWindowStatus.get(request);
    WebDoc doc = null;
    if (session == null || ws == null) {
        doc = WebDoc.createPopup("No Context");
        //Modified by Rob Klein 4/29/07
        doc.addPopupClose(ws.ctx);
    } else {
        m_error = null;
        int AD_Attachment_ID = WebUtil.getParameterAsInt(request, P_Attachment_ID);
        if (AD_Attachment_ID != 0) {
            int attachmentIndex = WebUtil.getParameterAsInt(request, P_ATTACHMENT_INDEX);
            if (attachmentIndex != 0) {
                m_error = streamAttachment(AD_Attachment_ID, attachmentIndex, response, ws);
                if (m_error == null)
                    return;
            }
        }
        MAttachment attachment = null;
        if (AD_Attachment_ID != 0)
            attachment = new MAttachment(ws.ctx, ws.curTab.getAD_AttachmentID(), null);
        else
            attachment = new MAttachment(ws.ctx, ws.curTab.getAD_Table_ID(), ws.curTab.getRecord_ID(), null);
        doc = createPage(ws.ctx, attachment, m_error);
    }
    //
    WebUtil.createResponse(request, response, this, null, doc, false);
}
Also used : MAttachment(org.compiere.model.MAttachment) HttpSession(javax.servlet.http.HttpSession) WebDoc(org.compiere.util.WebDoc)

Example 53 with WebDoc

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

the class WChat method doPost.

//  doGet
/**
	 *  Process the HTTP Post request
	 */
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    WebDoc doc = null;
    WebSessionCtx wsc = WebSessionCtx.get(request);
    WWindowStatus ws = WWindowStatus.get(request);
    String data = WebUtil.getParameter(request, "chatinput");
    int CM_ChatID = WebUtil.getParameterAsInt(request, "CM_ChatID");
    int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID");
    int record_ID = WebUtil.getParameterAsInt(request, "record_ID");
    String description = WebUtil.getParameter(request, "description");
    if (data != null && data.length() > 0) {
        if (CM_ChatID == 0) {
            m_chat = new MChat(wsc.ctx, AD_Table_ID, record_ID, description, null);
            m_chat.saveEx();
        }
        MChatEntry entry = new MChatEntry(m_chat, data);
        entry.saveEx();
    }
    //	data to be saved
    doc = CreateChatPage(ws, wsc, doc, m_chat.getCM_Chat_ID());
    WebUtil.createResponse(request, response, this, null, doc, false);
}
Also used : MChatEntry(org.compiere.model.MChatEntry) WebDoc(org.compiere.util.WebDoc) MChat(org.compiere.model.MChat) WebSessionCtx(org.compiere.util.WebSessionCtx)

Example 54 with WebDoc

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

the class WFindAdv method doPost.

public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    HttpSession sess = request.getSession(false);
    WWindowStatus ws = null;
    WebSessionCtx wsc = WebSessionCtx.get(request);
    if (sess != null)
        ws = WWindowStatus.get(request);
    if (wsc == null) {
        WebUtil.createTimeoutPage(request, response, this, null);
        return;
    }
    String pTab = request.getParameter(P_Tab);
    WebDoc doc = preparePage();
    body body = doc.getBody();
    if (pTab != null && pTab.equals("FindAdv")) {
        body.addElement(createPageFindAdv(request, response, ws));
    } else {
        body.addElement(createPageFind(request, response, ws));
    }
    WebUtil.createResponse(request, response, this, null, doc, true);
}
Also used : HttpSession(javax.servlet.http.HttpSession) WebDoc(org.compiere.util.WebDoc) WebSessionCtx(org.compiere.util.WebSessionCtx) org.apache.ecs.xhtml.body(org.apache.ecs.xhtml.body)

Example 55 with WebDoc

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

the class Test method doPost.

public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    WebDoc doc = WebDoc.create("Post Request Test");
    WebUtil.createResponse(request, response, this, null, doc, true);
}
Also used : WebDoc(org.compiere.util.WebDoc)

Aggregations

WebDoc (org.compiere.util.WebDoc)58 WebSessionCtx (org.compiere.util.WebSessionCtx)21 HttpSession (javax.servlet.http.HttpSession)13 org.apache.ecs.xhtml.td (org.apache.ecs.xhtml.td)13 org.apache.ecs.xhtml.p (org.apache.ecs.xhtml.p)12 org.apache.ecs.xhtml.tr (org.apache.ecs.xhtml.tr)12 org.apache.ecs.xhtml.table (org.apache.ecs.xhtml.table)11 org.apache.ecs.xhtml.body (org.apache.ecs.xhtml.body)9 org.apache.ecs.xhtml.input (org.apache.ecs.xhtml.input)9 org.apache.ecs.xhtml.form (org.apache.ecs.xhtml.form)8 org.apache.ecs.xhtml.script (org.apache.ecs.xhtml.script)7 Timestamp (java.sql.Timestamp)6 org.apache.ecs.xhtml.a (org.apache.ecs.xhtml.a)6 GridField (org.compiere.model.GridField)5 SQLException (java.sql.SQLException)4 org.apache.ecs.xhtml.i (org.apache.ecs.xhtml.i)4 File (java.io.File)3 IOException (java.io.IOException)3 Properties (java.util.Properties)3 ServletException (javax.servlet.ServletException)3