source: trunk/Distribution/Scripts/DB2EclipseHelp.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.2 KB
Line 
1/*
2 *************************************************************************************
3 *
4 * DocBook Framework for OS/2 and eComStation
5 * Convert DocBook to Eclipse Help
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 converts a DocBook document into a set of HTML and XML files that can be
16 * directly used by the Eclipse IDE.
17 *
18 *************************************************************************************
19 *
20 * $Author: jkacer $
21 * $Revision: 2 $
22 * $Date: 2007-09-05 20:07:46 +0000 (Wed, 05 Sep 2007) $
23 * $HeadURL: trunk/Distribution/Scripts/DB2EclipseHelp.CMD $
24 *
25 *************************************************************************************
26 */
27
28OuterEnv = SetLocal()
29
30CALL RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
31CALL SysLoadFuncs
32
33ScriptDir = GetScriptPath()
34RootDir = GetParentDirectory(ScriptDir)
35
36Arguments = ARG(1)
37
38IF WORDS(Arguments) = 2
39 THEN DO
40 InputFile = WORD(Arguments, 1)
41 PluginID = WORD(Arguments, 2)
42 CALL Saxon InputFile || " " || RootDir || "\XSL\eclipse\eclipse.xsl eclipse.plugin.id=" || PluginID
43 END
44 ELSE DO
45 CALL PrintUsage
46 END
47
48CALL EndLocal
49EXIT
50
51
52/***********************************************************************************************/
53/* Procedures and functions */
54/***********************************************************************************************/
55
56
57/*
58 * Sets an environment variable or appends a value to it.
59 */
60AddEnvironment: PROCEDURE
61PARSE ARG VarName, VarValue
62IF (Value(VarName, , "OS2ENVIRONMENT")="")
63 THEN CALL SetEnvironment VarName, VarValue
64 ELSE CALL Value VarName, GetEnvironment(VarName) || ";" || VarValue, "OS2ENVIRONMENT"
65RETURN
66
67
68/*
69 * Sets an environment variable, overwriting its previous value.
70 */
71SetEnvironment: PROCEDURE
72PARSE ARG VarName, VarValue
73CALL Value VarName, VarValue, "OS2ENVIRONMENT"
74RETURN
75
76
77/*
78 * Returns the value of an environment variable.
79 */
80GetEnvironment: PROCEDURE
81PARSE ARG VarName
82RETURN Value(VarName, , "OS2ENVIRONMENT")
83
84
85/*
86 * Returns the current script name.
87 */
88GetScriptName: PROCEDURE
89PARSE SOURCE Result
90RETURN WORD(Result, 3)
91
92
93/*
94 * Returns the current script path, without "\" at the end.
95 */
96GetScriptPath: PROCEDURE
97ScriptName = GetScriptName()
98RETURN SUBSTR(ScriptName, 1, LASTPOS("\", ScriptName)-1)
99
100
101/*
102 * Returns True if the given file exists.
103 */
104FileExists: PROCEDURE
105PARSE ARG FileName
106CALL SysFileTree FileName, Result
107RETURN Result.0 > 0
108
109
110/*
111 * Returns the current directory, without "\" at the end.
112 */
113GetCurrentDir: PROCEDURE
114RETURN DIRECTORY()
115
116
117/*
118 * Returns the parent directory of the directory passed as argument, without "\" at the end.
119 */
120GetParentDirectory: PROCEDURE
121PARSE ARG DirName
122RETURN SUBSTR(DirName, 1, LASTPOS("\", DirName)-1)
123
124
125/*
126 * Prints out a short help on how to call this script.
127 */
128PrintUsage: PROCEDURE
129SAY "DocBook Framework for OS/2, DocBook --> Eclipse Help"
130SAY "Usage: DB2EclipseHelp <DocBook Source> <Eclipse Plugin ID>"
131RETURN
132
Note: See TracBrowser for help on using the repository browser.