Examples of VOResponse


Examples of org.openswing.swing.message.receive.java.VOResponse

                                 HttpServletResponse httpServletResponse,
                                 HttpSession httpSession,
                                 ServletContext servletContext) {
    try {
      String beansFactoryClassName = servletContext.getInitParameter("beansFactory");
      return new VOResponse(beansFactoryClassName);
    }
    catch (Throwable ex) {
      Logger.error(userSessionPars.getUsername(),this.getClass().getName(),"executeCommand","Error while processing request",ex);
      return new ErrorResponse(ex.getMessage());
    }
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

        );
        if (res.isError())
          throw new Exception(res.getErrorMessage());
      }

      return new VOResponse(vo);
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"insertItem","Error while inserting a new item in the journal",ex);
          try {
            if (this.conn==null && conn!=null)
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

      HashMap params = new HashMap();
      params.put(ApplicationConsts.COMPANY_CODE_SYS01,pk.getCompanyCodeSys01DOC01());
      params.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.RECEIPT_PATH);
      Response userParRes = userParAction.loadUserParam(params,serverLanguageId,username);
      if (userParRes.isError()){
        VOResponse res = new VOResponse();
        res.setErrorMessage(userParRes.getErrorMessage());
        return res;
      }
      String programPath = (String)((VOResponse)userParRes).getVo();
      if (programPath==null) {
        throw new Exception(t1);
      }

      // for demo only...
      if (programPath.equals("NOPRINT")) {
        return new VOResponse(Boolean.TRUE);
      }

      programPath = programPath.replace('\\','/');
      String path = programPath.substring(0,programPath.lastIndexOf("/"));

      // retrieve progressiveREG04 of current company...
      pstmt = conn.prepareStatement(
          "select PROGRESSIVE from REG04_SUBJECTS where COMPANY_CODE_SYS01=? and SUBJECT_TYPE=?"
      );
      pstmt.setString(1,pk.getCompanyCodeSys01DOC01());
      pstmt.setString(2,ApplicationConsts.SUBJECT_MY_COMPANY);
      ResultSet rset = pstmt.executeQuery();
      BigDecimal progressiveREG04 = null;
      if(rset.next()) {
        progressiveREG04 = rset.getBigDecimal(1);
      }
      rset.close();
      if (progressiveREG04==null) {
        throw new Exception(t2);
      }

      // retrieve company data...
      //SubjectPK subjectPK = new SubjectPK(pk.getCompanyCodeSys01DOC01(),progressiveREG04);
      Response companyRes = companyAction.loadCompany(pk.getCompanyCodeSys01DOC01(),serverLanguageId,username);
      if (companyRes.isError())
        throw new Exception(companyRes.getErrorMessage());
      OrganizationVO companyVO = (OrganizationVO)((VOResponse)companyRes).getVo();

      // prepare text file...
      GridSaleDocRowVO docRowVO = null;
      String tmpFile = path+"/receipt_"+docVO.getDocYearDOC01()+"_"+docVO.getDocSequenceDOC01()+".tmp";
      PrintWriter pw = new PrintWriter(new FileOutputStream(tmpFile));
      pw.println(companyVO.getName_1REG04());
      pw.println(companyVO.getAddressREG04()==null?"":companyVO.getAddressREG04());
      pw.println(companyVO.getCityREG04()==null?"":companyVO.getCityREG04());
      pw.println(companyVO.getProvinceREG04()==null?"":companyVO.getProvinceREG04());
      pw.println(companyVO.getTaxCodeREG04()==null?"":companyVO.getTaxCodeREG04());
      pw.println();

      for(int i=0;i<rows.size();i++) {
        docRowVO = (GridSaleDocRowVO)rows.get(i);
        pw.println(
            docRowVO.getItemCodeItm01DOC02()+"\t"+
            docRowVO.getDescriptionSYS10()+"\t"+
            docVO.getCurrencyCodeReg03DOC01()+"\t"+
            docRowVO.getValueDOC02()
        );
      }
      pw.println();

      if (docVO.getDiscountPercDOC01()!=null)
        pw.println(
            "%"+"\t"+
            docVO.getDiscountPercDOC01()
        );
      if (docVO.getDiscountValueDOC01()!=null)
        pw.println(
            docVO.getCurrencyCodeReg03DOC01()+"\t"+
            docVO.getDiscountValueDOC01()
        );
      pw.println();

      pw.println(
          docVO.getCurrencyCodeReg03DOC01()+"\t"+
          docVO.getTotalDOC01()
      );
      pw.println();

      SimpleDateFormat sdf = new SimpleDateFormat(t3);
      pw.println(sdf.format(new java.util.Date()));
      pw.println();

      pw.println(docVO.getDocSequenceDOC01());

      pw.close();

      // "commit" file...
      String file = path+"/receipt_"+docVO.getDocYearDOC01()+"_"+docVO.getDocSequenceDOC01()+".txt";
      new File(tmpFile).renameTo(new File(file));

      // call external application that manages this text file...
      Process p = Runtime.getRuntime().exec(programPath+" "+file);
      LogProcessMessage log = new LogProcessMessage(username,p.getInputStream());
      LogErrorProcessMessage errorLog = new LogErrorProcessMessage(username,p.getErrorStream());
      int returnCode = p.waitFor();
      if (returnCode!=0) {
        throw new Exception(t4+" "+returnCode);
      }

      return new VOResponse(Boolean.TRUE);
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while exporting a retail sale to file",ex);
      throw new Exception(ex.getMessage());
    }
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

    ApplicationParametersVO vo = (ApplicationParametersVO)vos[1];
    try {

      Params bean = (Params)JAIOBeanFactory.getInstance().getBean(Params.class);
      bean.updateApplicationParams(vo.getApplicationPars(),((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername());
      return new VOResponse(vo);
    }
    catch (Throwable ex) {
      Logger.error(userSessionPars.getUsername(),this.getClass().getName(),"executeCommand","Error while processing request",ex);
      return new ErrorResponse(ex.getMessage());
    }
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

      }
      else {
        rset.close();
        throw new Exception("Record not found.");
      }
      return new VOResponse(vo);
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while fetching company detail",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

           "ITM15_VARIANTS_5",
           companyCode,
           vo.getCompanyCodeSys01REG04()
      );

      return new VOResponse(vo);
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while inserting a new company",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

      pstmt = conn.prepareStatement(
        "delete from SYS02_COMPANIES_ACCESS where COMPANY_CODE_SYS01='"+pk.getCompanyCodeSys01REG04()+"'"
      );
      pstmt.execute();

      return new VOResponse(new Boolean(true));
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while deleting an existing company",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

        // phisically delete the record in DOC10...
        pstmt.setBigDecimal(1,rowPK.getProgressiveDOC10());
        pstmt.execute();
      }

      Response answer =  new VOResponse(new Boolean(true));
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOResponse)answer;
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while deleting existing out delivery note rows",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

        if (innerResponse.isError())
          throw new Exception(innerResponse.getErrorMessage());
      }


      return  new VOResponse(Boolean.TRUE);
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"updateOutQuantities","Error while updating out quantites in sale documents",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

Examples of org.openswing.swing.message.receive.java.VOResponse

        if (innerResponse.isError())
            throw new Exception(innerResponse.getErrorMessage());
      }


      return new VOResponse(Boolean.TRUE);
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"updateOutQuantities","Error while updating out quantites in sale documents",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.