Changeset 33971


Ignore:
Timestamp:
2020-02-25T13:47:12+13:00 (4 years ago)
Author:
kjdon
Message:

get servlet_url param and pass to getOAIConfigXML, as now the files are named with the servlet name - so you can have more than one oai servlet running

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java

    r32858 r33971  
    108108        super.init(config);
    109109        this.default_lang = config.getInitParameter(GSConstants.DEFAULT_LANG);
     110        String servlet_url_name=config.getInitParameter("servlet_url");
    110111
    111112        initVerbs();
     
    137138        }
    138139
     140
     141        // Read in OAIConfig-xxx.xml (residing web/WEB-INF/classes/) and
     142        //use it to configure the receptionist. And pass it to MR
     143        Element oai_config = OAIXML.getOAIConfigXML(servlet_url_name);
     144        if (oai_config == null)
     145        {
     146            logger.error("Fail to parse oai config file OAIConfig-"+servlet_url_name+".xml");
     147            throw new UnavailableException("OAIServer: Couldn't parse OAIConfig-"+servlet_url_name+".xml");
     148        }
     149       
    139150        // the receptionist -the servlet will talk to this
    140151        this.recept = new OAIReceptionist();
     
    165176            message_router.setSiteName(site_name);
    166177            // lots of work is done in this step; see OAIMessageRouter.java
     178            message_router.setOAIConfig(oai_config);
    167179            if (!message_router.configure()) {
    168180              throw new UnavailableException("OAIServer: Couldn't configure OAIMessageRouter");
     
    200212            this.recept.setSiteName(remote_site_name);
    201213            this.recept.setMessageRouter(communicator);
    202         }
    203 
    204         // Read in OAIConfig.xml (residing web/WEB-INF/classes/) and
    205         //use it to configure the receptionist.
    206         Element oai_config = OAIXML.getOAIConfigXML();
    207         if (oai_config == null)
    208         {
    209             logger.error("Fail to parse oai config file OAIConfig.xml.");
    210             throw new UnavailableException("OAIServer: Couldn't parse OAIConfig.xml");
    211214        }
    212215        // pass it to the receptionist
Note: See TracChangeset for help on using the changeset viewer.