#!/bin/sh # 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 @VERSION@ Command Line Tool Unix Shell Script # ----------------------------------------------------------------------------- # ----- OS specific support ---------------------------------------------------- cygwin=false; darwin=false; case "`uname`" in CYGWIN*) cygwin=true ;; Darwin*) darwin=true if [ -z "$JAVA_HOME" ] ; then JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home fi ;; esac # ----- 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 XINDICE_HOME=`dirname $0`/.. if [ ! -f $XINDICE_HOME/xindice-1*.jar ] ; then echo ERROR: You must set XINDICE_HOME to point at your echo Xindice installation directory. exit 2 fi fi if [ "$XINDICE_DB_HOME" = "" ] ; then XINDICE_DB_HOME=$XINDICE_HOME ; fi if [ "$XINDICE_CONFIG" = "" ] ; then XINDICE_CONFIG=$XINDICE_HOME/config/system.xml ; fi if [ "$LOGGER" = "" ] ; then LOGGER=org.apache.commons.logging.impl.SimpleLog ; fi if [ "$LOGLEVEL" = "" ] ; then LOGLEVEL=INFO ; fi # ----- Set Classpath ---------------------------------------------------------- CP= for i in `ls $XINDICE_HOME/lib/endorsed/*.jar` ; do CP=$CP:$i ; done for i in `ls $XINDICE_HOME/lib/*.jar` ; do CP=$CP:$i ; done for i in `ls $XINDICE_HOME/xindice*.jar` ; do CP=$CP:$i ; done # ----- Run Tools -------------------------------------------------------------- JAVACMD=$JAVA_HOME/bin/java # For Cygwin, switch paths to Windows format before running java if $cygwin; then CP=`cygpath --path --windows "$CP"` XINDICE_HOME=`cygpath --path --windows "$XINDICE_HOME"` XINDICE_DB_HOME=`cygpath --path --windows "$XINDICE_DB_HOME"` XINDICE_CONFIG=`cygpath --path --windows "$XINDICE_CONFIG"` fi $JAVACMD -Xms16m -Xmx128m -Djava.endorsed.dirs="$XINDICE_HOME/lib/endorsed" -Dxindice.home="$XINDICE_HOME" -Dxindice.db.home="$XINDICE_DB_HOME" -Dxindice.configuration="$XINDICE_CONFIG" -Dorg.apache.commons.logging.Log="$LOGGER" -Dorg.apache.commons.logging.simplelog.defaultlog="$LOGLEVEL" -Dcmd.home="$XINDICE_HOME" -classpath "$CP" org.apache.xindice.tools.XMLTools "$@"