source: trunk/Distribution/Scripts/XFC.CMD@ 3

Last change on this file since 3 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.1 KB
Line 
1/*
2 *************************************************************************************
3 *
4 * DocBook Framework for OS/2 and eComStation
5 * Start XFC
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 XMLMind FO Converter 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/XFC.CMD $
23 *
24 *************************************************************************************
25 */
26
27OuterEnv = SetLocal()
28
29CALL RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
30CALL SysLoadFuncs
31
32ScriptDir = GetScriptPath()
33RootDir = GetParentDirectory(ScriptDir)
34XFCHome = RootDir || "\SW\XFC"
35
36JavaCommand = "java.exe"
37
38CALL SetEnvironment "XFC_HOME", XFCHome
39
40JavaCP = " -cp " || XFCHome || "\class;"
41JavaCP = JavaCP || XFCHome || "\xfc.jar;"
42JavaCP = JavaCP || XFCHome || "\lib\jaxp.jar;"
43JavaCP = JavaCP || XFCHome || "\lib\sax.jar;"
44JavaCP = JavaCP || XFCHome || "\lib\xp.jar"
45
46MainClass = " com.xmlmind.fo.converter.Driver"
47
48Arguments = ARG(1)
49
50FinalCommand = JavaCommand || JavaCP || MainClass || " " || Arguments
51
52/*
53 * Execute the final command
54 */
55FinalCommand
56
57CALL EndLocal
58EXIT
59
60
61/***********************************************************************************************/
62/* Procedures and functions */
63/***********************************************************************************************/
64
65
66/*
67 * Sets an environment variable or appends a value to it.
68 */
69AddEnvironment: PROCEDURE
70PARSE ARG VarName, VarValue
71IF (Value(VarName, , "OS2ENVIRONMENT")="")
72 THEN CALL SetEnvironment VarName, VarValue
73 ELSE CALL Value VarName, GetEnvironment(VarName) || ";" || VarValue, "OS2ENVIRONMENT"
74RETURN
75
76
77/*
78 * Sets an environment variable, overwriting its previous value.
79 */
80SetEnvironment: PROCEDURE
81PARSE ARG VarName, VarValue
82CALL Value VarName, VarValue, "OS2ENVIRONMENT"
83RETURN
84
85
86/*
87 * Returns the value of an environment variable.
88 */
89GetEnvironment: PROCEDURE
90PARSE ARG VarName
91RETURN Value(VarName, , "OS2ENVIRONMENT")
92
93
94/*
95 * Returns the current script name.
96 */
97GetScriptName: PROCEDURE
98PARSE SOURCE Result
99RETURN WORD(Result, 3)
100
101
102/*
103 * Returns the current script path, without "\" at the end.
104 */
105GetScriptPath: PROCEDURE
106ScriptName = GetScriptName()
107RETURN SUBSTR(ScriptName, 1, LASTPOS("\", ScriptName)-1)
108
109
110/*
111 * Returns True if the given file exists.
112 */
113FileExists: PROCEDURE
114PARSE ARG FileName
115CALL SysFileTree FileName, Result
116RETURN Result.0 > 0
117
118
119/*
120 * Returns the current directory, without "\" at the end.
121 */
122GetCurrentDir: PROCEDURE
123RETURN DIRECTORY()
124
125
126/*
127 * Returns the parent directory of the directory passed as argument, without "\" at the end
128 */
129GetParentDirectory: PROCEDURE
130PARSE ARG DirName
131RETURN SUBSTR(DirName, 1, LASTPOS("\", DirName)-1)
Note: See TracBrowser for help on using the repository browser.