@echo off if exist gs3-setup.bat goto begin echo You must run this script from within the Greenstone 3 home directory goto exit :begin call gs3-setup.bat :: Required arguments: sitename and siteuri :checkSitename if not "%1" == "" goto checkSiteURI echo Usage: gs3-soap-deploy-site.bat sitename siteURI goto exit :checkSiteURI if not "%2" == "" goto start echo Usage: gs3-soap-deploy-site.bat sitename siteURI goto exit :start :: Make a new SOAPServer class from SOAPServer.java.in cd %GSDL3HOME%\src\java\org\greenstone\gsdl3 "%GSDL3HOME%\winutil\sed.exe" 's,SOAPServer,SOAPServer%1,' SOAPServer.java.in > SOAPServer.java.in.tmp "%GSDL3HOME%\winutil\sed.exe" 's,@sitename@,%1,' SOAPServer.java.in.tmp > SOAPServer%1.java del SOAPServer.java.in.tmp :: Compile and install the new class call winMake.bat call winMake.bat install :: Edit the resource file cd %GSDL3HOME%\resources\soap "%GSDL3HOME%\winutil\sed.exe" 's,@servername@,SOAPServer%1,' site.xml.in > site.xml.in.tmp "%GSDL3HOME%\winutil\sed.exe" 's,@siteuri@,%2,' site.xml.in.tmp > %1.xml del site.xml.in.tmp :: To deploy the SOAP server Tomcat needs to be running cd %GSDL3HOME% call "%GSDL3HOME%\comms\jakarta\tomcat\bin\shutdown.bat" call "%GSDL3HOME%\comms\jakarta\tomcat\bin\startup.bat" echo Deploying the SOAP server for site %1... java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy resources\soap\%1.xml echo Tomcat has been (re)started to deploy the site. echo If you don't want the server running, run echo gs3-launch.bat -shutdown echo. echo A SOAP server for site %1 has been deployed. echo The identifier for the SOAP service is %2 echo The address of the SOAP server is echo http://localhost:8080/soap/servlet/rpcrouter :exit