1 | @echo off
|
---|
2 |
|
---|
3 | if exist gs3-setup.bat goto begin
|
---|
4 | echo You must run this script from within the Greenstone 3 home directory
|
---|
5 | goto exit
|
---|
6 |
|
---|
7 | :begin
|
---|
8 | call gs3-setup.bat
|
---|
9 |
|
---|
10 | :: Required arguments: sitename and siteuri
|
---|
11 | :checkSitename
|
---|
12 | if not "%1" == "" goto checkSiteURI
|
---|
13 | echo Usage: gs3-soap-deploy-site.bat sitename siteURI
|
---|
14 | goto exit
|
---|
15 |
|
---|
16 | :checkSiteURI
|
---|
17 | if not "%2" == "" goto start
|
---|
18 | echo Usage: gs3-soap-deploy-site.bat sitename siteURI
|
---|
19 | goto exit
|
---|
20 |
|
---|
21 | :start
|
---|
22 | :: Make a new SOAPServer class from SOAPServer.java.in
|
---|
23 | cd %GSDL3HOME%\src\java\org\greenstone\gsdl3
|
---|
24 | "%GSDL3HOME%\winutil\sed.exe" 's,SOAPServer,SOAPServer%1,' SOAPServer.java.in > SOAPServer.java.in.tmp
|
---|
25 | "%GSDL3HOME%\winutil\sed.exe" 's,@sitename@,%1,' SOAPServer.java.in.tmp > SOAPServer%1.java
|
---|
26 | del SOAPServer.java.in.tmp
|
---|
27 |
|
---|
28 | :: Compile and install the new class
|
---|
29 | call winMake.bat
|
---|
30 | call winMake.bat install
|
---|
31 |
|
---|
32 | :: Edit the resource file
|
---|
33 | cd %GSDL3HOME%\resources\soap
|
---|
34 | "%GSDL3HOME%\winutil\sed.exe" 's,@servername@,SOAPServer%1,' site.xml.in > site.xml.in.tmp
|
---|
35 | "%GSDL3HOME%\winutil\sed.exe" 's,@siteuri@,%2,' site.xml.in.tmp > %1.xml
|
---|
36 | del site.xml.in.tmp
|
---|
37 |
|
---|
38 | :: To deploy the SOAP server Tomcat needs to be running
|
---|
39 | cd %GSDL3HOME%
|
---|
40 | call "%GSDL3HOME%\comms\jakarta\tomcat\bin\shutdown.bat"
|
---|
41 | call "%GSDL3HOME%\comms\jakarta\tomcat\bin\startup.bat"
|
---|
42 |
|
---|
43 | echo Deploying the SOAP server for site %1...
|
---|
44 | java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy resources\soap\%1.xml
|
---|
45 |
|
---|
46 | echo Tomcat has been (re)started to deploy the site.
|
---|
47 | echo If you don't want the server running, run
|
---|
48 | echo gs3-launch.bat -shutdown
|
---|
49 | echo.
|
---|
50 | echo A SOAP server for site %1 has been deployed.
|
---|
51 | echo The identifier for the SOAP service is %2
|
---|
52 | echo The address of the SOAP server is
|
---|
53 | echo http://localhost:8080/soap/servlet/rpcrouter
|
---|
54 |
|
---|
55 | :exit
|
---|