- Timestamp:
- 2018-09-13T13:57:44+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
r32362 r32447 223 223 this.recept.setConfigParams(config_params); 224 224 225 // the params arg thingy 226 227 String params_name = (String) config.getInitParameter("params_class"); 228 if (params_name == null) 229 { 230 this.params = new GSParams(); 231 } 232 else 233 { 234 try 235 { 236 this.params = (GSParams) Class.forName("org.greenstone.gsdl3.util." + params_name).newInstance(); 237 } 238 catch (Exception e) 239 { 240 System.err.println("LibraryServlet configure exception when trying to use a new params thing " + params_name + ": " + e.getMessage()); 241 e.printStackTrace(); 242 this.params = new GSParams(); 243 } 244 } 245 225 246 // the receptionist uses a MessageRouter or Communicator to send its requests to. We either create a MessageRouter here for the designated site (if site_name set), or we create a Communicator for a remote site. The is given to the Receptionist, and the servlet never talks to it again directly. 226 247 if (site_name != null) … … 248 269 message_router.setSiteName(site_name); 249 270 message_router.setLibraryName(library_name); 271 message_router.setParams(this.params); 250 272 message_router.configure(); 251 273 this.recept.setMessageRouter(message_router); … … 253 275 else 254 276 { 277 // TODO: what do we do about params here? 255 278 // talking to a remote site, create a communicator 256 279 Communicator communicator = null; … … 280 303 } 281 304 282 // the params arg thingy 283 284 String params_name = (String) config.getInitParameter("params_class"); 285 if (params_name == null) 286 { 287 this.params = new GSParams(); 288 } 289 else 290 { 291 try 292 { 293 this.params = (GSParams) Class.forName("org.greenstone.gsdl3.util." + params_name).newInstance(); 294 } 295 catch (Exception e) 296 { 297 System.err.println("LibraryServlet configure exception when trying to use a new params thing " + params_name + ": " + e.getMessage()); 298 e.printStackTrace(); 299 this.params = new GSParams(); 300 } 301 } 302 // pass it to the receptionist 305 // pass params to the receptionist 303 306 this.recept.setParams(this.params); 304 307 this.recept.configure(); … … 842 845 { 843 846 //Check if we need to login or logout 844 String username = getFirstParam( "username", queryMap);845 String password = getFirstParam( "password", queryMap);846 String logout = getFirstParam( "logout", queryMap);847 String username = getFirstParam(GSParams.USERNAME, queryMap); 848 String password = getFirstParam(GSParams.PASSWORD, queryMap); 849 String logout = getFirstParam(GSParams.LOGOUT, queryMap); 847 850 848 851 if (logout != null)
Note:
See TracChangeset
for help on using the changeset viewer.