Exemple #1
0
  /** Holds value of propertys navigatorName. */
  public int doStartTag() throws JspException {
    try {
      BomMgr bomMgr = (BomMgr) pageContext.getSession().getAttribute("bomMgr");
      MfgProcess mfgProcess = bomMgr.getCurrentMfgProcess();
      if (mfgProcess == null) {
        return Tag.SKIP_BODY;
      }

      pageContext.setAttribute(
          "processId", mfgProcess.getProcessId() == null ? "" : mfgProcess.getProcessId());
      pageContext.setAttribute("processCode", mfgProcess.getProcessCode());
      pageContext.setAttribute("processName", mfgProcess.getProcessName());
      pageContext.setAttribute("description", mfgProcess.getDescription());

      pageContext.setAttribute(
          "processCodeError",
          mfgProcess.isValid("processCode") ? "" : mfgProcess.getMessage("processCode"));
      pageContext.setAttribute(
          "processNameError",
          mfgProcess.isValid("processName") ? "" : mfgProcess.getMessage("processName"));

      pageContext.setAttribute("error", mfgProcess.hasMessage() ? mfgProcess.getMessage() : "");
      pageContext.setAttribute("isSaved", mfgProcess.isSaved() ? "Y" : "N");
    } catch (Exception e) {
      e.printStackTrace();
    }
    return EVAL_BODY_INCLUDE;
  }
 public void doInitBody() throws JspException {
   try {
     setAttribute();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  public int doStartTag() throws JspException {
    try {
      List headChargeList =
          ((ProcessHandleTag) getParent()).getCurrentProcessHandleFor().getHeadChargeList();

      iterator = headChargeList.iterator();

      if (headChargeList.size() == 0) {
        return SKIP_BODY;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return IterationTag.EVAL_BODY_AGAIN;
  }
 public int doAfterBody() throws JspException {
   if (iterator.hasNext()) {
     try {
       setAttribute();
     } catch (Exception e) {
       e.printStackTrace();
     }
     return IterationTag.EVAL_BODY_AGAIN;
   } else {
     try {
       bodyContent.writeOut(bodyContent.getEnclosingWriter());
       return SKIP_BODY;
     } catch (IOException ioe) {
       throw new JspTagException(ioe.getMessage());
     }
   }
 }
Exemple #5
0
 public int doStartTag() throws JspException {
   try {
     mttMgr = (MttMgr) pageContext.getSession().getAttribute("mttMgr");
     iterator =
         mttMgr
             .getCurrentmaterialTransactionTypeMeta()
             .getMaterialTransactionTypeList()
             .iterator();
     if (mttMgr.getCurrentmaterialTransactionTypeMeta().getMaterialTransactionTypeList().size()
         == 0) {
       return SKIP_BODY;
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   return IterationTag.EVAL_BODY_AGAIN;
 }
  public int doStartTag() throws JspException {
    try {
      purchaseRequisitionMgr =
          (PurchaseRequisitionMgr) pageContext.getSession().getAttribute("purchaseRequisitionMgr");

      iterator = purchaseRequisitionMgr.getCurrentPurchaseRequest().getPrDetailList().iterator();
      if (purchaseRequisitionMgr.getCurrentPurchaseRequest().getPrDetailList().size() == 0) {
        return Tag.SKIP_BODY;
      }
      if (!iterator.hasNext()) {
        return Tag.SKIP_BODY;
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    return IterationTag.EVAL_BODY_AGAIN;
  }
  public int doStartTag() throws JspException {

    try {
      gosMemberMgr = (GosMemberMgr) pageContext.getSession().getAttribute("gosMemberMgr");

      if (gosMemberMgr.getMemberCardTypeMeta().getMemberCardTypeList().size() > 0) {
        iterator = gosMemberMgr.getMemberCardTypeMeta().getMemberCardTypeList().iterator();
      } else {
        return Tag.SKIP_BODY;
      }

      if (!iterator.hasNext()) {
        return Tag.SKIP_BODY;
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    return IterationTag.EVAL_BODY_AGAIN;
  }
Exemple #8
0
 private void setAttribute() {
   try {
     this.materialTransactionType = (MaterialTransactionType) iterator.next();
     pageContext.setAttribute(
         "materialId",
         materialTransactionType.getAttributeId() == null
             ? ""
             : materialTransactionType.getAttributeId());
     pageContext.setAttribute("materialCode", materialTransactionType.getAttributeCode());
     pageContext.setAttribute("materialName", materialTransactionType.getAttributeName());
     pageContext.setAttribute("materialDescription", materialTransactionType.getDescription());
     pageContext.setAttribute(
         "materialApprovedFlag",
         materialTransactionType.getApprovedFlag() == null
             ? ""
             : this.materialTransactionType.getApprovedFlag());
     pageContext.setAttribute(
         "isReturn",
         materialTransactionType.getType() == null
             ? ""
             : materialTransactionType.getType().equals("2") ? "Retrun" : "");
     pageContext.setAttribute(
         "isIssue",
         materialTransactionType.getType() == null
             ? ""
             : materialTransactionType.getType().equals("1") ? "Issue" : "");
     pageContext.setAttribute(
         "isTransfer",
         materialTransactionType.getType() == null
             ? ""
             : materialTransactionType.getType().equals("3") ? "Transfer" : "");
     pageContext.setAttribute(
         "isConsume",
         materialTransactionType.getType() == null
             ? ""
             : materialTransactionType.getType().equals("4") ? "Consume" : "");
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  public int doStartTag() throws JspException {
    try {
      HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
      ModuleContext context = (ModuleContext) request.getSession().getAttribute("context");

      String viewObject = request.getParameter("viewObject");
      viewObject = (viewObject == null || viewObject.equals("")) ? "xava_view" : viewObject;
      View view = (View) context.get(request, viewObject);

      MetaReference metaReference = view.getMetaReference(reference).cloneMetaReference();
      metaReference.setName(reference);
      String prefix = request.getParameter("propertyPrefix");
      prefix = prefix == null ? "" : prefix;
      String application = request.getParameter("application");
      String module = request.getParameter("module");
      String referenceKey = Ids.decorate(application, module, prefix + reference);
      request.setAttribute(referenceKey, metaReference);
      String editorURL =
          "reference.jsp?referenceKey="
              + referenceKey
              + "&onlyEditor=true&frame=false&composite=false&descriptionsList=true";
      String editorPrefix = Module.isPortlet() ? "/WEB-INF/jsp/xava/" : "/xava/";
      try {
        pageContext.include(editorPrefix + editorURL);
      } catch (ServletException ex) {
        Throwable cause = ex.getRootCause() == null ? ex : ex.getRootCause();
        log.error(cause.getMessage(), cause);
        pageContext.include(editorPrefix + "editors/notAvailableEditor.jsp");
      } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
        pageContext.include(editorPrefix + "editors/notAvailableEditor.jsp");
      }
    } catch (Exception ex) {
      log.error(ex.getMessage(), ex);
      throw new JspException(XavaResources.getString("descriptionsList_tag_error", reference));
    }
    return SKIP_BODY;
  }
  private void setAttribute() {
    try {
      memberCardType = (MemberCardType) iterator.next();

      pageContext.setAttribute(
          "memberCardTypeId",
          memberCardType.getMemberCardTypeId() == null ? "" : memberCardType.getMemberCardTypeId());
      pageContext.setAttribute("memberCardTypeCode", memberCardType.getMemberCardTypeCode());
      pageContext.setAttribute("memberCardTypeName", memberCardType.getMemberCardTypeName());
      pageContext.setAttribute("isSaved", memberCardType.isSaved() ? "Y" : "N");
      pageContext.setAttribute("note", memberCardType.getNote());
      //            pageContext.setAttribute("memberCardTypeCodeError",
      // memberCardType.isValid("memberCardTypeCode") ? "" :
      // memberCardType.getMessage("memberCardTypeCode"));
      //            pageContext.setAttribute("memberCardTypeNameError",
      // memberCardType.isValid("selectionName") ? "" : memberCardType.getMessage("selectionName"));
      //            pageContext.setAttribute("noteError", memberCardType.isValid("note") ? "" :
      // memberCardType.getMessage("note"));

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public int doStartTag() throws JspException {
    try {
      purchaseRequisitionMgr =
          (PurchaseRequisitionMgr) pageContext.getSession().getAttribute("purchaseRequisitionMgr");

      PurchaseRequest purchaseRequest = purchaseRequisitionMgr.getCurrentPurchaseRequest();

      pageContext.setAttribute(
          "prId", purchaseRequest.getPrId() == null ? "" : purchaseRequest.getPrId());
      pageContext.setAttribute(
          "creationDate",
          purchaseRequest.getCreationDate() == null ? "" : purchaseRequest.getCreationDate());
      pageContext.setAttribute(
          "createdBy",
          purchaseRequest.getCreatedBy() == null ? "" : purchaseRequest.getCreatedBy());
      pageContext.setAttribute("isSaved", purchaseRequest.isIsSaved() ? "Y" : "N");
      pageContext.setAttribute("isSend", purchaseRequest.isIsSend() ? "Y" : "N");
      pageContext.setAttribute("isClamant", purchaseRequest.isIsClamant() ? "Y" : "N");
      pageContext.setAttribute("statusString", purchaseRequest.getStatusString());
      pageContext.setAttribute(
          "prStatus", purchaseRequest.getPrStatus() == null ? "" : purchaseRequest.getPrStatus());
      pageContext.setAttribute("modifiedReason", purchaseRequest.getModifiedReason());

      pageContext.setAttribute(
          "modifiedReasonError",
          purchaseRequest.isValid("modifiedReason")
              ? ""
              : purchaseRequest.getMessage("modifiedReason"));
      pageContext.setAttribute(
          "prError", purchaseRequest.hasMessage() ? purchaseRequest.getMessage() : "");

    } catch (Exception e) {
      e.printStackTrace();
    }
    return Tag.EVAL_BODY_INCLUDE;
  }
Exemple #12
0
  public int doStartTag() throws JspException {
    try {
      PurReportMgr purReportMgr =
          (PurReportMgr) pageContext.getSession().getAttribute("purReportMgr");
      ireportPurchaseOrder = purReportMgr.getCurrentIreport().getIreportPurchaseOrder();
      pageContext.setAttribute(
          "poNo", ireportPurchaseOrder.getPoNo() == null ? "" : ireportPurchaseOrder.getPoNo());
      pageContext.setAttribute(
          "poRefNo",
          ireportPurchaseOrder.getPoRefNo() == null ? "" : ireportPurchaseOrder.getPoRefNo());
      pageContext.setAttribute(
          "creationDate",
          ireportPurchaseOrder.getCreationDate() == null
              ? ""
              : ireportPurchaseOrder.getCreationDate());
      pageContext.setAttribute(
          "createdBy",
          ireportPurchaseOrder.getCreatedBy() == null ? "" : ireportPurchaseOrder.getCreatedBy());
    } catch (Exception e) {
      e.printStackTrace();
    }

    return Tag.EVAL_BODY_INCLUDE;
  }
  private void setAttribute() {
    try {

      purchaseRequestDetail = (PurchaseRequestDetail) iterator.next();

      pageContext.setAttribute("rowNo", purchaseRequestDetail.getRowNo() + "");
      pageContext.setAttribute(
          "partCode",
          purchaseRequestDetail.getPrPart() == null
              ? ""
              : purchaseRequestDetail.getPrPart().getPnCode());
      pageContext.setAttribute(
          "partName",
          purchaseRequestDetail.getPrPart() == null
              ? ""
              : purchaseRequestDetail.getPrPart().getPnName());
      pageContext.setAttribute(
          "standardLeadTime",
          purchaseRequestDetail.getPrPart() == null
              ? ""
              : purchaseRequestDetail.getPrPart().getPurchaseLeadTime());
      pageContext.setAttribute(
          "requestQty",
          purchaseRequestDetail.getRequestQty() == null
              ? ""
              : purchaseRequestDetail.getRequestQty());
      pageContext.setAttribute(
          "requestDate",
          purchaseRequestDetail.getRequestDate() == null
              ? ""
              : purchaseRequestDetail.getRequestDate());
      pageContext.setAttribute(
          "uom",
          purchaseRequestDetail.getPrPart() == null
              ? ""
              : purchaseRequestDetail.getPrPart().getUom());
      pageContext.setAttribute("isDisable", purchaseRequestDetail.isIsDisable() ? "Y" : "N");
      pageContext.setAttribute("isDelete", purchaseRequestDetail.isIsDelete() ? "Y" : "N");
      pageContext.setAttribute(
          "partCategoryName",
          purchaseRequestDetail.getPrPart() == null
              ? ""
              : purchaseRequestDetail.getPrPart().getPartCategory());
      pageContext.setAttribute(
          "suggestionQty",
          purchaseRequestDetail.getSuggestionQty() == null
              ? ""
              : purchaseRequestDetail.getSuggestionQty());
      pageContext.setAttribute(
          "remark",
          purchaseRequestDetail.getRemark() == null ? "" : purchaseRequestDetail.getRemark());

      pageContext.setAttribute("rowspan", String.valueOf(purchaseRequestDetail.getRowspan()));
      pageContext.setAttribute(
          "bgcolor",
          purchaseRequestDetail.getBgcolor() == null ? "" : purchaseRequestDetail.getBgcolor());

      pageContext.setAttribute(
          "requestQtyError",
          purchaseRequestDetail.isValid("requestQty")
              ? ""
              : purchaseRequestDetail.getMessage("requestQty"));
      pageContext.setAttribute(
          "requestDateError",
          purchaseRequestDetail.isValid("requestDate")
              ? ""
              : purchaseRequestDetail.getMessage("requestDate"));

    } catch (Exception e) {
      e.printStackTrace();
    }
  }