Changeset 4692
- Timestamp:
- 2003-06-18T11:39:26+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/core/Receptionist.java
r4258 r4692 23 23 24 24 /** the set up variables */ 25 /// this is web specific - perhaps use an interface so diff types (web/java app) can use diff classes 26 protected ConfigVars config=null; 27 25 protected HashMap config_params = null; 28 26 /** container Document to create XML Nodes */ 29 27 protected Document doc=null; … … 44 42 } 45 43 46 /** the set up vars must be set before configure called*/ 47 public void setConfigVars(ConfigVars config) { 48 this.config = config; 44 public void setConfigParams(HashMap params) { 45 this.config_params = params; 49 46 } 50 51 47 /** sets the message router - it should already be created and 52 48 * configured before being passed to the receptionist*/ … … 58 54 public boolean configure() { 59 55 60 if (this.config ==null) {56 if (this.config_params==null) { 61 57 System.err.println("Receptionist Error: config variables must be set before calling configure"); 62 58 return false; … … 68 64 69 65 // find the config file containing a list of actions 70 File interface_config_file = new File(GSFile.interfaceConfigFile(GSFile.interfaceHome( this.config.gsdl3_home_, this.config.interface_name_)));66 File interface_config_file = new File(GSFile.interfaceConfigFile(GSFile.interfaceHome((String)this.config_params.get(GSConstants.GSDL3_HOME), (String)this.config_params.get(GSConstants.INTERFACE_NAME)))); 71 67 if (!interface_config_file.exists()) { 72 68 System.err.println("Receptionist: interface config file: "+interface_config_file.getPath()+" not found!"); … … 90 86 continue; 91 87 } 92 ac.setConfig Vars(this.config);88 ac.setConfigParams(this.config_params); 93 89 ac.setMessageRouter(this.mr); 94 90 ac.configure(); … … 119 115 // check the request type 120 116 String type = request.getAttribute(GSXML.TYPE_ATT); // returns "" if no att of this name 121 if (!type.equals(GSXML.REQUEST_TYPE_ CGI)) { // should use a diff name??122 // now Receptionist forwards non- cgirequests straight to the MR, and returns the responses123 System.err.println("Receptionist: request type is not '"+GSXML.REQUEST_TYPE_ CGI+"', but it is '"+type+"', so forwarding the message to the MR!");117 if (!type.equals(GSXML.REQUEST_TYPE_PAGE)) { 118 // now Receptionist forwards non-page requests straight to the MR, and returns the responses 119 System.err.println("Receptionist: request type is not '"+GSXML.REQUEST_TYPE_PAGE+"', but it is '"+type+"', so forwarding the message to the MR!"); 124 120 // process the whole message - mr needs <message> tags, and 125 121 // in this case, there may be more than one request in the message … … 141 137 action_name = action.substring(0,1).toUpperCase()+action.substring(1)+"Action"; 142 138 Action ac = (Action)Class.forName("org.greenstone.gsdl3.action."+action_name).newInstance(); 143 ac.setConfig Vars(this.config);139 ac.setConfigParams(this.config_params); 144 140 ac.setMessageRouter(this.mr); 145 141 ac.configure(); … … 157 153 // set up the page 158 154 Element page = this.doc.createElement(GSXML.PAGE_ELEM); 159 // do we need this??160 155 page.setAttribute(GSXML.LANG_ATT, request.getAttribute(GSXML.LANG_ATT)); 161 156
Note:
See TracChangeset
for help on using the changeset viewer.