gianugo     2003/02/24 05:37:44

  Added:       .        xindice.sh xindice.bat
  Log:
  Added Jetty to the repository. Big thanks to the Cocoon team, from which the 
set
  up was copied in a shameless way. :-)
  Beware: the .bat script is little more than a wild guess (no MS machine 
here...)
  
  Revision  Changes    Path
  1.1                  xml-xindice/xindice.sh
  
  Index: xindice.sh
  ===================================================================
  #!/bin/sh
  # 
-----------------------------------------------------------------------------
  # Xindice Unix Shell Script
  #
  # $Id: xindice.sh,v 1.1 2003/02/24 13:37:44 gianugo Exp $
  # 
-----------------------------------------------------------------------------
  
  # Configuration variables
  #
  # XINDICE_HOME
  #   Home of Xindice program and data.
  #
  # JAVA_HOME
  #   Home of Java installation.
  #
  # JAVA_OPTIONS
  #   Extra options to pass to the JVM
  #
  # JETTY_PORT
  #   Override the default port for Jetty
  
  usage()
  {
      echo "Usage: $0 (action)"
      echo "actions:"
      echo "  start           Start Xindice server"
      echo "  stop            Stop  Xindice server"
      echo "  debug           Start Xindice server turning on remote debugging"
      exit 1
  }
  
  [ $# -gt 0 ] || usage
  
  ACTION=$1
  shift
  ARGS="$*"
  
  # ----- Verify and Set Required Environment Variables 
-------------------------
  
  if [ "$JAVA_HOME" = "" ] ; then
    echo You must set JAVA_HOME to point at your Java Development Kit 
installation
    exit 1
  fi
  
  if [ "$XINDICE_HOME" = "" ] ; then
    echo
    echo "WARNING: The environment variable XINDICE_HOME is not set."
    echo "         defaulting to `pwd`."
    XINDICE_HOME=`pwd`
  fi
  
  if [ "$JETTY_PORT" = "" ] ; then
    JETTY_PORT=8888
  fi
  
  if [ "$JETTY_ADMIN_PORT" = "" ] ; then
    JETTY_ADMIN_PORT=8889
  fi
  
  if [ "$JETTY_WEBAPP" = "" ] ; then
    JETTY_WEBAPP=$XINDICE_HOME/dist/xindice-1.1b.war
  fi
  
  if [ "$JAVA_DEBUG_PORT" = "" ] ; then
    JAVA_DEBUG_PORT=8000
  fi
  
  if [ "$XINDICE_PID" = "" ] ; then
    XINDICE_PID=$XINDICE_HOME/logs/xindice.pid
  fi
  
  # ----- Set Classpath 
----------------------------------------------------------
  
  CP=./tools/lib/forehead-1.0-beta-4.jar
  
  # ----- Do the action 
----------------------------------------------------------
  
  case "$ACTION" in
    start)
          if [ -f $XINDICE_PID ]
          then
            echo
            echo "Seems like an instance of Xindice is already running with PID 
`cat $XINDICE_PID`."
            echo
            echo "If that's not the case, please delete $XINDICE_PID and try 
again"
            echo
            exit 1
          fi
  
          echo  
          echo "Starting Xindice - Log files are under $XINDICE_HOME/logs"
          echo
  
          nohup sh -c "$JAVA_HOME/bin/java $JAVA_OPT -classpath $CP 
-Djava.endorsed.dirs=lib/endorsed -Dxindice.home=$XINDICE_HOME 
-Dxindice.db.home=$XINDICE_HOME -Dwebapp=$JETTY_WEBAPP 
-Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser 
-Djetty.port=$JETTY_PORT -Djetty.admin.port=$JETTY_ADMIN_PORT 
-Dforehead.conf.file=tools/jetty/conf/jetty.env com.werken.forehead.Forehead 
tools/jetty/conf/main.xml" >> $XINDICE_HOME/logs/xindice.out 2>&1 &
  
          echo $! > $XINDICE_PID
          echo "Xindice is running with PID `cat $XINDICE_PID`"
          ;;
  
    debug)
          $JAVA_HOME/bin/java $JAVA_OPT -Xdebug 
-Xrunjdwp:transport=dt_socket,address=$JAVA_DEBUG_PORT,server=y,suspend=n 
-classpath $CP -Djava.endorsed.dirs=lib/endorsed -Dxindice.home=$XINDICE_HOME 
-Dxindice.db.home=$XINDICE_HOME -Dwebapp=$JETTY_WEBAPP 
-Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser 
-Djetty.port=$JETTY_PORT -Djetty.admin.port=$JETTY_ADMIN_PORT 
-Dforehead.conf.file=tools/jetty/conf/jetty.env com.werken.forehead.Forehead 
tools/jetty/conf/main.xml tools/jetty/conf/admin.xml >> 
$XINDICE_HOME/logs/xindice.out 2>&1
          ;;
  
    stop)
         if [ -f $XINDICE_PID ]
         then
            echo 
            echo "Shutting down Xindice"
            echo
            kill `cat $XINDICE_PID`
            rm $XINDICE_PID
         else
            echo 
            echo "Unable to find a running Xindice instance"
            echo
         fi
         ;;
  
  
    *)
          usage
          ;;
  esac
  
  exit 0
  
  
  
  
  
  1.1                  xml-xindice/xindice.bat
  
  Index: xindice.bat
  ===================================================================
  @echo off
  :: 
-----------------------------------------------------------------------------
  :: Xindice Win32 Shell Script
  ::
  :: $Id: xindice.bat,v 1.1 2003/02/24 13:37:44 gianugo Exp $
  :: 
-----------------------------------------------------------------------------
  
  :: ----- Verify and Set Required Environment Variables 
-------------------------
  
  if not "%JAVA_HOME%" == "" goto gotJavaHome
  echo You must set JAVA_HOME to point at your Java Development Kit installation
  goto cleanup
  :gotJavaHome
  
  if not "%XINDICE_HOME%" == "" goto gotXindiceHome
  echo You must set XINDICE_HOME to point at your Xindice installation
  goto cleanup
  :gotXindiceHome
  
  
  :: ----- Set Up The Classpath 
--------------------------------------------------
  
  set CP=.\tools\lib\forehead-1.0-beta-4.jar
  
  :: ----- Check System Properties 
-----------------------------------------------
  
  set EXEC=start "Xindice" /D. /MAX
  
  if not "%JETTY_PORT%" == "" goto gotPort
  set JETTY_PORT=8888
  :gotPort
  
  if not "%JETTY_ADMIN_PORT%" == "" goto gotPort
  set JETTY_ADMIN_PORT=8889
  :gotPort
  
  if not "%JETTY_WEBAPP%" == "" goto gotWebapp
  set JETTY_WEBAPP=%XINDICE_HOME%dist/xindice-1.1b.war
  :gotWebapp
  
  if not "%JAVA_DEBUG_PORT%" == "" goto gotWebapp
  set JAVA_DEBUG_PORT=8000
  :gotWebapp
  
  :: ----- Check action 
----------------------------------------------------------
  
  if ""%1"" == ""start"" goto doServlet
  if ""%1"" == ""debug"" goto doDebug
  
  echo Usage: xindice (action)
  echo actions:
  echo   start           Start Xindice 
  echo   debug           Start Xindice turning remote debugging on 
  goto end
  
  :: ----- Servlet 
---------------------------------------------------------------
  
  :doServlet
  %EXEC% %JAVA_HOME%\bin\java.exe %JAVA_OPT% -classpath %CP% 
-Djava.endorsed.dirs=lib\endorsed -Dxindice.home=%XINDICE_HOME% 
-Dxindice.db.home=%XINDICE_HOME% -Dwebapp=%JETTY_WEBAPP% 
-Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser 
-Djetty.port=%JETTY_PORT% -Djetty.admin.port=%JETTY_ADMIN_PORT% 
-Dforehead.conf.file=tools\jetty\conf\jetty.env com.werken.forehead.Forehead 
tools\jetty\conf\main.xml
  goto end
  
  :: ----- Servlet Debug 
---------------------------------------------------------
  
  :doDebug
  %EXEC% %JAVA_HOME%\bin\java.exe %JAVA_OPT% -Xdebug 
-Xrunjdwp:transport=dt_socket,address=%JAVA_DEBUG_PORT%,server=y,suspend=n  
-classpath %CP% -Djava.endorsed.dirs=lib\endorsed -Dxindice.home=%XINDICE_HOME% 
-Dxindice.db.home=%XINDICE_HOME% -Dwebapp=%JETTY_WEBAPP% 
-Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser 
-Djetty.port=%JETTY_PORT% -Djetty.admin.port=%JETTY_ADMIN_PORT% 
-Dforehead.conf.file=tools\jetty\conf\jetty.env com.werken.forehead.Forehead 
tools\jetty\conf\main.xml
  
  :: ----- End 
-------------------------------------------------------------------
  
  :end
  set CP=
  
  
  
  
  

Reply via email to