public RowIterator getSuggestedTitles(String title) {
   XxntcTitlesVOImpl titlesVo = getXxntcTitlesVO1();
   ViewCriteria vc = titlesVo.getViewCriteriaManager().getViewCriteria("SuggestedTitles");
   titlesVo.setApplyViewCriteriaName("SuggestedTitles");
   VariableValueManager vvm = vc.ensureVariableManager();
   vvm.setVariableValue("pTitle", title);
   RowIterator ri =
       titlesVo.findByViewCriteria(vc, 25, ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES);
   return ri;
 }
Example #2
0
  public void findBySubmitterId(String submitterId) {
    this.setApplyViewCriteriaNames(null);

    System.err.println("In VO: submitterId is: " + submitterId);
    if (submitterId != null) {
      this.setsbmtId(submitterId);
      ViewCriteria sIdCriteria = this.getViewCriteria("SubmitterIdCriteria");
      this.setApplyViewCriteriaName(sIdCriteria.getName());
      this.executeQuery();
    }
  }
Example #3
0
  public void findByState(String state) {
    this.setApplyViewCriteriaNames(null);

    System.err.println("In VO: state is: " + state);

    if (state != null) {
      this.setOrStateId(state);
      ViewCriteria oStateIdCriteria = this.getViewCriteria("OrderStateCriteria");
      this.setApplyViewCriteriaName(oStateIdCriteria.getName());
      this.executeQuery();
    }
  }
Example #4
0
  public void doQuery(
      String oRdId,
      String state,
      String category,
      Date submitDateFrom,
      Date submitDateTo,
      String submitterId,
      String fromMenu,
      String isFinalApprover,
      String buyerId) {
    this.setApplyViewCriteriaNames(null);

    System.err.println("In VO: oRdId is: " + oRdId);
    System.err.println("In VO: state is: " + state);
    System.err.println("In VO: category is: " + category);
    System.err.println("In VO: submitDateFrom is: " + submitDateFrom);
    System.err.println("In VO: submitDateTo is: " + submitDateTo);
    System.err.println("In VO: submitterId is: " + submitterId);
    System.err.println("In VO: fromMenu is: " + fromMenu);
    System.err.println("In VO: isFinalApprover is: " + isFinalApprover);
    System.err.println("In VO: buyerId is: " + buyerId);

    List<String> vcNames = new ArrayList<String>();

    if (oRdId != null) {
      this.setOdRdId(oRdId);
      ViewCriteria oRdIdCriteria = this.getViewCriteria("OrderReadableIdCriteria");
      vcNames.add(oRdIdCriteria.getName());
    }

    if (state != null
        && state.equals(Constants.PO_STATE_PENDING_APPROVAL)
        && fromMenu != null
        && "approver".equals(fromMenu)) {
      if ("true".equals(isFinalApprover)) {
        this.setCurrApprover(Constants.ROLE_PO_2ND_APPROVER);
      } else {
        this.setCurrApprover(Constants.ROLE_PO_APPROVER);
      }
      ViewCriteria vc = this.getViewCriteria("OrderStateAndCurrApproverCriteria");
      vcNames.add(vc.getName());
    } else if (state != null && !"0".equals(state)) {
      this.setOrStateId(state);
      ViewCriteria oStateIdCriteria = this.getViewCriteria("OrderStateCriteria");
      vcNames.add(oStateIdCriteria.getName());
    } else if (fromMenu != null && "verifier".equals(fromMenu)) {
      ViewCriteria oStateIdCriteria = this.getViewCriteria("OrderForVerifierCriteria");
      vcNames.add(oStateIdCriteria.getName());
    }

    if (category != null && !" ".equals(category)) {
      this.setItCatgId(category);
      ViewCriteria itCatgCriteria = this.getViewCriteria("ItemCategoryCriteria");
      vcNames.add(itCatgCriteria.getName());
    }

    if (submitDateFrom != null) {
      this.setsubmitDateFm(submitDateFrom);
      ViewCriteria dFromCriteria = this.getViewCriteria("SubmitDateFromCriteria");
      vcNames.add(dFromCriteria.getName());
    }

    if (submitDateTo != null) {
      this.setsubmitDateTo(submitDateTo);
      ViewCriteria dToCriteria = this.getViewCriteria("SubmitDateToCriteria");
      vcNames.add(dToCriteria.getName());
    }

    if (submitterId != null && !"0".equals(submitterId)) {
      this.setsbmtId(submitterId);
      ViewCriteria sIdCriteria = this.getViewCriteria("SubmitterIdCriteria");
      vcNames.add(sIdCriteria.getName());
    }

    if (buyerId != null) {
      this.setBuyerId(buyerId);
      ViewCriteria bIdCriteria = this.getViewCriteria("BuyerIdCriteria");
      vcNames.add(bIdCriteria.getName());
    }

    this.setApplyViewCriteriaNames(vcNames.toArray(new String[0]));
    this.executeQuery();
  }