/* OS2 REXX VERSION OF fop.bat */

ECHO OFF
/*ECHO ON*/
PARSE ARG a b c d e f g h

/*
rem %~dp0 is the expanded pathname of the current script under NT
set LOCAL_FOP_HOME=
if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME=%~dp0
*/

/*SET UP THE DIRECTORY PATHS FROM ENVIRONMENT IF POSSIBLE*/
/*A Java runtime appropriate for gX, settable by the user*/
javaRuntimeEngine = VALUE('GX_JAVA_RUNTIME',,'OS2ENVIRONMENT')
if javaRuntimeEngine="" then
  DO
    javaRuntimeEngine = 'g:\java13\jre\bin\java' 
    VALUE('GX_JAVA_RUNTIME',javaRuntimeEngine,'OS2ENVIRONMENT')
  END

/*The paths which depend on GX_HOME_DIRECTORY*/
gxHomeDirectory = VALUE('GX_HOME_DIRECTORY',,'OS2ENVIRONMENT')
if gxHomeDirectory="" then  gxHomeDirectory='C:\gX\'

/*The FOP path and command file*/
localFopHome = VALUE('GX_FOP_PATH',,'OS2ENVIRONMENT')
if localFopHome="" then
  localFopHome=gxHomeDirectory'bin\fop\fop-0.20.5\'


libDir=localFopHome'lib'
/*set LIBDIR=%LOCAL_FOP_HOME%lib  */

localClassPath=localFopHome'build\fop.jar'
/*set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar  */

localClassPath=localClassPath';'libDir'\xml-apis.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar    */

localClassPath=localClassPath';'libDir'\batik.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik.jar     */

localClassPath=localClassPath';'libDir'\avalon-framework-cvs-20020806.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-cvs-20020806.jar  */

localClassPath=localClassPath';'libDir'\jimi-1.0.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar  */

localClassPath=localClassPath';'libDir'\jai_core.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar   */

localClassPath=localClassPath';'libDir'\jai_codec.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar   */

localClassPath=localClassPath';'libDir'\xercesImpl-2.2.1.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.2.1.jar  */

localClassPath=localClassPath';'libDir'\xalan-2.4.1.jar'
/*set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar   */



SAY '...Local classPath for FOP is: 'localClassPath

/*
REM java -cp "%LOCALCLASSPATH%" org.apache.fop.apps.Fop %1 %2 %3 %4 %5 %6 %7 %8
"D:\Program Files\SQLLIB\java\java12\jdk\jre\bin\java.exe" -cp "%LOCALCLASSPATH%" org.apache.fop.apps.Fop %1 %2 %3 %4 %5 %6 %7 %8
*/

javaRuntimeEngine ' -cp ' '"'localClassPath'"'  'org.apache.fop.apps.Fop' a b c d e f g h

if RC=0 then
  EXIT 0
else
  EXIT 'FOP transform failed'




