Changeset 5401
- Timestamp:
- 2003-09-01T15:44:22+12:00 (21 years ago)
- 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 72 72 for (int i=0; i<nodes.getLength(); i++) { 73 73 String name = ((Element)nodes.item(i)).getAttribute("name"); 74 System.out.println("found a metadata name="+name);75 74 String select = ((Element)nodes.item(i)).getAttribute("select"); 76 75 if (select.equals("parent")) { … … 98 97 99 98 } 100 System.out.println("metadata list = "+this.converter.getString(param_list));101 99 return param_list; 102 100 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/BrowseAction.java
r5155 r5401 276 276 277 277 278 System.out.println("(BrowseAction) Page:\n" + this.converter.getPrettyString(page_response));278 ///ystem.out.println("(BrowseAction) Page:\n" + this.converter.getPrettyString(page_response)); 279 279 return page_response; 280 280 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/DocumentAction.java
r5155 r5401 301 301 // now we can modifiy the response doc if needed 302 302 String enrich_service = (String)params.get(GSParams.SERVICE); 303 System.out.println("enrich service is "+enrich_service);304 303 // send a message to the service 305 304 Element enrich_message = this.doc.createElement(GSXML.MESSAGE_ELEM); -
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java
r5155 r5401 18 18 19 19 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";22 20 23 21 /** process the request */ … … 51 49 } 52 50 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 not59 // 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 65 51 String lang = request.getAttribute(GSXML.LANG_ATT); 66 52 String to = GSPath.appendLink(collection, service_name); … … 122 108 Element new_format = GSXML.duplicateWithNewName(this.doc, this_format, GSXML.FORMAT_ELEM, false); 123 109 extractMetadataNames(new_format, doc_meta_names, class_meta_names); 124 // set t ehformat type110 // set the format type 125 111 new_format.setAttribute(GSXML.TYPE_ATT, "browse"); 126 112 … … 159 145 param.setAttribute(GSXML.NAME_ATT, "structure"); 160 146 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 // }167 147 168 148 // put the classifier node into a classifier node list … … 174 154 175 155 if (horizontal_at_top && !classifier_node.equals(top_id)) { 176 // also put the top id in, to get t ehpersistant horizontal info156 // also put the top id in, to get the persistant horizontal info 177 157 classifier = this.doc.createElement(GSXML.CLASS_NODE_ELEM); 178 158 classifier.setAttribute(GSXML.NODE_ID_ATT, top_id); 179 159 classifier_list.appendChild(classifier); 180 System.out.println("GS2Browse:adding in the top node");181 160 } 182 161 // process the request 183 162 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 element187 //String [] links = {GSXML.MESSAGE_ELEM, GSXML.RESPONSE_ELEM, GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER};188 //String path = GSPath.createPath(links);189 163 String path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER); 190 164 Element class_node_list = (Element)GSXML.getNodeByPath(classify_response, path); 191 165 192 //path = GSPath.appendLink(path, GSXML.CLASS_NODE_ELEM);193 166 path = GSPath.appendLink(GSXML.CLASS_NODE_ELEM, GSXML.NODE_STRUCTURE_ELEM); 194 167 // assume that we always get back the top level CL1 node - this becomes the page_classifier node … … 204 177 if (horizontal_at_top && !classifier_node.equals(top_id)) { 205 178 // get the info for the top node 206 //NodeList class_nodes = class_node_list.getElementsByTagName(GSXML.CLASSIFIER_ELEM);207 208 179 Element top_node = GSXML.getNamedElement(class_node_list, GSXML.CLASS_NODE_ELEM, GSXML.NODE_ID_ATT, top_id); 209 180 if (top_node !=null) { … … 332 303 333 304 334 System.out.println("(GS2BrowseAction) Page:\n" + this.converter.getPrettyString(page_response));305 ///ystem.out.println("(GS2BrowseAction) Page:\n" + this.converter.getPrettyString(page_response)); 335 306 return page_response; 336 307 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/QueryAction.java
r5191 r5401 177 177 } 178 178 179 // System.out.println("Query page:\n" + converter_.getPrettyString(page_response));179 ///ystem.out.println("Query page:\n" + converter_.getPrettyString(page_response)); 180 180 return page_response; 181 181 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Retrieve.java
r5380 r5401 109 109 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name); 110 110 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!"); 112 112 return false; 113 113 } … … 173 173 Element display_format = (Element)GSXML.getNodeByPath(extra_info, path); 174 174 if (display_format != null) { 175 System.out.println("display format not null!");176 175 this.format_info_map.put(DOCUMENT_METADATA_RETRIEVE_SERVICE, this.doc.importNode(display_format, true)); 177 176 // shoudl we make a copy? … … 414 413 if (current_node ==null) { 415 414 // 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."); 417 416 return null; 418 417 } … … 480 479 Element query_doc_list = (Element) GSXML.getChildByTagName(request, node_name+GSXML.LIST_MODIFIER); 481 480 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"); 483 482 return result; 484 483 } … … 487 486 Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 488 487 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."); 490 489 return result; // Return the empty result 491 490 } … … 526 525 want_descendants = true; 527 526 else 528 System.err.println(" Warning: Unknown value \"" + p_value + "\".");527 System.err.println("GS2Retrieve Warning: Unknown value \"" + p_value + "\"."); 529 528 } else if (p_name.equals(INFO_PARAM)) { 530 529 want_info = true; … … 550 549 String doc_id = doc_ids[i]; 551 550 552 System.out.println("doc_id = "+doc_id);553 551 if (OID.needsTranslating(doc_id)) { 554 552 doc_id = this.gdbm_src.translateOID(doc_id); 555 System.out.println("translated doc_id = "+doc_id);556 553 } 557 554 … … 714 711 continue; 715 712 } 716 System.out.println("found the info");717 713 if (all_metadata) { 718 System.out.println("trying to get all the metadata");719 714 // return everything out of the database 720 715 Set keys = info.getKeys(); … … 722 717 while(it.hasNext()) { 723 718 String key = (String)it.next(); 724 System.out.println("getting metadata "+key);725 719 String value = info.getInfo(key); 726 720 GSXML.addMetadata(this.doc, node_meta_list, key, value); … … 734 728 } 735 729 } 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);740 730 } 741 731 … … 837 827 for (int i=0;i<children.length;i++) { 838 828 String child_id = children[i]; 839 System.out.println("child="+child_id+" doc="+doc_id);840 829 if (child_id.equals(doc_id)) { 841 830 value = String.valueOf(i+1); // make it from 1 to length -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/InfomineProxy.java
r5227 r5401 186 186 187 187 } 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"); 189 189 e.printStackTrace(); 190 190 } … … 193 193 results_num = results_num.substring(11); 194 194 } 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); 196 196 return result; 197 197 } … … 199 199 doc_ids = doc_ids.substring(5).trim(); 200 200 } 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); 202 202 return result; 203 203 } … … 302 302 } 303 303 } catch (Exception e) { 304 System. out.println("InfomineProxy Error:exception happened");304 System.err.println("InfomineProxy Error:exception happened"); 305 305 e.printStackTrace(); 306 306 } … … 354 354 355 355 } catch (Exception e) { 356 System. out.println("InfomineProxy Error:exception happened");356 System.err.println("InfomineProxy Error:exception happened"); 357 357 e.printStackTrace(); 358 358 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java
r5257 r5401 75 75 Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 76 76 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."); 78 78 return result; // Return the empty result 79 79 } … … 85 85 String query_string = (String) params.get(QUERY_PARAM); 86 86 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."); 88 88 return result; // Return the empty result 89 89 } … … 99 99 Query query = new TermQuery(term); 100 100 101 102 System.out.println("Searching for: " + query.toString("content"));103 104 101 Hits hits = searcher.search(query); 105 System.out.println(hits.length() + " total matching documents");106 102 107 103 for (int i=0; i<hits.length(); i++) {
Note:
See TracChangeset
for help on using the changeset viewer.