### Eclipse Workspace Patch 1.0 #P d1_mercury_common Index: src/main/java/gov/ornl/mercury3/web/SolrClientController.java =================================================================== --- src/main/java/gov/ornl/mercury3/web/SolrClientController.java (revision 8445) +++ src/main/java/gov/ornl/mercury3/web/SolrClientController.java (working copy) @@ -671,7 +671,6 @@ throws Exception { request.setCharacterEncoding("UTF-8"); - System.out.println("In base controller query method & debug = " + debug); String FileURL23 = ""; boolean fullPage = false; boolean browse_ok = false; @@ -885,7 +884,6 @@ private void fillD1DocInfo(Iterator it) { Map result = (Map) it.next(); String pid = (String) result.get("id"); - System.out.println("******* result pid: " + pid); List related = solrSearcher.findRelatedDocByResourceMap(pid); // don't include science metadata doc in count result.put("d1DataDocCount", related.size()); @@ -939,8 +937,6 @@ public ModelAndView facetsQuerry2(HttpServletRequest request, HttpServletResponse response) throws Exception { - System.out.println("calling facets Querry 2 method in SolrClientController"); - boolean get_back = false; String nb = ""; SolrTransactionServices solrTransactionServices = new SolrTransactionServices(); @@ -1498,8 +1494,6 @@ /* Adding to get the datasource code from MTM */ // System.out.println("fds>>"+ fds); if (getDatasourceMap().containsKey(fds)) { - System.out.println("datasourceMap.getfds>>" - + getDatasourceMap().get(fds)); std.setDatasourceCode((getDatasourceMap().get(fds))); } std.setDatasource(request.getParameter("full_datasource")); @@ -1724,8 +1718,6 @@ /* Adding to get the datasource code from MTM */ // System.out.println("fds>>"+ fds); if (getDatasourceMap().containsKey(fds)) { - System.out.println("datasourceMap.getfds>>" - + getDatasourceMap().get(fds)); std.setDatasourceCode((getDatasourceMap().get(fds))); } std.setDatasource(request.getParameter("full_datasource")); @@ -3269,8 +3261,9 @@ for (int x = 0; x < temp.length; x++) { if (use_mn_source_cache) { - if (getDatasourceMap().containsKey(temp[x])) { - String escapedValue = StringUtils.replace(temp[x], ":", "\\:"); + String value = StringUtils.replace(temp[x], "\\:", ":"); + if (getDatasourceMap().containsKey(value)) { + String escapedValue = StringUtils.replace(value, ":", "\\:"); sourcelist.add(escapedValue); if (temp[x].equalsIgnoreCase("ALL")) { so.setDs_all("true"); @@ -3297,14 +3290,11 @@ Terms searchmode = new Terms(); searchmode.setAttribute(request.getParameter("searchmodeAttribute")); searchmode.setValue(request.getParameter("searchmode")); - System.out.println("searchmode" + request.getParameter("searchmodeAttribute")); st.setSearchmode(searchmode); } // /////////////////////// if (!(null == request.getParameterValues("term10"))) { if (sites.setDatasourcearray(request.getParameterValues("term10"))) { - System.out.println("(sites.getDatasourcearray()).length " - + (sites.getDatasourcearray()).length); if (!(null == sites.getDatasourcearray()) && ((sites.getDatasourcearray()).length > 0)) { String[] temp = sites.getDatasourcearray(); @@ -3319,8 +3309,6 @@ // so.setDs_all("true"); st.setDatasources(sourcelist); } else if (getDatasourceMap().containsKey((temp[x].trim()))) { - System.out.println("temp[x] => " + temp[x] + " " - + getDatasourceMap().get(temp[x])); sitelist.add(getDatasourceMap().get(temp[x].trim())); // //////////////////////////////////// sourcelist.add(getDatasourceMap().get(temp[x])); @@ -3328,7 +3316,6 @@ // ///////////////////////// } else if (getDatasourceMap().containsValue(temp[x])) { - System.out.println("temp[x] => " + temp[x]); sitelist.add(temp[x].trim()); } } @@ -3342,8 +3329,6 @@ if (!(null == request.getParameterValues("term11"))) { ArrayList isitelist = new ArrayList(); if (sites.setDatasourcearray(request.getParameterValues("term11"))) { - System.out.println("(sites.getDatasourcearray()).length " - + (sites.getDatasourcearray()).length); if (!(null == sites.getDatasourcearray()) && ((sites.getDatasourcearray()).length > 0)) { String[] temp = sites.getDatasourcearray(); @@ -3538,43 +3523,26 @@ if ((request.getParameter("del_facet")).equalsIgnoreCase("datasource")) { st.setHideDS("false"); } - for (int i = 0; i < del_facet_array.length; i++) { - - } - String[] temp = st.getDel_facet_array(); - for (int i = 0; i < temp.length; i++) { - - } for (int x = 0; x < temp.length; x++) { if (hm2.containsKey(temp[x])) { - - // ArrayList t6a = new - // ArrayList(so.getT6()); - ArrayList t6a = new ArrayList(sourcelist); - // t6a.remove(hm2.get(temp[x])); - so.setT6(t6a); - so.setFacet_ds(""); - st.setSo(so); - hm2.remove(temp[x]); - + if (("datasource").equalsIgnoreCase(temp[x])) { + ArrayList t6a = new ArrayList(sourcelist); + so.setT6(t6a); + so.setFacet_ds(""); + st.setSo(so); + } } } - st.setSolr_facets_map(hm2); - } } - if (hm2.size() > 0) { st.setSolr_facets_map(hm2); } - mercury3_query_string = build_base_request(st); - st.setMercury3_query_string(mercury3_query_string); - return st; }