@echo off :: Licensed to the Apache Software Foundation (ASF) under one or more :: contributor license agreements. See the NOTICE file distributed with :: this work for additional information regarding copyright ownership. :: The ASF licenses this file to You under the Apache License, Version 2.0 :: (the "License"); you may not use this file except in compliance with :: the License. You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. :: :: $Id$ :: ----------------------------------------------------------------------------- :: Xindice Win32/Win16 Shell Script :: ----------------------------------------------------------------------------- if not "%OS%"=="Windows_NT" goto start @setlocal :start :: 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 :: ----- Verify and Set Required Environment Variables ------------------------- if not "%JAVA_HOME%" == "" goto gotJavaHome echo ERROR: You must set JAVA_HOME to point at your Java echo Development Kit installation goto end :gotJavaHome set _XINDICE_HOME=%XINDICE_HOME% if not "%_XINDICE_HOME%" == "" goto gotXindiceHome :: ----- Use the location of this script set _XINDICE_HOME=%~dp0. if not exist "%_XINDICE_HOME%\xindice-1*.jar" goto noXindiceHome echo WARNING: The environment variable XINDICE_HOME is not set. echo Defaulting to %_XINDICE_HOME% goto gotXindiceHome :noXindiceHome echo ERROR: You must set XINDICE_HOME to point at your echo Xindice WEB-INF directory. goto end :gotXindiceHome set _XINDICE_DB_HOME=%XINDICE_DB_HOME% if "%_XINDICE_DB_HOME%" == "" set _XINDICE_DB_HOME=%_XINDICE_HOME% set _XINDICE_CONFIG=%XINDICE_CONFIG% if "%_XINDICE_CONFIG%" == "" set _XINDICE_CONFIG=%_XINDICE_HOME%\config\system.xml set _JAVACMD=%JAVACMD% if "%_JAVACMD%" == "" set _JAVACMD="%JAVA_HOME%\bin\java" :: ----- Set Up The Classpath -------------------------------------------------- set LOCALCLASSPATH= for %%i in ("%_XINDICE_HOME%\lib\servlet*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i for %%i in ("%_XINDICE_HOME%\lib\endorsed\*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i for %%i in ("%_XINDICE_HOME%\tools\jetty\*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i for %%i in ("%_XINDICE_HOME%\tools\jetty\lib\*.jar") do call "%_XINDICE_HOME%\bin\lcp.bat" %%i :: ----- Check System Properties ----------------------------------------------- set _EXEC=start "Xindice" /D. /MAX set _JAVA_OPTIONS=%JAVA_OPTIONS% if not "%_JAVA_OPTIONS%" == "" goto gotOptions set _JAVA_OPTIONS=-Xms64m -Xmx128m :gotOptions set _JETTY_PORT=%JETTY_PORT% if not "%_JETTY_PORT%" == "" goto gotPort set _JETTY_PORT=8888 :gotPort set _JETTY_WEBAPP=%JETTY_WEBAPP% if not "%_JETTY_WEBAPP%" == "" goto gotWebapp set _JETTY_WEBAPP=%_XINDICE_HOME%\xindice-1.2-dev.war :gotWebapp set _JAVA_DEBUG_PORT=%JAVA_DEBUG_PORT% if not "%_JAVA_DEBUG_PORT%" == "" goto gotDebugPort set _JAVA_DEBUG_PORT=8000 :gotDebugPort set _JAVA_ARGS=-classpath %LOCALCLASSPATH% -Djava.endorsed.dirs=lib\endorsed -Dxindice.home="%_XINDICE_HOME%" -Dxindice.db.home="%_XINDICE_HOME%" -Dxindice.configuration="%_XINDICE_CONFIG%" -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -Djetty.home="%_XINDICE_HOME%/tools/jetty" -Djetty.port=%_JETTY_PORT% -Dwebapp=%_JETTY_WEBAPP% :: ----- Check action ---------------------------------------------------------- if ""%1"" == ""start"" goto doStart if ""%1"" == ""run"" goto doRun if ""%1"" == ""debug"" goto doDebug echo Usage: xindice (action) echo actions: echo start Start Xindice in new window echo run Run Xindice in this window echo debug Start Xindice turning remote debugging on goto end :: ----- Start Servlet --------------------------------------------------------- :doStart %_EXEC% %_JAVACMD% %_JAVA_OPTIONS% %_JAVA_ARGS% org.mortbay.start.Main tools\jetty\conf\main.xml goto end :: ----- Run Servlet ----------------------------------------------------------- :doRun %_JAVACMD% %_JAVA_OPTIONS% %_JAVA_ARGS% org.mortbay.start.Main tools\jetty\conf\main.xml goto end :: ----- Servlet Debug --------------------------------------------------------- :doDebug %_EXEC% %_JAVACMD% %_JAVA_OPTIONS% -Xdebug -Xrunjdwp:transport=dt_socket,address=%_JAVA_DEBUG_PORT%,server=y,suspend=n %_JAVA_ARGS% -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.defaultlog=DEBUG org.mortbay.start.Main tools\jetty\conf\main.xml goto end :: ----- End ------------------------------------------------------------------- :end if not "%OS%"=="Windows_NT" goto win16 @endlocal goto mainEnd :win16 set _JAVA_ARGS= set _XINDICE_HOME= set _XINDICE_DB_HOME= set _XINDICE_CONFIG= set _JAVACMD= set _EXEC= set _JAVA_OPTIONS= set _JETTY_PORT= set _JETTY_WEBAPP= set _JAVA_DEBUG_PORT= set LOCALCLASSPATH= :mainEnd