Search in sources :

Example 41 with WebDoc

use of org.compiere.util.WebDoc 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 42 with WebDoc

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

the class WWorkflow method preparePage.

//getAD_Workflow_ID
/**
	 *  Prepare Page.
	 *  - Set Header
	 *
	 *  @param loginInfo
	 *
	 *  @return WReportEngine page
	 */
private WebDoc preparePage(String loginInfo) {
    WebDoc doc = WebDoc.create("Workflow");
    head header = doc.getHead();
    body b = doc.getBody();
    //  add window.js & .css
    header.addElement(new script("", WebEnv.getBaseDirectory("/js/window.js")));
    header.addElement(new link().setRel("stylesheet").setHref(WebEnv.getBaseDirectory("/css/window.css")));
    //
    //
    String title = "Workflow" + " - " + loginInfo;
    b.addElement(new script("top.document.title='" + title + "';"));
    return doc;
}
Also used : org.apache.ecs.xhtml.head(org.apache.ecs.xhtml.head) WebDoc(org.compiere.util.WebDoc) org.apache.ecs.xhtml.link(org.apache.ecs.xhtml.link) org.apache.ecs.xhtml.body(org.apache.ecs.xhtml.body) org.apache.ecs.xhtml.script(org.apache.ecs.xhtml.script)

Example 43 with WebDoc

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

the class WHelp method doGet.

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    log.fine("doGet");
    WWindowStatus ws = WWindowStatus.get(request);
    WebDoc doc = null;
    if (ws == null) {
        doc = WebDoc.createPopup("No Context");
        doc.addPopupClose(Env.getCtx());
    } else
        doc = ws.mWindow.getHelpDoc(false);
    WebUtil.createResponse(request, response, this, null, doc, false);
}
Also used : WebDoc(org.compiere.util.WebDoc)

Example 44 with WebDoc

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

the class WStatus method doPost.

//  doGet
/**
	 *  Process the HTTP Post request
	 */
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    WebDoc doc = WebDoc.create("WStatus Post Request");
    //
    WebUtil.createResponse(request, response, this, null, doc, false);
}
Also used : WebDoc(org.compiere.util.WebDoc)

Example 45 with WebDoc

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

the class Help method loadInfo.

//	jbInit
/*************************************************************************
	 *	Load Info - Windows Help
	 *  @param mWindow window model
	 */
private void loadInfo(GridWindow mWindow) {
    WebDoc doc = mWindow.getHelpDoc(true);
    HTMLDocument htmlDoc = (HTMLDocument) info.getEditorKit().createDefaultDocument();
    htmlDoc.getDocumentProperties().put("IgnoreCharsetDirective", true);
    info.setDocument(htmlDoc);
    info.setText(doc.toString());
}
Also used : WebDoc(org.compiere.util.WebDoc) HTMLDocument(javax.swing.text.html.HTMLDocument)

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