You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@apache.org on 2003/02/23 18:12:19 UTC
cvs commit: xml-cocoon2 cocoon.sh
stefano 2003/02/23 09:12:19
Added: . cocoon.sh
Log:
unix version of the cocoon launcher (please check it on a unix box since I coded it on win32 and I don't have a unix box to try it on)
Revision Changes Path
1.1 xml-cocoon2/cocoon.sh
Index: cocoon.sh
===================================================================
#!/bin/sh
# -----------------------------------------------------------------------------
# Cocoon Unix Shell Script
#
# $Id: cocoon.sh,v 1.1 2003/02/23 17:12:18 stefano Exp $
# -----------------------------------------------------------------------------
# Configuration variables
#
# 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 " cli Run Cocoon from command line"
echo " servlet Run Cocoon in a servlet container"
echo " servlet-admin Run Cocoon in a servlet container and turn container web administration on"
echo " servlet-debug Run Cocoon in a servlet container and turn remote debug on"
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 [ "$JETTY_PORT" = "" ] ; then
JETTY_PORT=8888
fi
if [ "$JETTY_ADMIN_PORT" = "" ] ; then
JETTY_ADMIN_PORT=8889
fi
if [ "$JETTY_WEBAPP" = "" ] ; then
JETTY_WEBAPP=build/webapp
fi
if [ "$JAVA_DEBUG_PORT" = "" ] ; then
JETTY_WEBAPP=8000
fi
# ----- Set Classpath ----------------------------------------------------------
CP=./tools/lib/forehead-1.0-beta-4.jar
# ----- Do the action ----------------------------------------------------------
case "$ACTION" in
cli)
echo "WARNING! DOESN'T WORK YET!"
#$JAVA_HOME/bin/java -classpath %CP% -Djava.endorsed.dirs=lib/endorsed -Dforehead.conf.file=cocoon.env com.werken.forehead.Forehead $ARGS
;;
servlet)
$JAVA_HOME/bin/java $JAVA_OPT -classpath $CP -Djava.endorsed.dirs=lib/endorsed -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
;;
servlet-admin)
$JAVA_HOME/bin/java $JAVA_OPT -classpath $CP -Djava.endorsed.dirs=lib/endorsed -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
;;
servlet-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 -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
;;
*)
usage
;;
esac
exit 0