You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jo...@apache.org on 2005/08/06 07:55:46 UTC
cvs commit: xml-xalan/java/samples/extensions/sql runExtConnection.bat runExtConnection.sh runDerby.bat runXalan.sh runDerby.sh runXalan.bat
johng 2005/08/05 22:55:46
Modified: java/samples/extensions/sql runDerby.bat runXalan.sh
runDerby.sh runXalan.bat
Added: java/samples/extensions/sql runExtConnection.bat
runExtConnection.sh
Log:
PR:XALANJ-2183
Obtained from:
Submitted by: John Gentilin
Reviewed by: Yash Talwar
CVS: ----------------------------------------------------------------------
CVS: New batch for for the ext-sample and revise fo new Jar
CVS: file locations. Now works from both Binary and Source distros.
Revision Changes Path
1.3 +0 -5 xml-xalan/java/samples/extensions/sql/runDerby.bat
Index: runDerby.bat
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/extensions/sql/runDerby.bat,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- runDerby.bat 2 Aug 2005 04:03:29 -0000 1.2
+++ runDerby.bat 6 Aug 2005 05:55:46 -0000 1.3
@@ -22,7 +22,6 @@
rem - you should set JAVA_HOME
rem - you can set DERBY_HOME to point to both derby.jar and derbytools.jar
rem - JAVA_OPTS is added to the java command line
-rem - PARSER_JAR may be set to use alternate parser (default:..\..\..\lib\xercesImpl.jar)
rem - DERBY_JAR_DIR, default is the current directory
echo.
@@ -47,10 +46,6 @@
set _DERBY_JAR=%DERBY_JAR_DIR%\derby.jar;%DERBY_JAR_DIR%\derbytools.jar
-set _PARSER_JAR=%PARSER_JAR%
-if "%_PARSER_JAR%" == "" set _PARSER_JAR=..\..\..\lib\xercesImpl.jar
-set _XML-APIS_JAR=%XML-APIS_JAR%
-if "%_XML-APIS_JAR%" == "" set _XML-APIS_JAR=..\..\..\lib\xml-apis.jar
rem Attempt to automatically add system classes to _CLASSPATH
rem Use _underscore prefix to not conflict with user's settings
1.2 +33 -9 xml-xalan/java/samples/extensions/sql/runXalan.sh
Index: runXalan.sh
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/extensions/sql/runXalan.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- runXalan.sh 28 Jul 2005 00:35:59 -0000 1.1
+++ runXalan.sh 6 Aug 2005 05:55:46 -0000 1.2
@@ -16,18 +16,39 @@
_JAVACMD=$JAVA_HOME/bin/java
-_BUILD_DIR=../../../build
-
-_JAR_DIR=../../../lib
-
-
-_ENDORSED_DIR=$_BUILD_DIR
if [ "$JAVA_HOME" = "" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
_JAVACMD=java
fi
+
+
+#TO Work with JDK 1.3 and JDK 1.4, we will keep the directory
+#component seperate from the JAR name. This way we can use the
+#directory component as part of the Endorsed Dir command line
+#argument when running under JDK 1.4 this should also work for JDK 1.5
+
+#The XML Apis are going to be either in the LIB dir for a source
+#release or in the root direcctory for a binary release.
+
+
+if [ -f ../../../build/xalan.jar ] ; then
+echo "Configuring Xalan for a Source build"
+_XALAN_DIR=../../../build/
+else
+echo "Configuring Xalan for a Release build"
+_XALAN_DIR=../../../
+fi
+
+if [ -f ../../../lib/xercesImpl.jar ] ; then
+
+_JAR_DIR=../../../lib/
+else
+_JAR_DIR=../../../
+fi
+
+
if [ "$PARSER_JAR" = "" ] ; then
PARSER_JAR=$_JAR_DIR/xercesImpl.jar
fi
@@ -37,10 +58,12 @@
fi
if [ "$XALAN_JAR" = "" ] ; then
- XALAN_JAR=$_BUILD_DIR/xalan.jar
+ XALAN_JAR=$_XALAN_DIR/xalan.jar
+ SERIALIZER_JAR=$_XALAN_DIR/serializer.jar
fi
+
# Use _underscore prefix to not conflict with user's settings
# Default to UNIX-style pathing
CLPATHSEP=:
@@ -58,9 +81,10 @@
_CLASSPATH=${_CLASSPATH}${CLPATHSEP}${JAVA_HOME}/lib/classes.zip
fi
+_ENDORSED_DIR=${_XALAN_DIR}${CLPATHSEP}${_JAR_DIR}
-echo "Running Derby: $@"
-echo " ...with classpath: $_CLASSPATH"
+echo "Running Xalan: $@"
+echo "...with classpath: $_CLASSPATH"
"$_JAVACMD" $JAVA_OPTS -Djava.endorsed.dirs=$_ENDORSED_DIR -classpath "$_CLASSPATH" -Dij.protocol=jdbc:derby: org.apache.xalan.xslt.Process $@
1.2 +1 -13 xml-xalan/java/samples/extensions/sql/runDerby.sh
Index: runDerby.sh
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/extensions/sql/runDerby.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- runDerby.sh 28 Jul 2005 00:35:59 -0000 1.1
+++ runDerby.sh 6 Aug 2005 05:55:46 -0000 1.2
@@ -29,18 +29,6 @@
_JAVACMD=java
fi
-if [ "$PARSER_JAR" = "" ] ; then
- PARSER_JAR=$_JAR_DIR/xercesImpl.jar
-fi
-
-if [ "$XML_APIS_JAR" = "" ] ; then
- XML_APIS_JAR=$_JAR_DIR/xml-apis.jar
-fi
-
-if [ "$XALAN_JAR" = "" ] ; then
- XALAN_JAR=$_BUILD_DIR/xalan.jar
-fi
-
# Use _underscore prefix to not conflict with user's settings
# Default to UNIX-style pathing
@@ -48,7 +36,7 @@
# if we're on a Windows box make it ;
uname | grep WIN && CLPATHSEP=\;
-_CLASSPATH="$XALAN_JAR${CLPATHSEP}$XML_APIS_JAR${CLPATHSEP}$PARSER_JAR${CLPATHSEP}$XALAN_JAR${CLPATHSEP}$DERBYJAR_DIR/derby.jar${CLPATHSEP}$DERBYJAR_DIR/derbytools.jar${CLPATHSEP}$CLASSPATH"
+_CLASSPATH="$DERBYJAR_DIR/derby.jar${CLPATHSEP}$DERBYJAR_DIR/derbytools.jar${CLPATHSEP}$CLASSPATH"
# Attempt to automatically add system classes to _CLASSPATH
if [ -f $JAVA_HOME/lib/tools.jar ] ; then
1.3 +52 -9 xml-xalan/java/samples/extensions/sql/runXalan.bat
Index: runXalan.bat
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/extensions/sql/runXalan.bat,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- runXalan.bat 2 Aug 2005 04:03:29 -0000 1.2
+++ runXalan.bat 6 Aug 2005 05:55:46 -0000 1.3
@@ -45,13 +45,48 @@
set _DERBY_JAR=%DERBY_JAR_DIR%\derby.jar;%DERBY_JAR_DIR%\derbytools.jar
-set _PARSER_JAR=%PARSER_JAR%
-if "%_PARSER_JAR%" == "" set _PARSER_JAR=..\..\..\lib\xercesImpl.jar
-set _XML-APIS_JAR=%XML-APIS_JAR%
-if "%_XML-APIS_JAR%" == "" set _XML-APIS_JAR=..\..\..\lib\xml-apis.jar
+REM TO Work with JDK 1.3 and JDK 1.4, we will keep the directory
+REM component seperate from the JAR name. This way we can use the
+REM directory component as part of the Endorsed Dir command line
+REM argument when running under JDK 1.4 this should also work for JDK 1.5
+
+REM The XML Apis are going to be either in the LIB dir for a source
+REM release or in the root direcctory for a binary release.
+
+IF EXIST "..\..\..\lib\xercesImpl.jar" goto BIN_DIR_BINRELEASE
+
+:BIN_DIR_SRCRELEASE
+ Echo Setting bin JAR directory for a sOurce release
+ set _BIN_JAR_DIR=..\..\..\
+ goto REPORT_BIN_DIR
+
+:BIN_DIR_BINRELEASE
+ echo Setting bin JAR Directory for a binary release
+ set _BIN_JAR_DIR=..\..\..\lib
+
+:REPORT_BIN_DIR
+Echo Binary JAR Directory: %_BIN_JAR_DIR%
+echo .
+
+
+REM The Parser JAR will be in the Lib Dir for the Source Release and for the
+REM Binary Release they are in the root directory.
+
+if exist "..\..\..\build\xalan.jar" goto XALAN_DIR_BINRELEASE
+
+:XALAN_DIR_SRCRELEASE
+ Echo Configuring Xalan for a binary release
+ set _XALAN_JAR_DIR=..\..\..\
+ goto XALAN_DIR_REPORT
+
+:XALAN_DIR_BINRELEASE
+ Echo Configuring Xalan for source release
+ set _XALAN_JAR_DIR=..\..\..\build
+
+:XALAN_DIR_REPORT
+Echo Xalan Directory is: %_XALAN_JAR_DIR%
+echo .
-set _XALAN_JAR_DIR=%XALAN_JAR_DIR%
-if "%_XALAN_JAR_DIR%" == "" set _XALAN_JAR_DIR=..\..\..\build
rem Attempt to automatically add system classes to _CLASSPATH
@@ -59,12 +94,20 @@
set _CLASSPATH=%CLASSPATH%
if exist "%JAVA_HOME%\lib\tools.jar" set _CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
if exist "%JAVA_HOME%\lib\classes.zip" set _CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\classes.zip
-set _CLASSPATH=%_XALAN_JAR_DIR%\xalan.jar;%_XML-APIS_JAR%;%_PARSER_JAR%;%_DERBY_JAR%;%_CLASSPATH%
-echo %_CLASSPATH%
+
+set _CLASSPATH=%_XALAN_JAR_DIR%\xalan.jar;%_XALAN_JAR_DIR%\serializer.jar;%_BIN_JAR_DIR%\xml-apis.jar;%_BIN_JAR_DIR%\xercesImpl.jar;%_DERBY_JAR%;%_CLASSPATH%
+
+echo Using Classpath: %_CLASSPATH%
+echo .
+
+set _ENDORSED_DIR=%_XALAN_JAR_DIR%;%_BIN_JAR_DIR%
+echo Setting Endorsed Dir to: %_ENDORSED_DIR% : Note ONLY USed for JDK 1.4
+echo .
+
@echo on
-"%_JAVACMD%" -mx64m %JAVA_OPTS% -Djava.endorsed.dirs=%_XALAN_JAR_DIR% -classpath "%_CLASSPATH%" org.apache.xalan.xslt.Process %1 %2 %3 %4 %5 %6 %7 %8
+"%_JAVACMD%" -mx64m %JAVA_OPTS% -Djava.endorsed.dirs=%_ENDORSED_DIR% -classpath "%_CLASSPATH%" org.apache.xalan.xslt.Process %1 %2 %3 %4 %5 %6 %7 %8
@echo off
goto end
1.1 xml-xalan/java/samples/extensions/sql/runExtConnection.bat
Index: runExtConnection.bat
===================================================================
@echo off
rem
rem ==========================================================================
rem = Copyright 2004 The Apache Software Foundation.
rem =
rem = Licensed under the Apache License, Version 2.0 (the "License");
rem = you may not use this file except in compliance with the License.
rem = You may obtain a copy of the License at
rem =
rem = http://www.apache.org/licenses/LICENSE-2.0
rem =
rem = Unless required by applicable law or agreed to in writing, software
rem = distributed under the License is distributed on an "AS IS" BASIS,
rem = WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem = See the License for the specific language governing permissions and
rem = limitations under the License.
rem ==========================================================================
rem
rem runDerby.bat: Script to execute the Derby tool IJ
rem Usage: runDerby script file]
rem Setup:
rem - you should set JAVA_HOME
rem - you can set DERBY_HOME to point to both derby.jar and derbytools.jar
rem - JAVA_OPTS is added to the java command line
rem - PARSER_JAR may be set to use alternate parser (default:..\..\..\bin\xercesImpl.jar)
rem - DERBY_JAR_DIR, default is the current directory
echo.
if not "%JAVA_HOME%" == "" goto setant
:noJavaHome
rem Default command used to call java.exe; hopefully it's on the path here
if "%_JAVACMD%" == "" set _JAVACMD=java
echo.
echo Warning: JAVA_HOME environment variable is not set.
echo If build fails because sun.* classes could not be found
echo you will need to set the JAVA_HOME environment variable
echo to the installation directory of java.
echo.
:setant
rem Default command used to call java.exe or equivalent
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
rem Default command used to call java.exe or equivalent
if "%_JAVACCMD%" == "" set _JAVACCMD=%JAVA_HOME%\bin\javac
if "%DERBY_JAR_DIR%" == "" set DERBY_JAR_DIR=.
set _DERBY_JAR=%DERBY_JAR_DIR%\derby.jar;%DERBY_JAR_DIR%\derbytools.jar
REM TO Work with JDK 1.3 and JDK 1.4, we will keep the directory
REM component seperate from the JAR name. This way we can use the
REM directory component as part of the Endorsed Dir command line
REM argument when running under JDK 1.4 this should also work for JDK 1.5
REM The XML Apis are going to be either in the LIB dir for a source
REM release or in the root direcctory for a binary release.
IF EXIST "..\..\..\lib\xercesImpl.jar" goto BIN_DIR_BINRELEASE
:BIN_DIR_SRCRELEASE
Echo Setting bin JAR directory for a sOurce release
set _BIN_JAR_DIR=..\..\..\
goto REPORT_BIN_DIR
:BIN_DIR_BINRELEASE
echo Setting bin JAR Directory for a binary release
set _BIN_JAR_DIR=..\..\..\lib
:REPORT_BIN_DIR
Echo Binary JAR Directory: %_BIN_JAR_DIR%
echo .
REM The Parser JAR will be in the Lib Dir for the Source Release and for the
REM Binary Release they are in the root directory.
if exist "..\..\..\build\xalan.jar" goto XALAN_DIR_BINRELEASE
:XALAN_DIR_SRCRELEASE
Echo Configuring Xalan for a binary release
set _XALAN_JAR_DIR=..\..\..\
goto XALAN_DIR_REPORT
:XALAN_DIR_BINRELEASE
Echo Configuring Xalan for source release
set _XALAN_JAR_DIR=..\..\..\build
:XALAN_DIR_REPORT
Echo Xalan Directory is: %_XALAN_JAR_DIR%
echo .
rem Attempt to automatically add system classes to _CLASSPATH
rem Use _underscore prefix to not conflict with user's settings
set _CLASSPATH=%CLASSPATH%
if exist "%JAVA_HOME%\lib\tools.jar" set _CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
if exist "%JAVA_HOME%\lib\classes.zip" set _CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\classes.zip
set _CLASSPATH=%_XALAN_JAR_DIR%\xalan.jar;%_XALAN_JAR_DIR%\serializer.jar;%_BIN_JAR_DIR%\xml-apis.jar;%_BIN_JAR_DIR%\xercesImpl.jar;%_DERBY_JAR%;%_CLASSPATH%
set _CLASSPATH=ext-connection;%_CLASSPATH%
echo Using Classpath: %_CLASSPATH%
echo .
set _ENDORSED_DIR=%_XALAN_JAR_DIR%;%_BIN_JAR_DIR%
echo Setting Endorsed Dir to: %_ENDORSED_DIR% : Note ONLY USed for JDK 1.4
echo .
Echo Compiling the External connection Class
echo %_JAVACCMD% -d ./ext-connection -classpath "%_CLASSPATH%" ./ext-connection/ExternalConnection.java
%_JAVACCMD% -d ./ext-connection -classpath "%_CLASSPATH%" ./ext-connection/ExternalConnection.java
@echo on
"%_JAVACMD%" -mx64m %JAVA_OPTS% -Djava.endorsed.dirs=%_ENDORSED_DIR% -classpath "%_CLASSPATH%" ExternalConnection %1 %2 %3 %4 %5 %6 %7 %8
@echo off
goto end
:end
rem Cleanup environment variables
set _JAVACMD=
set _CLASSPATH=
set _ANT_HOME=
set _ANT_JAR=
set _PARSER_JAR=
set _XML-APIS_JAR=
1.1 xml-xalan/java/samples/extensions/sql/runExtConnection.sh
Index: runExtConnection.sh
===================================================================
#!/bin/sh
#
#=========================================================================
# Copyright 2004 The Apache Software Foundation.
#
# Licensed 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
if [ "$DERBY_JAR_DIR" = "" ] ; then
DERBYJAR_DIR=.
fi
_JAVACMD=$JAVA_HOME/bin/java
_JAVACCMD=$JAVA_HOME/bin/javac
if [ "$JAVA_HOME" = "" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
_JAVACMD=java
fi
#TO Work with JDK 1.3 and JDK 1.4, we will keep the directory
#component seperate from the JAR name. This way we can use the
#directory component as part of the Endorsed Dir command line
#argument when running under JDK 1.4 this should also work for JDK 1.5
#The XML Apis are going to be either in the LIB dir for a source
#release or in the root direcctory for a binary release.
if [ -f ../../../build/xalan.jar ] ; then
echo "Configuring Xalan for a Source build"
echo .
_XALAN_DIR=../../../build/
else
echo "Configuring Xalan for a Release build"
_XALAN_DIR=../../../
fi
if [ -f ../../../lib/xercesImpl.jar ] ; then
_JAR_DIR=../../../lib/
else
_JAR_DIR=../../../
fi
if [ "$PARSER_JAR" = "" ] ; then
PARSER_JAR=$_JAR_DIR/xercesImpl.jar
fi
if [ "$XML_APIS_JAR" = "" ] ; then
XML_APIS_JAR=$_JAR_DIR/xml-apis.jar
fi
if [ "$XALAN_JAR" = "" ] ; then
XALAN_JAR=$_XALAN_DIR/xalan.jar
SERIALIZER_JAR=$_XALAN_DIR/serializer.jar
fi
echo "Using Xalan JARS from: " $_XALAN_DIR
echo .
# Use _underscore prefix to not conflict with user's settings
# Default to UNIX-style pathing
CLPATHSEP=:
# if we're on a Windows box make it ;
uname | grep WIN && CLPATHSEP=\;
_CLASSPATH="$XALAN_JAR${CLPATHSEP}$XML_APIS_JAR${CLPATHSEP}$PARSER_JAR${CLPATHSEP}$XALAN_JAR${CLPATHSEP}$DERBYJAR_DIR/derby.jar${CLPATHSEP}$DERBYJAR_DIR/derbytools.jar${CLPATHSEP}$CLASSPATH"
# Attempt to automatically add system classes to _CLASSPATH
if [ -f $JAVA_HOME/lib/tools.jar ] ; then
_CLASSPATH=${_CLASSPATH}${CLPATHSEP}${JAVA_HOME}/lib/tools.jar
fi
if [ -f $JAVA_HOME/lib/classes.zip ] ; then
_CLASSPATH=${_CLASSPATH}${CLPATHSEP}${JAVA_HOME}/lib/classes.zip
fi
_ENDORSED_DIR=${_XALAN_DIR}${CLPATHSEP}${_JAR_DIR}
_CLASSPATH=${_CLASSPATH}${CLPATHSEP}./ext-connection
echo Compiling the External connection Class
echo $_JAVACCMD -d ./ext-connection -classpath "$_CLASSPATH" ./ext-connection/ExternalConnection.java
$_JAVACCMD -d ./ext-connection -classpath "$_CLASSPATH" ./ext-connection/ExternalConnection.java
echo .
echo .
echo "Running External Connection Example Code: $@"
echo "...with classpath: $_CLASSPATH"
"$_JAVACMD" $JAVA_OPTS -Djava.endorsed.dirs=$_ENDORSED_DIR -classpath "$_CLASSPATH" -Dij.protocol=jdbc:derby: ExternalConnection $@
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org