Changeset 4690


Ignore:
Timestamp:
2003-06-18T11:31:19+12:00 (21 years ago)
Author:
kjdon
Message:

no longer use ConfigVars, now we use a HashMap - so now there is no restriction on what config variables there are. also cgi request type is now page request type

File:
1 edited

Legend:

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

    r4259 r4690  
    1111import javax.servlet.http.*;
    1212import java.util.Enumeration;
     13import java.util.HashMap;
    1314import java.io.File;
    1415
     
    4647    super.init(config);
    4748
    48     ConfigVars config_vars = new ConfigVars();
    49     String library_name = config.getInitParameter("libraryname");
    50     String gsdl3_home = config.getInitParameter("gsdl3home");
    51     String site_name = config.getInitParameter("sitename");
    52     String interface_name = config.getInitParameter("interfacename");
    53     this.default_lang = config.getInitParameter("defaultlang");
     49    String library_name = config.getInitParameter(GSConstants.LIBRARY_NAME);
     50    String gsdl3_home = config.getInitParameter(GSConstants.GSDL3_HOME);
     51    String site_name = config.getInitParameter(GSConstants.SITE_NAME);
     52    String interface_name = config.getInitParameter(GSConstants.INTERFACE_NAME);
     53    this.default_lang = config.getInitParameter(GSConstants.DEFAULT_LANG);
    5454    if (library_name == null || gsdl3_home == null || site_name ==null ||  interface_name ==null) {
    5555        // must have this
     
    6363        this.default_lang = DEFAULT_LANG;
    6464    }
    65 
    66     config_vars.library_name_ = library_name;
    67     config_vars.gsdl3_home_ = gsdl3_home;
    68     config_vars.site_name_ = site_name;
    69     config_vars.interface_name_ =interface_name;
    70     config_vars.default_language_ = this.default_lang;
    71     config_vars.createXML();
     65   
     66    HashMap config_params = new HashMap();
     67   
     68    config_params.put(GSConstants.LIBRARY_NAME, library_name);
     69    config_params.put(GSConstants.GSDL3_HOME, gsdl3_home);
     70    config_params.put(GSConstants.SITE_NAME, site_name);
     71    config_params.put(GSConstants.INTERFACE_NAME, interface_name);
    7272   
    7373    this.converter = new XMLConverter();
     
    9191    }
    9292   
    93     message_router.setSiteHome(GSFile.siteHome(config_vars.gsdl3_home_,
    94                            config_vars.site_name_));
     93    message_router.setSiteHome(GSFile.siteHome(gsdl3_home,
     94                           site_name));
    9595    message_router.configure();
    9696   
     
    108108        }
    109109    }
    110     this.recept.setConfigVars(config_vars);
     110    this.recept.setConfigParams(config_params);
    111111    this.recept.setMessageRouter(message_router);
    112112    this.recept.configure();
     
    167167    // the request to the receptionist 
    168168    Element xml_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
    169     Element xml_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_CGI, "", lang);
     169    Element xml_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PAGE, "", lang);
    170170    xml_request.setAttribute(GSXML.OUTPUT_ATT, output);
    171171    xml_message.appendChild(xml_request);
     
    248248     */
    249249    protected void encodeURLs(Element data, HttpServletResponse response) {
    250 
     250   
     251    if (data == null) {
     252        return;
     253    }
    251254    // get all the <a> elements
    252255    NodeList hrefs = data.getElementsByTagName("a");
Note: See TracChangeset for help on using the changeset viewer.