示例#1
0
  /** 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.save();
      }
      MChatEntry entry = new MChatEntry(m_chat, data);
      entry.save();
    } //	data to be saved

    doc = CreateChatPage(ws, wsc, doc, m_chat.getCM_Chat_ID());
    WebUtil.createResponse(request, response, this, null, doc, false);
  } //  doPost
示例#2
0
 /** Process the HTTP Get request */
 public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
   log.fine("doGet");
   WebSessionCtx wsc = WebSessionCtx.get(request);
   WWindowStatus ws = WWindowStatus.get(request);
   //
   WebDoc doc = null;
   if (ws == null) {
     doc = WebDoc.createPopup("No Context");
     doc.addPopupClose(wsc.ctx);
   } else {
     doc = CreateChatPage(ws, wsc, doc, 0);
   }
   //
   WebUtil.createResponse(request, response, this, null, doc, false);
 } //  doGet
示例#3
0
  /**
   * Async Process - Do it all. <code>
   * - Get Instance ID
   * - Get Parameters
   * - execute (lock - start process - unlock)
   *  </code> Creates a ProcessCtl instance, which calls lockUI and unlockUI if parent is a
   * ASyncProcess <br>
   * Called from ProcessCtl.startProcess, ProcessDialog.actionPerformed, APanel.cmd_print,
   * APanel.actionButton, VPaySelect.cmd_generate
   *
   * @param parent ASyncProcess & Container
   * @param WindowNo window no
   * @param pi ProcessInfo process info
   * @param trx Transaction
   * @return worker started ProcessCtl instance or null for workflow
   */
  public static WProcessCtl process(
      Object parent, int WindowNo, ProcessInfo pi, Trx trx, HttpServletRequest request) {
    log.fine("WindowNo=" + WindowNo + " - " + pi);
    WebSessionCtx wsc = WebSessionCtx.get(request);
    MPInstance instance = new MPInstance(wsc.ctx, pi.getAD_Process_ID(), pi.getRecord_ID());

    if (!instance.save()) {
      pi.setSummary(Msg.getMsg(wsc.ctx, "ProcessNoInstance"));
      pi.setError(true);
      return null;
    }
    pi.setAD_PInstance_ID(instance.getAD_PInstance_ID());

    //	Get Parameters (Dialog)
    /**
     * ProcessParameter para = new ProcessParameter (Env.getFrame((Container)parent), WindowNo, pi);
     * if (para.initDialog()) { para.setVisible(true); if (!para.isOK()) { pi.setSummary
     * (Msg.getMsg(Env.getCtx(), "ProcessCancelled")); pi.setError (true); return null; } }
     */
    //	execute
    WProcessCtl worker = new WProcessCtl(parent, pi, trx, wsc.ctx);
    worker.start(); // 	MUST be start!
    return worker;
  } //	execute