Changeset 5401


Ignore:
Timestamp:
2003-09-01T15:44:22+12:00 (21 years ago)
Author:
kjdon
Message:

tidying up println stuff

Location:
trunk/gsdl3/src/java/org/greenstone/gsdl3
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/Action.java

    r5155 r5401  
    7272        for (int i=0; i<nodes.getLength(); i++) {
    7373        String name = ((Element)nodes.item(i)).getAttribute("name");
    74         System.out.println("found a metadata name="+name);
    7574        String select = ((Element)nodes.item(i)).getAttribute("select");
    7675        if (select.equals("parent")) {
     
    9897   
    9998    }
    100     System.out.println("metadata list = "+this.converter.getString(param_list));
    10199    return param_list;
    102100    }
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/BrowseAction.java

    r5155 r5401  
    276276       
    277277
    278     System.out.println("(BrowseAction) Page:\n" + this.converter.getPrettyString(page_response));
     278    ///ystem.out.println("(BrowseAction) Page:\n" + this.converter.getPrettyString(page_response));
    279279    return page_response;
    280280    }
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/DocumentAction.java

    r5155 r5401  
    301301        // now we can modifiy the response doc if needed
    302302        String enrich_service = (String)params.get(GSParams.SERVICE);
    303         System.out.println("enrich service is "+enrich_service);
    304303        // send a message to the service
    305304        Element enrich_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java

    r5155 r5401  
    1818   
    1919    public static final String CLASSIFIER_ARG = "cl";
    20     //public static final String SIBLING_ARG = "sib";
    21     // public static final String HORIZ_AT_TOP_ARG = "hat";
    2220   
    2321    /** process the request */
     
    5149    }
    5250   
    53 //      boolean horizontal_at_top = false;
    54 //      String hat = (String) params.get(HORIZ_AT_TOP_ARG);
    55 //      if (hat != null && hat.equals("1")) {
    56 //          horizontal_at_top = true;
    57 //      }
    58     //whether to retrieve siblings or not
    59 //      boolean get_siblings = false;
    60 //      String sibs = (String) params.get(SIBLING_ARG);
    61 //      if (sibs != null && sibs.equals("1")) {
    62 //          get_siblings = true;
    63 //      }
    64 
    6551    String lang = request.getAttribute(GSXML.LANG_ATT);
    6652    String to = GSPath.appendLink(collection, service_name);
     
    122108        Element new_format = GSXML.duplicateWithNewName(this.doc, this_format, GSXML.FORMAT_ELEM, false);
    123109        extractMetadataNames(new_format, doc_meta_names, class_meta_names);
    124         // set teh format type
     110        // set the format type
    125111        new_format.setAttribute(GSXML.TYPE_ATT, "browse");
    126112
     
    159145    param.setAttribute(GSXML.NAME_ATT, "structure");
    160146    param.setAttribute(GSXML.VALUE_ATT, "children");
    161 //      if (get_siblings) {
    162 //          param = this.doc.createElement(GSXML.PARAM_ELEM);
    163 //          param_list.appendChild(param);
    164 //          param.setAttribute(GSXML.NAME_ATT, "structure");
    165 //          param.setAttribute(GSXML.VALUE_ATT, "siblings");
    166 //      }
    167147
    168148    // put the classifier node into a classifier node list
     
    174154       
    175155    if (horizontal_at_top && !classifier_node.equals(top_id)) {
    176         // also put the top id in, to get teh persistant horizontal info
     156        // also put the top id in, to get the persistant horizontal info
    177157        classifier = this.doc.createElement(GSXML.CLASS_NODE_ELEM);
    178158        classifier.setAttribute(GSXML.NODE_ID_ATT, top_id);
    179159        classifier_list.appendChild(classifier);
    180         System.out.println("GS2Browse:adding in the top node");
    181160    }
    182161    // process the request
    183162    Element classify_response = (Element)this.mr.process(classify_message);
    184     System.out.println("GS2Browse: classify response***********");
    185     System.out.println(this.converter.getPrettyString(classify_response));
    186     // get the structure element
    187     //String [] links = {GSXML.MESSAGE_ELEM, GSXML.RESPONSE_ELEM, GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER};
    188     //String path = GSPath.createPath(links);
    189163    String path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER);
    190164    Element class_node_list = (Element)GSXML.getNodeByPath(classify_response, path);
    191165   
    192     //path = GSPath.appendLink(path, GSXML.CLASS_NODE_ELEM);
    193166    path = GSPath.appendLink(GSXML.CLASS_NODE_ELEM, GSXML.NODE_STRUCTURE_ELEM);
    194167    // assume that we always get back the top level CL1 node - this becomes the page_classifier node
     
    204177    if (horizontal_at_top && !classifier_node.equals(top_id)) {
    205178        // get the info for the top node
    206         //NodeList class_nodes = class_node_list.getElementsByTagName(GSXML.CLASSIFIER_ELEM);
    207        
    208179        Element top_node = GSXML.getNamedElement(class_node_list, GSXML.CLASS_NODE_ELEM, GSXML.NODE_ID_ATT, top_id);
    209180        if (top_node !=null) {
     
    332303       
    333304
    334     System.out.println("(GS2BrowseAction) Page:\n" + this.converter.getPrettyString(page_response));
     305    ///ystem.out.println("(GS2BrowseAction) Page:\n" + this.converter.getPrettyString(page_response));
    335306    return page_response;
    336307    }
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/QueryAction.java

    r5191 r5401  
    177177    }
    178178
    179     // System.out.println("Query page:\n" + converter_.getPrettyString(page_response));
     179    ///ystem.out.println("Query page:\n" + converter_.getPrettyString(page_response));
    180180    return page_response;
    181181    }
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Retrieve.java

    r5380 r5401  
    109109    String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name);
    110110    if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {
    111         System.err.println("Error: Could not open GDBM database!");
     111        System.err.println("GS2Retrieve Error: Could not open GDBM database!");
    112112        return false;
    113113    }
     
    173173    Element display_format = (Element)GSXML.getNodeByPath(extra_info, path);
    174174    if (display_format != null) {
    175         System.out.println("display format not null!");
    176175        this.format_info_map.put(DOCUMENT_METADATA_RETRIEVE_SERVICE, this.doc.importNode(display_format, true));
    177176        // shoudl we make a copy?
     
    414413    if (current_node ==null) {
    415414        // create a sensible error message
    416         System.err.println("Error: there should be a first child.");
     415        System.err.println("GS2Retrieve Error: there should be a first child.");
    417416        return null;
    418417    }
     
    480479    Element query_doc_list = (Element) GSXML.getChildByTagName(request, node_name+GSXML.LIST_MODIFIER);
    481480    if (query_doc_list == null) {
    482         System.err.println("Error: DocumentStructureRetrieve request specified no doc nodes.\n");
     481        System.err.println("GS2Retrieve Error: DocumentStructureRetrieve request specified no doc nodes.\n");
    483482        return result;
    484483    }
     
    487486    Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
    488487    if (param_list == null) {
    489         System.err.println("Error: DocumentStructureRetrieve request had no paramList.");
     488        System.err.println("GS2Retrieve Error: DocumentStructureRetrieve request had no paramList.");
    490489        return result;  // Return the empty result
    491490    }
     
    526525            want_descendants = true;
    527526        else
    528             System.err.println("Warning: Unknown value \"" + p_value + "\".");
     527            System.err.println("GS2Retrieve Warning: Unknown value \"" + p_value + "\".");
    529528        } else if (p_name.equals(INFO_PARAM)) {
    530529        want_info = true;
     
    550549        String doc_id = doc_ids[i];
    551550       
    552         System.out.println("doc_id = "+doc_id);
    553551        if (OID.needsTranslating(doc_id)) {
    554552        doc_id = this.gdbm_src.translateOID(doc_id);
    555         System.out.println("translated doc_id = "+doc_id);
    556553        }
    557554
     
    714711        continue;
    715712        }
    716         System.out.println("found the info");
    717713        if (all_metadata) {
    718         System.out.println("trying to get all the metadata");
    719714        // return everything out of the database
    720715        Set keys = info.getKeys();
     
    722717        while(it.hasNext()) {
    723718            String key = (String)it.next();
    724             System.out.println("getting metadata "+key);
    725719            String value = info.getInfo(key);
    726720            GSXML.addMetadata(this.doc, node_meta_list, key, value);
     
    734728        }
    735729        }
    736         //String v = getMetadata (node_id, info, "parent_Title");
    737         //System.out.println("parent title = "+v);
    738         //v = getMetadata (node_id, info, "ancestors': '_Title");
    739         //System.out.println("ancestortitle = "+v);
    740730    }
    741731   
     
    837827        for (int i=0;i<children.length;i++) {
    838828            String child_id = children[i];
    839             System.out.println("child="+child_id+" doc="+doc_id);
    840829            if (child_id.equals(doc_id)) {
    841830            value = String.valueOf(i+1); // make it from 1 to length
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/InfomineProxy.java

    r5227 r5401  
    186186       
    187187    } catch (Exception e) {
    188         System.out.println("InfomineProxy.TextQuery Error: exception happened during query");
     188        System.err.println("InfomineProxy.TextQuery Error: exception happened during query");
    189189        e.printStackTrace();
    190190    }
     
    193193        results_num = results_num.substring(11);
    194194    } else {
    195         System.out.println("InfomineProxy.TextQuery Error: badly formatted results line: "+results_num);
     195        System.err.println("InfomineProxy.TextQuery Error: badly formatted results line: "+results_num);
    196196        return result;
    197197    }
     
    199199        doc_ids = doc_ids.substring(5).trim();
    200200    } else {
    201         System.out.println("InfomineProxy.TextQuery Error: badly formatted docs line: "+doc_ids);
     201        System.err.println("InfomineProxy.TextQuery Error: badly formatted docs line: "+doc_ids);
    202202        return result;
    203203    }
     
    302302        }
    303303    } catch (Exception e) {
    304         System.out.println("InfomineProxy Error:exception happened");
     304        System.err.println("InfomineProxy Error:exception happened");
    305305        e.printStackTrace();
    306306    }
     
    354354       
    355355    } catch (Exception e) {
    356         System.out.println("InfomineProxy Error:exception happened");
     356        System.err.println("InfomineProxy Error:exception happened");
    357357        e.printStackTrace();
    358358    }
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java

    r5257 r5401  
    7575    Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
    7676    if (param_list == null) {
    77         System.err.println("Error: TextQuery request had no paramList.");
     77        System.err.println("LuceneSearch Error: TextQuery request had no paramList.");
    7878        return result;  // Return the empty result
    7979    }
     
    8585    String query_string = (String) params.get(QUERY_PARAM);
    8686    if (query_string == null || query_string.equals("")) {
    87         System.err.println("Error: TextQuery request had no query string.");
     87        System.err.println("LuceneSearch Error: TextQuery request had no query string.");
    8888        return result;  // Return the empty result
    8989    }
     
    9999        Query query = new TermQuery(term);
    100100
    101 
    102         System.out.println("Searching for: " + query.toString("content"));
    103 
    104101        Hits hits = searcher.search(query);
    105         System.out.println(hits.length() + " total matching documents");
    106102
    107103        for (int i=0; i<hits.length(); i++) {
Note: See TracChangeset for help on using the changeset viewer.