source: trunk/Distribution/Scripts/FOP.CMD

Last change on this file was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

  • Property svn:keywords set to Author Revision Date HeadURL Id
File size: 3.6 KB
Line 
1/*
2 *************************************************************************************
3 *
4 * DocBook Framework for OS/2 and eComStation
5 * Start FOP
6 *
7 * More info on the web:
8 * http://www.kacer.biz/os2/docbook-framework/
9 *
10 * Author:
11 * Jarda Kacer <mailto:jarda@kacer.biz>
12 *
13 *************************************************************************************
14 *
15 * This script invokes FOP and passes all user arguments to it.
16 *
17 *************************************************************************************
18 *
19 * $Author: jkacer $
20 * $Revision: 2 $
21 * $Date: 2007-09-05 20:07:46 +0000 (Wed, 05 Sep 2007) $
22 * $HeadURL: trunk/Distribution/Scripts/FOP.CMD $
23 *
24 *************************************************************************************
25 */
26
27OuterEnv = SetLocal()
28
29CALL RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
30CALL SysLoadFuncs
31
32ScriptDir = GetScriptPath()
33RootDir = GetParentDirectory(ScriptDir)
34
35JavaCommand = "java.exe"
36
37JavaCP = " -cp "
38JavaCP = JavaCP || RootDir || "\SW\FOP\build\fop.jar;"
39JavaCP = JavaCP || RootDir || "\SW\FOP\lib\batik.jar;"
40JavaCP = JavaCP || RootDir || "\SW\FOP\lib\xalan-2.4.1.jar;"
41JavaCP = JavaCP || RootDir || "\SW\FOP\lib\xercesImpl-2.2.1.jar;"
42JavaCP = JavaCP || RootDir || "\SW\FOP\lib\xml-apis.jar;"
43JavaCP = JavaCP || RootDir || "\SW\FOP\lib\avalon-framework-cvs-20020806.jar;"
44JavaCP = JavaCP || RootDir || "\SW\FOP\lib\logkit-1.0.jar;"
45JavaCP = JavaCP || RootDir || "\SW\FOP\lib\jimi-1.0.jar;"
46JavaCP = JavaCP || RootDir || "\SW\FOP\lib\jai_core.jar;"
47JavaCP = JavaCP || RootDir || "\SW\FOP\lib\jai_codec.jar;"
48JavaCP = JavaCP || RootDir || "\SW\FOP\hyph"
49
50MainClass = " org.apache.fop.apps.Fop"
51FOPCommand = " -c " || RootDir || "\SW\FOP\conf\userconfig.xml"
52
53Arguments = ARG(1)
54
55FinalCommand = JavaCommand || JavaCP || MainClass || FOPCommand || " " || Arguments
56
57/*
58 * Execute the final command
59 */
60FinalCommand
61
62CALL EndLocal
63EXIT
64
65
66/***********************************************************************************************/
67/* Procedures and functions */
68/***********************************************************************************************/
69
70
71/*
72 * Sets an environment variable or appends a value to it.
73 */
74AddEnvironment: PROCEDURE
75PARSE ARG VarName, VarValue
76IF (Value(VarName, , "OS2ENVIRONMENT")="")
77 THEN CALL SetEnvironment VarName, VarValue
78 ELSE CALL Value VarName, GetEnvironment(VarName) || ";" || VarValue, "OS2ENVIRONMENT"
79RETURN
80
81
82/*
83 * Sets an environment variable, overwriting its previous value.
84 */
85SetEnvironment: PROCEDURE
86PARSE ARG VarName, VarValue
87CALL Value VarName, VarValue, "OS2ENVIRONMENT"
88RETURN
89
90
91/*
92 * Returns the value of an environment variable.
93 */
94GetEnvironment: PROCEDURE
95PARSE ARG VarName
96RETURN Value(VarName, , "OS2ENVIRONMENT")
97
98
99/*
100 * Returns the current script name.
101 */
102GetScriptName: PROCEDURE
103PARSE SOURCE Result
104RETURN WORD(Result, 3)
105
106
107/*
108 * Returns the current script path, without "\" at the end.
109 */
110GetScriptPath: PROCEDURE
111ScriptName = GetScriptName()
112RETURN SUBSTR(ScriptName, 1, LASTPOS("\", ScriptName)-1)
113
114
115/*
116 * Returns True if the given file exists.
117 */
118FileExists: PROCEDURE
119PARSE ARG FileName
120CALL SysFileTree FileName, Result
121RETURN Result.0 > 0
122
123
124/*
125 * Returns the current directory, without "\" at the end.
126 */
127GetCurrentDir: PROCEDURE
128RETURN DIRECTORY()
129
130
131/*
132 * Returns the parent directory of the directory passed as argument, without "\" at the end
133 */
134GetParentDirectory: PROCEDURE
135PARSE ARG DirName
136RETURN SUBSTR(DirName, 1, LASTPOS("\", DirName)-1)
Note: See TracBrowser for help on using the repository browser.