#!/bin/sh if [ ! -f gs3-setup.sh ]; then echo "You must run this script from within the Greenstone 3 home directory" exit 1 fi #check that GSDL3HOME is set if test -z "$GSDL3HOME" ; then source gs3-setup.sh fi sitename=$1 siteuri=$2 if [[ "$sitename" == "" || "$siteuri" == "" ]]; then echo "Usage: gs3-soap-deploy-site.sh " exit 1 fi soapadded=`grep soap comms/jakarta/tomcat/conf/server.xml` if [ "$soapadded" == "" ]; then # if soap is not deployed already in tomcat, then deploy it cat comms/jakarta/tomcat/conf/server.xml | sed "s,<\!-- Tomcat Root Context -->,<\!-- SOAP Service --><\!-- Tomcat Root Context -->," > server.xml mv comms/jakarta/tomcat/conf/server.xml comms/jakarta/tomcat/conf/server.bak.xml mv server.xml comms/jakarta/tomcat/conf/server.xml fi # make a new SOAPServer class from SOAPServer.java.in var=1 while [ -f src/java/org/greenstone/gsdl3/SOAPServer$var.java ] do var=$((var+1)) done # edit the SOAPServerX class cd src/java/org/greenstone/gsdl3 cat SOAPServer.java.in | sed "s&@gsdl3home@&$GSDL3HOME&" | sed "s&SOAPServer&SOAPServer$var&" | sed "s&@sitename@&$sitename&" > SOAPServer$var.java make make install cd $GSDL3HOME # edit the resource file cd resources/soap cat site.xml.in | sed "s&@siteuri@&$siteuri&" | sed "s&@servername@&SOAPServer$var&" > $sitename.xml cd $GSDL3HOME # now deploy the server - needs to have tomcat running comms/jakarta/tomcat/bin/shutdown.sh comms/jakarta/tomcat/bin/startup.sh echo "waiting 5s for tomcat to startup" sleep 5s echo "deploying the soap server for site $sitename" java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy resources/soap/$sitename.xml echo "Tomcat has been (re)started to deploy the site. " echo "If you don't want the server running, please " echo "run ./gs3-launch.sh -shutdown " echo "" echo "A SOAP server for site $sitename has been deployed." echo "The identifier for the SOAP service is $siteuri". echo "The address of the SOAP server is " echo " http://localhost:8080/soap/servlet/rpcrouter"