Changeset 28988 for main/trunk
- Timestamp:
- 2014-04-17T13:18:27+12:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
r28966 r28988 36 36 import org.greenstone.gsdl3.util.GSPath; 37 37 import org.greenstone.gsdl3.util.GSXML; 38 import org.greenstone.gsdl3.util.OAIXML;39 38 import org.greenstone.gsdl3.util.UserContext; 40 39 import org.greenstone.gsdl3.util.XMLConverter; … … 88 87 /** list of collections that are loaded but are private */ 89 88 protected Element private_collection_list = null; 90 91 /** list of collections that are public and OAI-supportive */92 protected Element oai_collection_list = null;93 94 89 /** list of service clusters that can be reached */ 95 90 protected Element cluster_list = null; … … 101 96 protected Element metadata_list = null; 102 97 103 /** a converter class to parse XML and create Docs */104 protected XMLConverter converter = null;105 106 98 //*************************************************************** 107 99 // public methods … … 111 103 public MessageRouter() 112 104 { 113 this.converter = new XMLConverter();114 105 } 115 106 … … 218 209 { 219 210 220 Document doc = this.converter.getDOM(xml_in);211 Document doc = XMLConverter.getDOM(xml_in); 221 212 222 213 Node result = process(doc); 223 return this.converter.getString(result);214 return XMLConverter.getString(result); 224 215 } 225 216 … … 333 324 else 334 325 { 335 logger.error("MessageRouter Error: request has illegal module name in:\n" + this.converter.getString(req));326 logger.error("MessageRouter Error: request has illegal module name in:\n" + XMLConverter.getString(req)); 336 327 } 337 328 } … … 341 332 342 333 logger.debug("MR returned response"); 343 logger.debug( this.converter.getString(mainResult));334 logger.debug(XMLConverter.getString(mainResult)); 344 335 345 336 return mainResult; … … 391 382 protected void cleanUpModuleMapSubset(Element list, String remote_site) 392 383 { 393 logger.error( this.converter.getString(list));384 logger.error(XMLConverter.getString(list)); 394 385 NodeList elements = list.getChildNodes(); // we are assuming no extraneous nodes 395 386 for (int i = elements.getLength() - 1; i >= 0; i--) … … 416 407 } 417 408 } 418 logger.error( this.converter.getString(list));409 logger.error(XMLConverter.getString(list)); 419 410 } 420 411 … … 454 445 } 455 446 456 Document config_doc = this.converter.getDOM(configFile);447 Document config_doc = XMLConverter.getDOM(configFile); 457 448 if (config_doc == null) 458 449 { … … 477 468 this.collection_list = doc.createElement(GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER); 478 469 this.private_collection_list = doc.createElement(GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER); 479 this.oai_collection_list = doc.createElement(GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER);480 470 configureCollections(); 481 471 … … 687 677 if (init_file.exists()) 688 678 { 689 Document init_doc = this.converter.getDOM(init_file);679 Document init_doc = XMLConverter.getDOM(init_file); 690 680 if (init_doc != null) 691 681 { … … 730 720 // add short description_ to collection_list_ 731 721 this.collection_list.appendChild(e); 732 733 if (c.hasOAI())734 {735 Element ane = doc.createElement(GSXML.COLLECTION_ELEM);736 ane.setAttribute(GSXML.NAME_ATT, col_name);737 ane.setAttribute(OAIXML.LASTMODIFIED, "" + c.getLastmodified());738 // lastmodified not of use anymore for OAI, perhaps useful as general information739 ane.setAttribute(OAIXML.EARLIEST_DATESTAMP, "" + c.getEarliestDatestamp()); // for OAI740 741 this.oai_collection_list.appendChild(ane);742 }743 744 722 } 745 723 else … … 804 782 return false; 805 783 } 806 Document config_doc = this.converter.getDOM(configFile);784 Document config_doc = XMLConverter.getDOM(configFile); 807 785 if (config_doc == null) 808 786 { … … 1003 981 this.collection_list.removeChild(this_col); 1004 982 } 1005 if (((Collection) m).hasOAI())1006 {1007 this_col = GSXML.getNamedElement(this.oai_collection_list, GSXML.COLLECTION_ELEM, GSXML.NAME_ATT, name);1008 if (this_col != null)1009 {1010 this.oai_collection_list.removeChild(this_col);1011 }1012 }1013 983 } 1014 984 else … … 1050 1020 cleanUpModuleMapSubset(this.service_list, name); 1051 1021 1052 // can remote collections be in the oai_coll list, orprivate coll list ??1022 // can remote collections be in the private coll list ?? 1053 1023 } 1054 1024 } … … 1139 1109 } 1140 1110 1141 if (type.equals(OAIXML.OAI_SET_LIST))1142 {1143 logger.info("oaiSetList request received");1144 //this is the oai receptionist asking for a list of oai-support collections1145 response.setAttribute(GSXML.TYPE_ATT, OAIXML.OAI_SET_LIST);1146 response.appendChild(doc.importNode(this.oai_collection_list, true));1147 return response;1148 }1149 1150 1111 if (type.equals(GSXML.REQUEST_TYPE_SYSTEM)) 1151 1112 { … … 1226 1187 continue; 1227 1188 } 1228 Document site_config_doc = this.converter.getDOM(configFile);1189 Document site_config_doc = XMLConverter.getDOM(configFile); 1229 1190 if (site_config_doc == null) 1230 1191 { … … 1324 1285 String eol = System.getProperty("line.separator"); 1325 1286 1326 String mess = "Can't process request:" + eol + " " + this.converter.getString(req);1287 String mess = "Can't process request:" + eol + " " + XMLConverter.getString(req); 1327 1288 logger.error(mess); 1328 1289 return null; … … 1342 1303 if (commands == null) 1343 1304 { 1344 logger.error("no commands, " + converter.getPrettyString(request));1305 logger.error("no commands, " + XMLConverter.getPrettyString(request)); 1345 1306 return response; 1346 1307 }
Note:
See TracChangeset
for help on using the changeset viewer.