Package com.centraview.advancedsearch

Examples of com.centraview.advancedsearch.AdvancedSearch


        adhocReportForm.initialize(actionMapping);
      }
      // make sure the right moduleId is on the form.
      adhocReportForm.set("moduleId", new Integer(moduleId));

      AdvancedSearch remoteAdvancedSearch = null;
      try {
        AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
        remoteAdvancedSearch = advancedSearchHome.create();
        remoteAdvancedSearch.setDataSource(dataSource);
      } catch (Exception e) {
        System.out.println("[Exception][SearchForm.execute] Exception Thrown getting EJB connection: " + e);
        throw new ServletException(e);
      }
      // because we can get reposted get the current criteria from the form.
      // As we may be manipulating the searchCriteria, adding rows, and such.
      SearchCriteriaVO[] searchCriteria = (SearchCriteriaVO[])adhocReportForm.get("searchCriteria");

      // Build dem drop downs
      // if necessary.
      HashMap allFields = (HashMap)adhocReportForm.get("allFields");
      ArrayList tableList = (ArrayList)adhocReportForm.get("tableList");
      ArrayList conditionList = (ArrayList)adhocReportForm.get("conditionList");
      if (conditionList == null || conditionList.isEmpty()) {
        // This will get us the possible search conditions.
        HashMap conditionMap = SearchVO.getConditionOptions();
        // Build an ArrayList of LabelValueBeans
        conditionList = AdvancedSearchUtil.buildSelectOptionList(conditionMap);
        // stick it on the form
        adhocReportForm.set("conditionList", conditionList);
      }
      if (tableList == null || tableList.isEmpty()) {
        HashMap tableMap = remoteAdvancedSearch.getSearchTablesForModule(individualId, moduleId);
        // Build an ArrayList of LabelValueBeans
        tableList = AdvancedSearchUtil.buildSelectOptionList(tableMap);
        adhocReportForm.set("tableList", tableList);

        // if we had to add get the tableList we more than likely
        // have to build the allFields map, so its probably worth the zillion
        // cpu cycles we will have to waste.

        // Get all the appropriate field lists and stick them on the formbean
        // The fieldList (ArrayList of LabelValueBean) will be stored in a
        // HashMap with the key being the (Number)tableId
        TreeSet keySet = new TreeSet(tableMap.keySet());
        Iterator keyIterator = keySet.iterator();
        allFields = new HashMap();
        while (keyIterator.hasNext()) {
          Number key = (Number)keyIterator.next();
          // iterate the tables and get all the field lists
          // stick them in a hashmap of arraylists on the form bean.
          HashMap tableFields = remoteAdvancedSearch.getSearchFieldsForTable(individualId, key.intValue(), moduleId);
          ArrayList tableFieldList = AdvancedSearchUtil.buildSelectOptionList(tableFields);
          allFields.put(key, tableFieldList);
        } // end while(keyIterator.hasNext())
        adhocReportForm.set("allFields", allFields);
      }
View Full Code Here


      }

      int categoryId = this.getCategoryIdFromType(mergeType);
      PrintTemplate PTRemote = PTHome.create();
      PTRemote.setDataSource(dataSource);
      AdvancedSearch remoteAdvancedSearch = advancedSearchHome.create();
      remoteAdvancedSearch.setDataSource(dataSource);
      String savedsearch1 = "";
      String specificentity = "";
      String entitysavedsearch = "";
      if (mergeType.equals("EMAIL")) {
        // collect the Account List and set it to the dynaActionForm.
        Mail mailRemote = mailHome.create();
        mailRemote.setDataSource(dataSource);
        ArrayList accountIDList = mailRemote.getUserAccountList(individualID);
        // also adding delegated accounts
        accountIDList.addAll(mailRemote.getDelegatedAccountList(individualID));
        ArrayList accountList = new ArrayList(); // this, we're sending to the
                                                  // form
        if (accountIDList.size() > 0) {
          // get the details of each account
          Iterator iter = accountIDList.iterator();
          while (iter.hasNext()) {
            Number accountID = (Number) iter.next();
            MailAccountVO accountVO = mailRemote.getMailAccountVO(accountID.intValue());
            InternetAddress address = new InternetAddress(accountVO.getEmailAddress(), accountVO.getAccountName());
            LabelValueBean accountDetails = new LabelValueBean(address.toString(), accountID.toString());
            accountList.add(accountDetails);
          }
        }
        dynaform.set("accountList", accountList);
      } // if (mergeType.equals("EMAIL"))
      entitysavedsearch = (String) dynaform.get("entitysavedsearch");
      if (entitysavedsearch.equals("ENTITY")) {
        savedsearch1 = (String) dynaform.get("savedsearch1");
      }
      if (entitysavedsearch.equals("SPECIFICENTITY")) {
        specificentity = (String) dynaform.get("specificentity");
      }
      // So if this is an email or print merge basically we need to gather up
      // a whole buttload of information to figure out which individuals will
      // be getting the message
      if (specificentity.equals("SPECIFICPRIMARY") && entitysavedsearch.equals("SPECIFICENTITY")) {
        // get the primary contact for this entity, they are the target
        // recipient
        String entityid = (String) dynaform.get("selectedEntityId");
        ArrayList entityIdCollection = new ArrayList();
        entityIdCollection.add(entityid);
        Collection contactID = PTRemote.getContactsForEntity(entityIdCollection, true);
        Iterator contactIdIterator = contactID.iterator();
        HashMap individualIds = new HashMap();
        if (contactIdIterator.hasNext()) {
          Number individualId = (Number) contactIdIterator.next();
          individualIds.put(individualId.toString(), individualId.toString());
        }
        dynaform.set("toIndividuals", individualIds);
      } else if (specificentity.equals("SPECIFICALL") && entitysavedsearch.equals("SPECIFICENTITY")) {
        // All individuals associated with the selected entity are
        // to be recipients
        String entityid = (String) dynaform.get("selectedEntityId");
        ArrayList entityIdCollection = new ArrayList();
        entityIdCollection.add(entityid);
        Collection contactID = PTRemote.getContactsForEntity(entityIdCollection, false);
        Iterator contactIdIterator = contactID.iterator();
        HashMap individualIds = new HashMap();
        while (contactIdIterator.hasNext()) {
          Number individualId = (Number) contactIdIterator.next();
          individualIds.put(individualId.toString(), individualId.toString());
        }
        dynaform.set("toIndividuals", individualIds);
      } else if (specificentity.equals("SPECIFICCONTACT") && entitysavedsearch.equals("SPECIFICENTITY")) {
        // specific
        String individualid = (String) dynaform.get("individualId");
        HashMap individualIds = new HashMap();
        individualIds.put(individualid, individualid);
        dynaform.set("toIndividuals", individualIds);
      } else if (entitysavedsearch.equals("INDIVIDUAL")) {
        String individualSearchId = (String) dynaform.get("individualSearchId");
        ArrayList results = new ArrayList();
        results.addAll(remoteAdvancedSearch.performSearch(individualID, Integer.parseInt(individualSearchId), "ADVANCE", null));
        HashMap individualIds = new HashMap();
        for (int i = 0; i < results.size(); i++) {
          Number resultId = (Number) results.get(i);
          // I stuck the key and value in to this hashmap as the same string
          // as that is how the rest of print templates is written and I
          // didn't have time to make it more reasonable.
          individualIds.put(resultId.toString(), resultId.toString());
        }
        dynaform.set("toIndividuals", individualIds);
      } else if (entitysavedsearch.equals("ENTITY") && savedsearch1.equals("PRIMARY")) {
        // this is when an entity saved search is selected, and we need to
        // get the individualid's of the primary contacts for the found set
        // of entities.
        String entitySearchId = (String) dynaform.get("entityId");
        ArrayList results = new ArrayList();
        results.addAll(remoteAdvancedSearch.performSearch(individualID, Integer.parseInt(entitySearchId), "ADVANCE", null));
        // results contains our collection of entity ids.
        Collection contactID = PTRemote.getContactsForEntity(results, true);
        Iterator contactIdIterator = contactID.iterator();
        HashMap individualIds = new HashMap();
        while (contactIdIterator.hasNext()) {
          Number individualId = (Number) contactIdIterator.next();
          individualIds.put(individualId.toString(), individualId.toString());
        }
        dynaform.set("toIndividuals", individualIds);
      } else if (entitysavedsearch.equals("ENTITY") && savedsearch1.equals("ALL")) {
        // This is exactly the same as above, except we are getting all
        // individuals instead of just primary contacts.
        String entitySearchId = (String) dynaform.get("entityId");
        ArrayList results = new ArrayList();
        results.addAll(remoteAdvancedSearch.performSearch(individualID, Integer.parseInt(entitySearchId), "ADVANCE", null));
        // results contains our collection of entity ids.
        Collection contactID = PTRemote.getContactsForEntity(results, false);
        Iterator contactIdIterator = contactID.iterator();
        HashMap individualIds = new HashMap();
        while (contactIdIterator.hasNext()) {
View Full Code Here

    reportForm.set("moduleId", new Integer(moduleId));
    reportForm.set("name", reportVO.getName());
    reportForm.set("reportId", new Integer(reportVO.getReportId()));
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    // Get Saved searches from the EJB
    AdvancedSearch remoteAdvancedSearch = null;
    try {
      AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
      remoteAdvancedSearch = advancedSearchHome.create();
      remoteAdvancedSearch.setDataSource(dataSource);
    } catch (Exception e) {
      logger.error("[getAdHocReportFormFromReportVO] Exception thrown.", e);
    }
    HashMap allFields = (HashMap)reportForm.get("allFields");
    // Only repopulate all the lists if it is empty
    if (allFields == null || allFields.isEmpty()) {
      // Build dem drop downs
      HashMap tableMap = remoteAdvancedSearch.getSearchTablesForModule(individualId, moduleId);
      HashMap conditionMap = SearchVO.getConditionOptions();
      // Build an ArrayList of LabelValueBeans
      ArrayList tableList = AdvancedSearchUtil.buildSelectOptionList(tableMap);
      ArrayList conditionList = AdvancedSearchUtil.buildSelectOptionList(conditionMap);
      reportForm.set("tableList", tableList);
      reportForm.set("conditionList", conditionList);

      // Get all the appropriate field lists and stick them on the formbean
      // The fieldList (ArrayList of LabelValueBean) will be stored in a
      // HashMap with the key being the (Number)tableId
      TreeSet keySet = new TreeSet(tableMap.keySet());
      Iterator keyIterator = keySet.iterator();
      allFields = new HashMap();
      while (keyIterator.hasNext()) {
        Number key = (Number)keyIterator.next();
        // iterate the tables and get all the field lists
        // stick them in a hashmap of arraylists on the form bean.
        HashMap tableFields = remoteAdvancedSearch.getSearchFieldsForTable(individualId, key.intValue(), moduleId);
        ArrayList tableFieldList = AdvancedSearchUtil.buildSelectOptionList(tableFields);
        allFields.put(key, tableFieldList);
      } // end while(keyIterator.hasNext())
      reportForm.set("allFields", allFields);
    } // end if (allFields == null || allFields.isEmpty())
View Full Code Here

    // fields for the search part of things.
    reportForm.set("ownerId", (String.valueOf(individualId)));
    SearchCriteriaVO[] searchCriteria = (SearchCriteriaVO[])reportForm.get("searchCriteria");
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    // We need some advanced Search stuff from the EJB layer
    AdvancedSearch remoteAdvancedSearch = null;
    try {
      AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
      remoteAdvancedSearch = advancedSearchHome.create();
      remoteAdvancedSearch.setDataSource(dataSource);
    } catch (Exception e) {
      logger.error("[getStandardReportFormFromReportVO] Exception thrown.", e);
    }
    HashMap allFields = (HashMap)reportForm.get("allFields");
    // Only repopulate all the lists if it is empty
    if (allFields == null || allFields.isEmpty()) {
      // Build dem drop downs
      HashMap tableMap = remoteAdvancedSearch.getSearchTablesForModule(individualId, moduleId);
      HashMap conditionMap = SearchVO.getConditionOptions();
      // Build an ArrayList of LabelValueBeans
      ArrayList tableList = AdvancedSearchUtil.buildSelectOptionList(tableMap);
      ArrayList conditionList = AdvancedSearchUtil.buildSelectOptionList(conditionMap);
      // Get all the appropriate field lists and stick them on the formbean
      // The fieldList (ArrayList of LabelValueBean) will be stored in a
      // HashMap with the key being the (Number)tableId
      TreeSet keySet = new TreeSet(tableMap.keySet());
      Iterator keyIterator = keySet.iterator();
      allFields = new HashMap();
      while (keyIterator.hasNext()) {
        Number key = (Number)keyIterator.next();
        // iterate the tables and get all the field lists
        // stick them in a hashmap of arraylists on the form bean.
        HashMap tableFields = remoteAdvancedSearch.getSearchFieldsForTable(individualId, key.intValue(), moduleId);
        ArrayList tableFieldList = AdvancedSearchUtil.buildSelectOptionList(tableFields);
        allFields.put(key, tableFieldList);
      } // end while(keyIterator.hasNext())
      reportForm.set("allFields", allFields);
      reportForm.set("tableList", tableList);
View Full Code Here

      HashMap conditionMap = SearchVO.getConditionOptions();
      ArrayList conditionList = this.buildSelectOptionList(conditionMap);
      ruleForm.set("conditionList", conditionList);

      // Get Saved search EJB
      AdvancedSearch remoteAdvancedSearch = null;
      try {
        AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
        remoteAdvancedSearch = advancedSearchHome.create();
        remoteAdvancedSearch.setDataSource(dataSource);
      }catch(Exception e){
        System.out.println("[Exception][SearchForm.execute] Exception Thrown getting EJB connection: " + e);
        throw new ServletException(e);
      }

      final int emailTableID = 33;
      final int emailModuleID = 79;

      HashMap tableFields = remoteAdvancedSearch.getSearchFieldsForTable(individualID, emailTableID, emailModuleID);
      ArrayList tableFieldList = this.buildSelectOptionList(tableFields);
      ruleForm.set("fieldList", tableFieldList);

      // See if we should add a row.
      String addRow = (String)ruleForm.get("addRow");
View Full Code Here

      HashMap conditionMap = SearchVO.getConditionOptions();
      ArrayList conditionList = AdvancedSearchUtil.buildSelectOptionList(conditionMap);
      ruleForm.set("conditionList", conditionList);

      // Get Saved search EJB
      AdvancedSearch remoteAdvancedSearch = null;
      try {
        AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
        remoteAdvancedSearch = advancedSearchHome.create();
        remoteAdvancedSearch.setDataSource(dataSource);
      }catch(Exception e){
        System.out.println("[Exception][SearchForm.execute] Exception Thrown getting EJB connection: " + e);
        throw new ServletException(e);
      }

      final int emailTableID = 33;
      final int emailModuleID = 79;

      HashMap tableFields = remoteAdvancedSearch.getSearchFieldsForTable(individualID, emailTableID, emailModuleID);
      ArrayList tableFieldList = AdvancedSearchUtil.buildSelectOptionList(tableFields);
      ruleForm.set("fieldList", tableFieldList);

      // get the user's list of folders for this account
      HashMap folderList = remote.getFolderList(accountID.intValue());
View Full Code Here

      String displayListFlag = (String) request.getAttribute("displayListFlag");
      DisplayList displaylistRequest = (DisplayList)request.getAttribute("displaylist");
     
      if ((displayListFlag != null && displayListFlag.equals("true")) || displaylistRequest == null ) {
        // Get Advance Search result by applying the Search criteria
        AdvancedSearch remoteAdvancedSearch = null;
        AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
        try {
          remoteAdvancedSearch = advancedSearchHome.create();
          remoteAdvancedSearch.setDataSource(dataSource);
        } catch (Exception e) {
          logger.error("[Exception] GlobalReplaceHandler.Execute Handler ", e);
        }
       
        // If the user selecte the New Search then build Search VO.
        // Else pass the searchId to the EJB and get the searchVO.
        SearchVO searchObject = new SearchVO();
        String searchType = (String)globalReplaceForm.get("searchType");
        if (searchType != null && searchType.equals("New Search")) {
          searchObject.setModuleID(moduleId);
          searchObject.setName("New Search");
          List searchCriteria = Arrays.asList((SearchCriteriaVO[])globalReplaceForm.get("searchCriteria"));
          searchObject.setSearchCriteria(searchCriteria);
        } else {
          String savedSearchID = (String)globalReplaceForm.get("savedSearchID");
          if (!(savedSearchID.equals("0") || savedSearchID.equals(""))) {
            searchObject = remoteAdvancedSearch.getSavedSearch(Integer.parseInt(savedSearchID),"ADVANCE",null);
          }
        }

        // Add an extra search Criteria on User selected criteria
        // The Criteria is defined so that user is categorizing the search should be applied to
        // 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);
        ArrayList resultsIDs = new ArrayList();
        resultsIDs.addAll(remoteAdvancedSearch.performSearch(individualId,searchObject));
        request.setAttribute("displayListFlag","false");
      }

      globalReplaceForm.set("replaceValue","");
      globalReplaceForm.set("replaceID","");
View Full Code Here

    viewForm.set("availableFields", availableFields);
    viewForm.set("allFields", allFields);

    // get the list of available searches
    AdvancedSearchHome searchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome","AdvancedSearch");
    AdvancedSearch searchRemote = null;
    try {
      searchRemote = (AdvancedSearch)searchHome.create();
    } catch (CreateException e) {
      System.out.println("[execute] Exception thrown: " + e);
      throw new ServletException(e);
    }
    searchRemote.setDataSource(dataSource);

    String moduleIdString = AdvancedSearchUtil.getModuleId(listType, dataSource);

    int moduleId = 0;
    try {
      moduleId = Integer.parseInt(moduleIdString);
    } catch (NumberFormatException nfe) {
      // already set default value...
    }

    HashMap searchListDb = searchRemote.getSavedSearchList(individualId, moduleId);

    ArrayList searchList = new ArrayList();
   
    // the EJB returns a HashMap of key/value pairs, each key being
    // a searchID, and value being the name. Not the best way to send
View Full Code Here

      Vector primaryReplaceTableList = globalReplace.getPrimaryReplaceTables();
      globalReplaceForm.set("replaceTableVec",primaryReplaceTableList);

      // intialize the Advance Search EJB
      AdvancedSearch remoteAdvancedSearch = null;
      AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
      try
      {
        remoteAdvancedSearch = advancedSearchHome.create();
        remoteAdvancedSearch.setDataSource(dataSource);
      }
      catch (Exception e)
      {
        logger.error("[Exception] GobalReplaceSearchHandler.Execute Handler ", e);
      }

      HashMap savedSearchMap = remoteAdvancedSearch.getSavedSearchList(individualId, moduleId);
      Vector savedSearchVec = new Vector();
      if(savedSearchMap != null){
        Set savedSearchIds = savedSearchMap.keySet();
        Iterator idIterator = savedSearchIds.iterator();
        while (idIterator.hasNext())
        {
          Number searchId = (Number)idIterator.next();
          String searchName = (String)savedSearchMap.get(searchId);
          savedSearchVec.add(new DDNameValue(searchId.toString(),searchName));
        }
      }
      globalReplaceForm.set("savedSearchVec", savedSearchVec);

      HashMap allFields = (HashMap)globalReplaceForm.get("allFields");
      // Only repopulate all the lists if it is empty
      if (allFields == null || allFields.isEmpty())
      {
        // Build dem drop downs
        HashMap tableMap = remoteAdvancedSearch.getSearchTablesForModule(individualId, moduleId);
        HashMap conditionMap = SearchVO.getConditionOptions();
        // Build an ArrayList of LabelValueBeans
        ArrayList tableList = AdvancedSearchUtil.buildSelectOptionList(tableMap);
        ArrayList conditionList = AdvancedSearchUtil.buildSelectOptionList(conditionMap);
        globalReplaceForm.set("tableList", tableList);
        globalReplaceForm.set("conditionList", conditionList);

        // Get all the appropriate field lists and stick them on the formbean
        // The fieldList (ArrayList of LabelValueBean) will be stored in a
        // HashMap with the key being the (Number)tableId
        TreeSet keySet = new TreeSet(tableMap.keySet());
        Iterator keyIterator = keySet.iterator();
        allFields = new HashMap();
        while(keyIterator.hasNext())
        {
          Number key = (Number)keyIterator.next();
          // iterate the tables and get all the field lists
          // stick them in a hashmap of arraylists on the form bean.
          HashMap tableFields = remoteAdvancedSearch.getSearchFieldsForTable(individualId, key.intValue(), moduleId);
          ArrayList tableFieldList = AdvancedSearchUtil.buildSelectOptionList(tableFields);
          allFields.put(key, tableFieldList);
        } // end while(keyIterator.hasNext())
        globalReplaceForm.set("allFields",allFields);
      } // end if (allFields == null || allFields.isEmpty())
View Full Code Here

      Vector primaryReplaceTableList = globalReplace.getPrimaryReplaceTables();
      globalReplaceForm.set("replaceTableVec",primaryReplaceTableList);

      // intialize the Advance Search EJB
      AdvancedSearch remoteAdvancedSearch = null;
      AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
      try {
        remoteAdvancedSearch = advancedSearchHome.create();
        remoteAdvancedSearch.setDataSource(dataSource);
      } catch (Exception e) {
        logger.error("[Exception] GlobalReplaceSearchHandler.Execute Handler ", e);
      }

      HashMap savedSearchMap = remoteAdvancedSearch.getSavedSearchList(individualId, moduleId);
      Vector savedSearchVec = new Vector();
      if (savedSearchMap != null) {
        Set savedSearchIds = savedSearchMap.keySet();
        Iterator idIterator = savedSearchIds.iterator();
        while (idIterator.hasNext()) {
          Number searchId = (Number)idIterator.next();
          String searchName = (String)savedSearchMap.get(searchId);
          savedSearchVec.add(new DDNameValue(searchId.toString(),searchName));
        }
      }
      globalReplaceForm.set("savedSearchVec", savedSearchVec);

      HashMap allFields = (HashMap)globalReplaceForm.get("allFields");
      // Only repopulate all the lists if it is empty
      if (allFields == null || allFields.isEmpty()) {
        // Build dem drop downs
        HashMap tableMap = remoteAdvancedSearch.getSearchTablesForModule(individualId, moduleId);
        HashMap conditionMap = SearchVO.getConditionOptions();
        // Build an ArrayList of LabelValueBeans
        ArrayList tableList = AdvancedSearchUtil.buildSelectOptionList(tableMap);
        ArrayList conditionList = AdvancedSearchUtil.buildSelectOptionList(conditionMap);
        globalReplaceForm.set("tableList", tableList);
        globalReplaceForm.set("conditionList", conditionList);

        // Get all the appropriate field lists and stick them on the formbean
        // The fieldList (ArrayList of LabelValueBean) will be stored in a
        // HashMap with the key being the (Number)tableId
        TreeSet keySet = new TreeSet(tableMap.keySet());
        Iterator keyIterator = keySet.iterator();
        allFields = new HashMap();
        while (keyIterator.hasNext()) {
          Number key = (Number)keyIterator.next();
          // iterate the tables and get all the field lists
          // stick them in a hashmap of arraylists on the form bean.
          HashMap tableFields = remoteAdvancedSearch.getSearchFieldsForTable(individualId, key.intValue(), moduleId);
          ArrayList tableFieldList = AdvancedSearchUtil.buildSelectOptionList(tableFields);
          allFields.put(key, tableFieldList);
        }
        globalReplaceForm.set("allFields",allFields);
      } // end if (allFields == null || allFields.isEmpty())
View Full Code Here

TOP

Related Classes of com.centraview.advancedsearch.AdvancedSearch

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.