Package com.centraview.advancedsearch

Examples of com.centraview.advancedsearch.SearchCriteriaVO


        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "You must supply at least one Criteria,"));
      }else{
        Iterator iter = searchCriteria.iterator();
        int count = 1;
        while (iter.hasNext()) {
          SearchCriteriaVO criteria = (SearchCriteriaVO)iter.next();
          if (criteria == null || criteria.getValue() == null || (criteria.getValue()).length() <= 0) {
            allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "The Criteria field cannot be blank. (line " + count + ")"));
          }else{
            RuleCriteriaVO ruleCriteriaVO = new RuleCriteriaVO();
            ruleCriteriaVO.setOrderID(count);
            ruleCriteriaVO.setExpressionType(criteria.getExpressionType());

            try{
              ruleCriteriaVO.setFieldID(Integer.parseInt(criteria.getFieldID()));
            }catch(NumberFormatException nfe){
              ruleCriteriaVO.setFieldID(-1);
            }

            try{
              ruleCriteriaVO.setConditionID(Integer.parseInt(criteria.getConditionID()));
            }catch(NumberFormatException nfe){
              ruleCriteriaVO.setConditionID(4);
            }

            ruleCriteriaVO.setValue(criteria.getValue());
            ruleVO.addRuleCriteria(ruleCriteriaVO);
          }
          count++;
        }
      }
View Full Code Here


      }else{
        Iterator iter = searchCriteria.iterator();
        int count = 1;
        while (iter.hasNext())
        {
          SearchCriteriaVO criteria = (SearchCriteriaVO)iter.next();
          if (criteria == null || criteria.getValue() == null || (criteria.getValue()).length() <= 0)
          {
            allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "The Criteria field cannot be blank. (line " + count + ")"));
          }else{
            RuleCriteriaVO ruleCriteriaVO = new RuleCriteriaVO();
            ruleCriteriaVO.setRuleID(ruleID.intValue());
            ruleCriteriaVO.setOrderID(count);
            ruleCriteriaVO.setExpressionType(criteria.getExpressionType());

            try{
              ruleCriteriaVO.setFieldID(Integer.parseInt(criteria.getFieldID()));
            }catch(NumberFormatException nfe){
              ruleCriteriaVO.setFieldID(-1);
            }

            try{
              ruleCriteriaVO.setConditionID(Integer.parseInt(criteria.getConditionID()));
            }catch(NumberFormatException nfe){
              ruleCriteriaVO.setConditionID(4);
            }

            ruleCriteriaVO.setValue(criteria.getValue());
            newRuleVO.addRuleCriteria(ruleCriteriaVO);
          }
          count++;
        }
      }
View Full Code Here

    searchVO.setModuleID(moduleId);
    List searchCriteriaList = Arrays.asList((SearchCriteriaVO[])advancedSearchForm.get("searchCriteria"));
    ArrayList searchCriteria = new ArrayList(searchCriteriaList);
    // before simply setting the criteria on the VO check and make sure we really have any.
    for (int i = 0; i < searchCriteria.size(); i++) {
      SearchCriteriaVO currentCriteria = (SearchCriteriaVO)searchCriteria.get(i);
      if (currentCriteria.getTableID().equals("") || currentCriteria.getFieldID().equals("") || currentCriteria.getValue().equals("")) {
        searchCriteria.remove(i);
      }
    }
    if (searchCriteria.size() > 0) {
      searchVO.setSearchCriteria(searchCriteria);
View Full Code Here

  private SearchCriteriaVO[] addRow(SearchCriteriaVO[] currentCriteria)
  {
    SearchCriteriaVO [] tmpCriteria = new SearchCriteriaVO[currentCriteria.length + 1];
    // populate the newest one, copy in the rest.
    tmpCriteria[tmpCriteria.length-1] = new SearchCriteriaVO();
    System.arraycopy(currentCriteria, 0, tmpCriteria, 0, currentCriteria.length);
    return tmpCriteria;
  } // end addRow()
View Full Code Here

      if (criteriaList != null) {
        SearchCriteriaVO [] searchCriteria = new SearchCriteriaVO[criteriaList.size()];
        Iterator crIter = criteriaList.iterator();
        while (crIter.hasNext()) {
          RuleCriteriaVO criteriaVO = (RuleCriteriaVO)crIter.next();
          SearchCriteriaVO searchCriteriaVO = new SearchCriteriaVO();
          searchCriteriaVO.setExpressionType(criteriaVO.getExpressionType());
          searchCriteriaVO.setFieldID(String.valueOf(criteriaVO.getFieldID()));
          searchCriteriaVO.setConditionID(String.valueOf(criteriaVO.getConditionID()));
          searchCriteriaVO.setValue(criteriaVO.getValue());
          searchCriteria[criteriaVO.getOrderID() - 1] = searchCriteriaVO;
        }

        AdvancedSearchUtil util = new AdvancedSearchUtil();
        // See if we should add a row.
View Full Code Here

        // Marketing List 1 or 2 etc.,
        // If the user selects he wants to apply to all Records then we will not add the criteria
        if (!(marketingListID.equals("0") || marketingListID.equals(""))) {
          int fieldID = globalReplace.getSearchFieldID(replaceTableID);
          if (fieldID != -1) {
            SearchCriteriaVO searchCriteriaVO = new SearchCriteriaVO();
            searchCriteriaVO.setTableID(replaceTableID+"");
            searchCriteriaVO.setFieldID(replaceTableID+"");
            searchCriteriaVO.setConditionID((SearchVO.EQUALS_INTEGER).toString());
            searchCriteriaVO.setExpressionType(GlobalReplaceConstantKeys.SEARCH_AND_OR);
            searchCriteriaVO.setValue(marketingListID);
            searchObject.addSearchCriteria(searchCriteriaVO);
          }
        }

        session.setAttribute("searchObject",searchObject);
View Full Code Here

      if(actionType != null && actionType.equals("Fields")){
        returnStatus = "showGlobalReplaceFields";
        String searchType = (String)globalReplaceForm.get("searchType");
        if(searchType != null && searchType.equals("New Search")){
          if(searchCriteria.length == 1){
            SearchCriteriaVO  searchCriteriaVO = searchCriteria[0];
            String tableID = searchCriteriaVO.getTableID();
            String fieldID = searchCriteriaVO.getFieldID();
            String conditionID = searchCriteriaVO.getConditionID();
            if(tableID != null && tableID.equals("0")){
              allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Record Type"));
            }//end of if(tableID != null && tableID.equals("0"))
            if(fieldID != null && fieldID.equals("0")){
              allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Field"));
View Full Code Here

      if (actionType != null && actionType.equals("Fields")) {
        returnStatus = ".forward.administration.global_replace.fields";
        String searchType = (String)globalReplaceForm.get("searchType");
        if (searchType != null && searchType.equals("New Search")) {
          if (searchCriteria.length == 1) {
            SearchCriteriaVO  searchCriteriaVO = searchCriteria[0];
            String tableID = searchCriteriaVO.getTableID();
            String fieldID = searchCriteriaVO.getFieldID();
            String conditionID = searchCriteriaVO.getConditionID();

            if (tableID != null && tableID.equals("0")) {
              allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Record Type"));
            }
           
View Full Code Here

TOP

Related Classes of com.centraview.advancedsearch.SearchCriteriaVO

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.