source: trunk/Distribution/Scripts/XEP.CMD@ 2

Last change on this file since 2 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.4 KB
Line 
1/*
2 *************************************************************************************
3 *
4 * DocBook Framework for OS/2 and eComStation
5 * Start XEP
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 XEP 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/XEP.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 " || RootDir || "\SW\Saxon;"
38JavaCP = JavaCP || RootDir || "\SW\Saxon\resolver.jar;"
39JavaCP = JavaCP || RootDir || "\SW\Saxon\saxon643.jar;"
40JavaCP = JavaCP || RootDir || "\SW\XEP\lib\xep.jar;"
41JavaCP = JavaCP || RootDir || "\SW\XEP\lib\saxon.jar;"
42JavaCP = JavaCP || RootDir || "\SW\XEP\lib\xt.jar"
43
44JavaD1 = " -Dcom.renderx.sax.entityresolver=com.sun.resolver.tools.CatalogResolver"
45JavaD2 = " -Dcom.renderx.jaxp.uriresolver=com.sun.resolver.tools.CatalogResolver"
46
47MainClass = " com.renderx.xep.XSLDriver"
48
49XEPCommand = " -DCONFIG=" || RootDir || "\SW\XEP\xep.xml"
50
51Arguments = ARG(1)
52
53FinalCommand = JavaCommand || JavaCP || JavaD1 || JavaD2 || MainClass || XEPCommand || " " || Arguments
54
55/*
56 * Execute the final command
57 */
58FinalCommand
59
60CALL EndLocal
61EXIT
62
63
64/***********************************************************************************************/
65/* Procedures and functions */
66/***********************************************************************************************/
67
68
69/*
70 * Sets an environment variable or appends a value to it.
71 */
72AddEnvironment: PROCEDURE
73PARSE ARG VarName, VarValue
74IF (Value(VarName, , "OS2ENVIRONMENT")="")
75 THEN CALL SetEnvironment VarName, VarValue
76 ELSE CALL Value VarName, GetEnvironment(VarName) || ";" || VarValue, "OS2ENVIRONMENT"
77RETURN
78
79
80/*
81 * Sets an environment variable, overwriting its previous value.
82 */
83SetEnvironment: PROCEDURE
84PARSE ARG VarName, VarValue
85CALL Value VarName, VarValue, "OS2ENVIRONMENT"
86RETURN
87
88
89/*
90 * Returns the value of an environment variable.
91 */
92GetEnvironment: PROCEDURE
93PARSE ARG VarName
94RETURN Value(VarName, , "OS2ENVIRONMENT")
95
96
97/*
98 * Returns the current script name.
99 */
100GetScriptName: PROCEDURE
101PARSE SOURCE Result
102RETURN WORD(Result, 3)
103
104
105/*
106 * Returns the current script path, without "\" at the end.
107 */
108GetScriptPath: PROCEDURE
109ScriptName = GetScriptName()
110RETURN SUBSTR(ScriptName, 1, LASTPOS("\", ScriptName)-1)
111
112
113/*
114 * Returns True if the given file exists.
115 */
116FileExists: PROCEDURE
117PARSE ARG FileName
118CALL SysFileTree FileName, Result
119RETURN Result.0 > 0
120
121
122/*
123 * Returns the current directory, without "\" at the end.
124 */
125GetCurrentDir: PROCEDURE
126RETURN DIRECTORY()
127
128
129/*
130 * Returns the parent directory of the directory passed as argument, without "\" at the end
131 */
132GetParentDirectory: PROCEDURE
133PARSE ARG DirName
134RETURN SUBSTR(DirName, 1, LASTPOS("\", DirName)-1)
Note: See TracBrowser for help on using the repository browser.