Project

General

Profile

redmine2977.patch

Skye Roseboom, 2012-06-21 19:31

Download (7.22 KB)

View differences:

src/main/java/gov/ornl/mercury3/web/SolrClientController.java (working copy)
671 671
            throws Exception {
672 672

  
673 673
        request.setCharacterEncoding("UTF-8");
674
        System.out.println("In base controller query method &  debug = " + debug);
675 674
        String FileURL23 = "";
676 675
        boolean fullPage = false;
677 676
        boolean browse_ok = false;
......
885 884
    private void fillD1DocInfo(Iterator it) {
886 885
        Map<String, Object> result = (Map) it.next();
887 886
        String pid = (String) result.get("id");
888
        System.out.println("******* result pid: " + pid);
889 887
        List<D1DocTransferObject> related = solrSearcher.findRelatedDocByResourceMap(pid);
890 888
        // don't include science metadata doc in count
891 889
        result.put("d1DataDocCount", related.size());
......
939 937
    public ModelAndView facetsQuerry2(HttpServletRequest request, HttpServletResponse response)
940 938
            throws Exception {
941 939

  
942
        System.out.println("calling facets Querry 2 method in SolrClientController");
943

  
944 940
        boolean get_back = false;
945 941
        String nb = "";
946 942
        SolrTransactionServices solrTransactionServices = new SolrTransactionServices();
......
1498 1494
                        /* Adding to get the datasource code from MTM */
1499 1495
                        // System.out.println("fds>>"+ fds);
1500 1496
                        if (getDatasourceMap().containsKey(fds)) {
1501
                            System.out.println("datasourceMap.getfds>>"
1502
                                    + getDatasourceMap().get(fds));
1503 1497
                            std.setDatasourceCode((getDatasourceMap().get(fds)));
1504 1498
                        }
1505 1499
                        std.setDatasource(request.getParameter("full_datasource"));
......
1724 1718
                        /* Adding to get the datasource code from MTM */
1725 1719
                        // System.out.println("fds>>"+ fds);
1726 1720
                        if (getDatasourceMap().containsKey(fds)) {
1727
                            System.out.println("datasourceMap.getfds>>"
1728
                                    + getDatasourceMap().get(fds));
1729 1721
                            std.setDatasourceCode((getDatasourceMap().get(fds)));
1730 1722
                        }
1731 1723
                        std.setDatasource(request.getParameter("full_datasource"));
......
3269 3261

  
3270 3262
                    for (int x = 0; x < temp.length; x++) {
3271 3263
                        if (use_mn_source_cache) {
3272
                            if (getDatasourceMap().containsKey(temp[x])) {
3273
                                String escapedValue = StringUtils.replace(temp[x], ":", "\\:");
3264
                            String value = StringUtils.replace(temp[x], "\\:", ":");
3265
                            if (getDatasourceMap().containsKey(value)) {
3266
                                String escapedValue = StringUtils.replace(value, ":", "\\:");
3274 3267
                                sourcelist.add(escapedValue);
3275 3268
                                if (temp[x].equalsIgnoreCase("ALL")) {
3276 3269
                                    so.setDs_all("true");
......
3297 3290
            Terms searchmode = new Terms();
3298 3291
            searchmode.setAttribute(request.getParameter("searchmodeAttribute"));
3299 3292
            searchmode.setValue(request.getParameter("searchmode"));
3300
            System.out.println("searchmode" + request.getParameter("searchmodeAttribute"));
3301 3293
            st.setSearchmode(searchmode);
3302 3294
        }
3303 3295
        // ///////////////////////
3304 3296
        if (!(null == request.getParameterValues("term10"))) {
3305 3297
            if (sites.setDatasourcearray(request.getParameterValues("term10"))) {
3306
                System.out.println("(sites.getDatasourcearray()).length  "
3307
                        + (sites.getDatasourcearray()).length);
3308 3298
                if (!(null == sites.getDatasourcearray())
3309 3299
                        && ((sites.getDatasourcearray()).length > 0)) {
3310 3300
                    String[] temp = sites.getDatasourcearray();
......
3319 3309
                            // so.setDs_all("true");
3320 3310
                            st.setDatasources(sourcelist);
3321 3311
                        } else if (getDatasourceMap().containsKey((temp[x].trim()))) {
3322
                            System.out.println("temp[x] => " + temp[x] + " "
3323
                                    + getDatasourceMap().get(temp[x]));
3324 3312
                            sitelist.add(getDatasourceMap().get(temp[x].trim()));
3325 3313
                            // ////////////////////////////////////
3326 3314
                            sourcelist.add(getDatasourceMap().get(temp[x]));
......
3328 3316

  
3329 3317
                            // /////////////////////////
3330 3318
                        } else if (getDatasourceMap().containsValue(temp[x])) {
3331
                            System.out.println("temp[x] => " + temp[x]);
3332 3319
                            sitelist.add(temp[x].trim());
3333 3320
                        }
3334 3321
                    }
......
3342 3329
        if (!(null == request.getParameterValues("term11"))) {
3343 3330
            ArrayList<String> isitelist = new ArrayList<String>();
3344 3331
            if (sites.setDatasourcearray(request.getParameterValues("term11"))) {
3345
                System.out.println("(sites.getDatasourcearray()).length  "
3346
                        + (sites.getDatasourcearray()).length);
3347 3332
                if (!(null == sites.getDatasourcearray())
3348 3333
                        && ((sites.getDatasourcearray()).length > 0)) {
3349 3334
                    String[] temp = sites.getDatasourcearray();
......
3538 3523
                if ((request.getParameter("del_facet")).equalsIgnoreCase("datasource")) {
3539 3524
                    st.setHideDS("false");
3540 3525
                }
3541
                for (int i = 0; i < del_facet_array.length; i++) {
3542

  
3543
                }
3544

  
3545 3526
                String[] temp = st.getDel_facet_array();
3546
                for (int i = 0; i < temp.length; i++) {
3547

  
3548
                }
3549 3527
                for (int x = 0; x < temp.length; x++) {
3550 3528
                    if (hm2.containsKey(temp[x])) {
3551

  
3552
                        // ArrayList<String> t6a = new
3553
                        // ArrayList<String>(so.getT6());
3554
                        ArrayList<String> t6a = new ArrayList<String>(sourcelist);
3555
                        // t6a.remove(hm2.get(temp[x]));
3556
                        so.setT6(t6a);
3557
                        so.setFacet_ds("");
3558
                        st.setSo(so);
3559

  
3560 3529
                        hm2.remove(temp[x]);
3561

  
3530
                        if (("datasource").equalsIgnoreCase(temp[x])) {
3531
                            ArrayList<String> t6a = new ArrayList<String>(sourcelist);
3532
                            so.setT6(t6a);
3533
                            so.setFacet_ds("");
3534
                            st.setSo(so);
3535
                        }
3562 3536
                    }
3563 3537
                }
3564

  
3565 3538
                st.setSolr_facets_map(hm2);
3566

  
3567 3539
            }
3568 3540
        }
3569

  
3570 3541
        if (hm2.size() > 0) {
3571 3542
            st.setSolr_facets_map(hm2);
3572 3543
        }
3573

  
3574 3544
        mercury3_query_string = build_base_request(st);
3575

  
3576 3545
        st.setMercury3_query_string(mercury3_query_string);
3577

  
3578 3546
        return st;
3579 3547
    }
3580 3548

  
Add picture from clipboard (Maximum size: 14.8 MB)