#!/bin/sh # # Shell Wrapper for RenderX's XEP (http://www.renderx.com/) # # # One-time setup: # ln -s xep-wrapper xep # ln -s xep-wrapper xep-validate # ln -s xep-wrapper xep-transform # ln -s xep-wrapper xep-xsldriver # # Usage: # xep ... # xep-validate ... # xep-transform ... # xep-xsldriver ... # # # $Id: xep-wrapper,v 1.6 2003/03/27 05:21:08 software Exp $ # # # Configuration # XEP_DIST_HOME=${XEP_DIST_HOME:-/pkgs/xep-3.3.1} XEP_MAIN_JARFILE=${XEP_MAIN_JARFILE:-xep331_client.jar} XEP_JAVA_HOME=${XEP_JAVA_HOME:-/pkgs/j2sdk-1.4.1/jre} # # User Run-Time Configuration # # Examples: # XEP_JAVA_OPTIONS="-Xmx120m -Xms120m" # XEP_JAVA_CLASSPATH="/path/file1.jar:/path/file2.jar" # # # Setup and verify configuration # if [ ! -d "${XEP_DIST_HOME}" ] then echo "${0}: Unable to find XEP distribution (${XEP_DIST_HOME}) - Aborting" exit 1 fi if [ ! -d "${XEP_JAVA_HOME}" ] then echo "${0}: Unable to find Java distribution (${XEP_JAVA_HOME}) - Aborting" exit 2 fi xep_lib="${XEP_DIST_HOME}/lib" xep_classpath="${XEP_JAVA_CLASSPATH}" for jarfile in \ tools.jar \ ${XEP_MAIN_JARFILE} \ cryptix32.jar \ cryptix32-pgp.jar \ saxon.jar \ xt.jar do if [ "${jarfile}" != "tools.jar" -a ! -f "${xep_lib}/${jarfile}" ] then echo "${0}: Unable to find ${xep_lib}/${jarfile} - Aborting" exit 3 fi xep_classpath="${xep_classpath}:${xep_lib}/${jarfile}" done application=`basename ${0}` case "${application}" in xep) xep_main=com.renderx.xep.Driver ;; xep-xsldriver) xep_main=com.renderx.xep.XSLDriver ;; xep-validate) xep_main=com.renderx.xep.JAXPDriver ;; xep-transform) xep_main=com.renderx.xep.Validator ;; *) echo "$0: Unknown XEP application : ${application} - Aborting" exit 4; esac # # Run with DO=echo to see the generated command line # ${DO} ${XEP_JAVA_HOME}/bin/java \ ${XEP_JAVA_OPTIONS} \ -classpath "${xep_classpath}" \ -Dcom.renderx.xep.ROOT="${XEP_DIST_HOME}" \ ${xep_main} "${@}" exit # # The original script # XEP_DIST=${XEP_DIST:-/pkgs/xep-3.3.1} # # Lets keep it simple and use the installation generated shell scripts # (Thus this wrapper style simply provides a convenient name # and location independence) # application=`basename ${0}` case "${application}" in xep) XEP_SCRIPT=run.sh ;; xep-xsldriver) XEP_SCRIPT=xep.sh ;; xep-validate) XEP_SCRIPT=validate.sh ;; xep-transform) XEP_SCRIPT=transform.sh ;; *) echo "$0: Unknown XEP application : ${application} - Aborting" exit 1; esac exec ${XEP_DIST}/${XEP_SCRIPT} "${@}"