source: trunk/gsdl3/gs3-soap-deploy-site.sh.in@ 7263

Last change on this file since 7263 was 6927, checked in by kjdon, 20 years ago

this script now expects two args, the site name and the uri, eg localsite, org.greenstone.localsite

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1#!/bin/sh
2
3if [ ! -f gs3-setup.sh ]; then
4 echo "You must run this script from within the Greenstone 3 home directory"
5 exit 1
6fi
7#check that GSDL3HOME is set
8if test -z "$GSDL3HOME" ; then
9 source gs3-setup.sh
10fi
11
12sitename=$1
13siteuri=$2
14if [[ "$sitename" == "" || "$siteuri" == "" ]]; then
15 echo "Usage: gs3-soap-deploy-site.sh <sitename> <site URI>"
16 exit 1
17fi
18
19soapadded=`grep soap comms/jakarta/tomcat/conf/server.xml`
20
21if [ "$soapadded" == "" ]; then
22 # if soap is not deployed already in tomcat, then deploy it
23 cat comms/jakarta/tomcat/conf/server.xml | sed "s,<\!-- Tomcat Root Context -->,<\!-- SOAP Service --><Context path=\"/soap\" docBase=\"$GSDL3HOME/comms/soap/soap/webapps/soap\" debug=\"1\" reloadable=\"true\"/><\!-- Tomcat Root Context -->," > server.xml
24 mv comms/jakarta/tomcat/conf/server.xml comms/jakarta/tomcat/conf/server.bak.xml
25 mv server.xml comms/jakarta/tomcat/conf/server.xml
26fi
27
28# make a new SOAPServer class from SOAPServer.java.in
29var=1
30 while [ -f src/java/org/greenstone/gsdl3/SOAPServer$var.java ]
31do
32 var=$((var+1))
33done
34
35# edit the SOAPServerX class
36cd src/java/org/greenstone/gsdl3
37cat SOAPServer.java.in | sed "s&@gsdl3home@&$GSDL3HOME&" | sed "s&SOAPServer&SOAPServer$var&" | sed "s&@sitename@&$sitename&" > SOAPServer$var.java
38
39make
40make install
41cd $GSDL3HOME
42
43# edit the resource file
44cd resources/soap
45cat site.xml.in | sed "s&@siteuri@&$siteuri&" | sed "s&@servername@&SOAPServer$var&" > $sitename.xml
46cd $GSDL3HOME
47
48# now deploy the server - needs to have tomcat running
49comms/jakarta/tomcat/bin/shutdown.sh
50comms/jakarta/tomcat/bin/startup.sh
51
52echo "waiting 5s for tomcat to startup"
53sleep 5s
54
55echo "deploying the soap server for site $sitename"
56java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy resources/soap/$sitename.xml
57
58echo "Tomcat has been (re)started to deploy the site. "
59echo "If you don't want the server running, please "
60echo "run ./gs3-launch.sh -shutdown "
61echo ""
62echo "A SOAP server for site $sitename has been deployed."
63echo "The identifier for the SOAP service is $siteuri".
64echo "The address of the SOAP server is "
65echo " http://localhost:8080/soap/servlet/rpcrouter"
Note: See TracBrowser for help on using the repository browser.