Package org.openswing.swing.message.receive.java

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


    try {
      ArrayList custCompaniesList = ((JAIOUserSessionParameters)userSessionPars).getCompanyBa().getCompaniesList("SAL07");
      ArrayList warCompaniesList = ((JAIOUserSessionParameters)userSessionPars).getCompanyBa().getCompaniesList("WAR01");
     
      Params bean = (Params)JAIOBeanFactory.getInstance().getBean(Params.class);
      Response answer = bean.loadUserParams(companyCode,((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername(),custCompaniesList,warCompaniesList);

      return answer;
    }
    catch (Throwable ex) {
      Logger.error(userSessionPars.getUsername(),this.getClass().getName(),"executeCommand","Error while processing request",ex);
View Full Code Here


      bean.setConn(conn); // use same transaction...
      langsBean.setConn(conn); // use same transaction...
      ETLProcessVO processVO = (ETLProcessVO)gridParams.getOtherGridParams().get(ApplicationConsts.FILTER_VO);

      // read from SYS24 table...
      Response res = bean.loadETLProcessFields(processVO.getProgressiveSYS23(),username);

      if (!res.isError()) {
        java.util.List vos = ( (VOListResponse) res).getRows();
        HashMap map = new HashMap();
        ETLProcessFieldVO vo = null;
        for (int i = 0; i < vos.size(); i++) {
          vo = (ETLProcessFieldVO) vos.get(i);
          map.put(new FieldEntry(vo.getLanguageCodeSYS24(),vo.getFieldNameSYS24()), vo);
        }

        ArrayList rows = new ArrayList();
        SelectableFieldVO selVO = null;
        ImportDescriptorVO impVO = (ImportDescriptorVO) Class.forName(processVO.getClassNameSYS23()).newInstance();
        FieldEntry pk = null;
        for (int i = 0; i < impVO.getFields().length; i++) {
          pk = new FieldEntry(ApplicationConsts.JOLLY, impVO.getFields()[i]);
          if (map.containsKey(pk)) {
            vo = (ETLProcessFieldVO) map.get(pk);

            selVO = new SelectableFieldVO();
            selVO.setField(vo);
            selVO.setSelected(true);
            selVO.setLabel(p.getProperty(impVO.getLabels()[i]));
            selVO.setRequired(impVO.getRequiredFields().contains(impVO.getFields()[i]));
            rows.add(selVO);
          }
          else {
            vo = new ETLProcessFieldVO();
            vo.setFieldNameSYS24(impVO.getFields()[i]);
            vo.setLanguageCodeSYS24(ApplicationConsts.JOLLY);
            vo.setProgressiveSys23SYS24(processVO.getProgressiveSYS23());

            selVO = new SelectableFieldVO();
            selVO.setField(vo);
            selVO.setSelected(false);
            selVO.setLabel(p.getProperty(impVO.getLabels()[i]));
            selVO.setRequired(impVO.getRequiredFields().contains(impVO.
                getFields()[i]));
            rows.add(selVO);
          }
        } // end for

        // retrieve supported languages...
        res = langsBean.loadLanguages( serverLanguageId,username);
        if (res.isError())
          throw new Exception(res.getErrorMessage());
        java.util.List langsVO = ( (VOListResponse) res).getRows();

        // for each progressive SYS10 x language...
        Iterator it = impVO.getProgressiveSys10Fields().keySet().iterator();
        String field = null;
        LanguageVO langVO = null;
        while(it.hasNext()) {
          field = it.next().toString();
          for(int i=0;i<langsVO.size();i++) {
            langVO = (LanguageVO)langsVO.get(i);
            pk = new FieldEntry(langVO.getLanguageCodeSYS09(),field);
            if (map.containsKey(pk)) {
              vo = (ETLProcessFieldVO)map.get(new FieldEntry(langVO.getLanguageCodeSYS09(),field));

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(true);
              selVO.setLabel(
                p.getProperty((String)impVO.getProgressiveSys10Fields().get(field))+
                " "+
                langVO.getDescriptionSYS09()
              );
              selVO.setRequired(impVO.getRequiredFields().contains(field));
              rows.add(selVO);
            }
            else {
              vo = new ETLProcessFieldVO();
              vo.setFieldNameSYS24(field);
              vo.setLanguageCodeSYS24(langVO.getLanguageCodeSYS09());
              vo.setProgressiveSys23SYS24(processVO.getProgressiveSYS23());

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(false);
              selVO.setLabel(
                p.getProperty((String)impVO.getProgressiveSys10Fields().get(field))+
                " "+
                langVO.getDescriptionSYS09()
              );
              selVO.setRequired(impVO.getRequiredFields().contains(field));
              rows.add(selVO);
            }
          }

        } // end while on descriptions...

        // if a hierarchy level has been defined, create an object for each supported language...
        if (processVO.getProgressiveHIE02()!=null) {
          field = impVO.getHierarchyField();

          for(int i=0;i<langsVO.size();i++) {
            langVO = (LanguageVO)langsVO.get(i);
            pk = new FieldEntry(langVO.getLanguageCodeSYS09(),field);

            if (map.containsKey(pk)) {
              vo = (ETLProcessFieldVO)map.get(pk);

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(true);
              selVO.setLabel(
                  p.getProperty("hierarchy") +
                  " " +
                  langVO.getDescriptionSYS09()
                  );
              selVO.setRequired(impVO.getRequiredFields().contains(field));
              rows.add(selVO);
            }
            else {

              vo = new ETLProcessFieldVO();
              vo.setFieldNameSYS24(field);
              vo.setLanguageCodeSYS24(langVO.getLanguageCodeSYS09());
              vo.setProgressiveSys23SYS24(processVO.getProgressiveSYS23());

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(false);
              selVO.setLabel(
                p.getProperty("hierarchy")+
                " "+
                langVO.getDescriptionSYS09()
              );
              selVO.setRequired(impVO.getRequiredFields().contains(field));
              rows.add(selVO);
            }
          }
        }


        return new VOListResponse(rows,false,rows.size());
      }
      else
        throw new Exception(res.getErrorMessage());
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while fetching ETL process fields",ex);
      throw new Exception(ex.getMessage());
    }
View Full Code Here

    Object[] sel = frame.getTablesList().getSelectedValues();
    if (sel!=null)
      for(int i=0;i<sel.length;i++)
        mainTables += sel[i]+(i<sel.length-1?",":"");
    vo.setMainTablesSYS16(mainTables);
    Response res = ClientUtils.getData("insertCustomFunction",newPersistentObject);
    if (!res.isError()) {
      vo = (CustomFunctionVO)((VOResponse)res).getVo();
      frame.loadDataCompleted(false,vo);
    }
    return res;
  }
View Full Code Here

    if (sel!=null)
      for(int i=0;i<sel.length;i++)
        mainTables += sel[i]+(i<sel.length-1?",":"");
    vo.setMainTablesSYS16(mainTables);

    Response res = ClientUtils.getData("updateCustomFunction",new ValueObject[]{oldPersistentObject,persistentObject});
    if (!res.isError()) {
//      if (parentFrame!=null) {
//        parentFrame.getGrid().reloadData();
//      }
      frame.getGrid().reloadData();
      frame.getTablesList().setEnabled(false);
View Full Code Here

   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecord(ValueObject persistentObject) throws Exception {
    ArrayList pks = new ArrayList();
    pks.add(vo.getFunctionCodeSys06SYS16());
    Response res = ClientUtils.getData("deleteCustomFunctions",pks);
    if (!res.isError()) {
      if (parentFrame!=null) {
        parentFrame.getGrid().reloadData();
      }
      frame.getGrid().clearData();
      frame.clearList();
View Full Code Here

      BigDecimal customerVatValue = null;
      String customerVatCode = null;
      String customerVatDescription = null;
      if (vo.getCustomerVatCodeReg01DOC01()!=null && !vo.getCustomerVatCodeReg01DOC01().equals("")) {
        // retrieve vat value and deductible percentage...
        Response res = vatBean.validateVatCode(
            new LookupValidationParams(vo.getCustomerVatCodeReg01DOC01(),new HashMap()),
            serverLanguageId,
            username,
            new ArrayList()
        );
        if (!res.isError()) {
          VatVO vatVO = (VatVO)((VOListResponse)res).getRows().get(0);
          customerVatValue = new BigDecimal(vatVO.getValueREG01().doubleValue()*(1d-vatVO.getDeductibleREG01().doubleValue()/100d));
          customerVatCode = vatVO.getVatCodeREG01();
          customerVatDescription = vatVO.getDescriptionSYS10();
        }
      }

      // retrieve all item rows...
      GridParams pars = new GridParams();
      pars.getOtherGridParams().put(ApplicationConsts.SALE_DOC_PK,pk);
      Response rowsResponse = rowsBean.loadSaleDocRows(variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,pars,serverLanguageId,username);
      if (rowsResponse.isError())
        throw new Exception(rowsResponse.getErrorMessage());
      java.util.List itemRows = ((VOListResponse)rowsResponse).getRows();

      // for each item, calculate item discounts...
      GridSaleDocRowVO itemVO = null;
      Response rowResponse = null;
      DetailSaleDocRowVO detailItemVO = null;
      Response itemTotDiscResponse = null;
      ArrayList detailItemRows = new ArrayList();
      double vatPerc;
      for(int i=0;i<itemRows.size();i++) {
        itemVO = (GridSaleDocRowVO)itemRows.get(i);
        // retrieve item detail...
        rowResponse = bean.loadSaleDocRow(
          variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,
          new SaleDocRowPK(
            pk.getCompanyCodeSys01DOC01(),
            pk.getDocTypeDOC01(),
            pk.getDocYearDOC01(),
            pk.getDocNumberDOC01(),
            itemVO.getItemCodeItm01DOC02(),
            itemVO.getVariantTypeItm06DOC02(),
            itemVO.getVariantCodeItm11DOC02(),
            itemVO.getVariantTypeItm07DOC02(),
            itemVO.getVariantCodeItm12DOC02(),
            itemVO.getVariantTypeItm08DOC02(),
            itemVO.getVariantCodeItm13DOC02(),
            itemVO.getVariantTypeItm09DOC02(),
            itemVO.getVariantCodeItm14DOC02(),
            itemVO.getVariantTypeItm10DOC02(),
            itemVO.getVariantCodeItm15DOC02()
          ),
          serverLanguageId,
          username

        );
        if (rowResponse.isError())
          throw new Exception(rowsResponse.getErrorMessage());
        detailItemVO = (DetailSaleDocRowVO)((VOResponse)rowResponse).getVo();
        detailItemRows.add(detailItemVO);

        // calculate item discount...
        detailItemVO.setTaxableIncomeDOC02(detailItemVO.getQtyDOC02().multiply(detailItemVO.getValueSal02DOC02()).setScale(vo.getDecimalsREG03().intValue(),BigDecimal.ROUND_HALF_UP));
        itemTotDiscResponse = itemDiscountBean.getSaleItemTotalDiscount(detailItemVO,serverLanguageId,username);
        if (itemTotDiscResponse.isError())
          throw new Exception(itemTotDiscResponse.getErrorMessage());

        // apply total discount to item detail...
        detailItemVO.setTotalDiscountDOC02( detailItemVO.getTotalDiscountDOC02().setScale(vo.getDecimalsREG03().intValue(),BigDecimal.ROUND_HALF_UP) );

        // apply total discount to taxable income...
View Full Code Here

    Connection conn = null;
    try {
      if (this.conn==null) conn = getConn(); else conn = this.conn;
      bean.setConn(conn);

      Response res = bean.update(oldVO,newVO,t1,serverLanguageId,username);
      Response answer = res;
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOResponse)answer;
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while updating an existing company",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

  public final Response executeCommand(Object inputPar,UserSessionParameters userSessionPars,HttpServletRequest request, HttpServletResponse response,HttpSession userSession,ServletContext context) {
    try {

      Companies bean = (Companies)JAIOBeanFactory.getInstance().getBean(Companies.class);
      Response answer = bean.loadCompanies(((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername());

      return answer;
    }
    catch (Throwable ex) {
      Logger.error(userSessionPars.getUsername(),this.getClass().getName(),"executeCommand","Error while processing request",ex);
View Full Code Here

      attribute2dbField.put("progressiveReg04DOC08","PROGRESSIVE_REG04");
      attribute2dbField.put("deliveryDateDOC08","DELIVERY_DATE");
      attribute2dbField.put("transportMotiveCodeReg20DOC08","TRANSPORT_MOTIVE_CODE_REG20");

      // insert into DOC08...
      Response res = org.jallinone.commons.server.QueryUtilExtension.insertTable(
          conn,
          new UserSessionParameters(username),
          vo,
          "DOC08_DELIVERY_NOTES",
          attribute2dbField,
          "Y",
          "N",
          null,
          true
      );

      Response answer = res;




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

      vo.setVariantTypeItm09DOC10(ApplicationConsts.JOLLY);
      vo.setVariantTypeItm10DOC10(ApplicationConsts.JOLLY);
*/

      // insert into DOC10...
      Response res = org.jallinone.commons.server.QueryUtilExtension.insertTable(
          conn,
          new UserSessionParameters(username),
          vo,
          "DOC10_OUT_DELIVERY_NOTE_ITEMS",
          attribute2dbField,
          "Y",
          "N",
          null,
          true
      );

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

      // update delivery note state...
      pstmt = conn.prepareStatement("update DOC08_DELIVERY_NOTES set DOC_STATE=?,LAST_UPDATE_USER=?,LAST_UPDATE_DATE=?  where COMPANY_CODE_SYS01=? and DOC_TYPE=? and DOC_YEAR=? and DOC_NUMBER=?");
      pstmt.setString(1,ApplicationConsts.HEADER_BLOCKED);
      pstmt.setString(2,username);
      pstmt.setTimestamp(3,new java.sql.Timestamp(System.currentTimeMillis()));
      pstmt.setString(4,vo.getCompanyCodeSys01DOC10());
      pstmt.setString(5,vo.getDocTypeDOC10());
      pstmt.setBigDecimal(6,vo.getDocYearDOC10());
      pstmt.setBigDecimal(7,vo.getDocNumberDOC10());
      pstmt.execute();

      // insert serial numbers...
      if (vo.getSerialNumbers().size()>0) {
        res = bean.reinsertOutSerialNumbers(vo,serverLanguageId,username);
        if (res.isError()) {
          throw new Exception(res.getErrorMessage());
        }
      }

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

TOP

Related Classes of org.openswing.swing.message.receive.java.Response

Copyright © 2018 www.massapicom. 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.