source: trunk/Distribution/Scripts/FO2Printer.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: 2.9 KB
Line 
1/*
2 *************************************************************************************
3 *
4 * DocBook Framework for OS/2 and eComStation
5 * Sends Formatting Objects to printer
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 sends a FO file to the printer.
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/FO2Printer.CMD $
23 *
24 *************************************************************************************
25 */
26
27OuterEnv = SetLocal()
28
29CALL RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
30CALL SysLoadFuncs
31
32Arguments = ARG(1)
33
34IF WORDS(Arguments) = 1
35 THEN DO
36 InputFile = WORD(Arguments, 1)
37 CALL FOP "-fo " || InputFile || " -print"
38 END
39 ELSE DO
40 CALL PrintUsage
41 END
42
43CALL EndLocal
44EXIT
45
46
47/***********************************************************************************************/
48/* Procedures and functions */
49/***********************************************************************************************/
50
51
52/*
53 * Sets an environment variable or appends a value to it.
54 */
55AddEnvironment: PROCEDURE
56PARSE ARG VarName, VarValue
57IF (Value(VarName, , "OS2ENVIRONMENT")="")
58 THEN CALL SetEnvironment VarName, VarValue
59 ELSE CALL Value VarName, GetEnvironment(VarName) || ";" || VarValue, "OS2ENVIRONMENT"
60RETURN
61
62
63/*
64 * Sets an environment variable, overwriting its previous value.
65 */
66SetEnvironment: PROCEDURE
67PARSE ARG VarName, VarValue
68CALL Value VarName, VarValue, "OS2ENVIRONMENT"
69RETURN
70
71
72/*
73 * Returns the value of an environment variable.
74 */
75GetEnvironment: PROCEDURE
76PARSE ARG VarName
77RETURN Value(VarName, , "OS2ENVIRONMENT")
78
79
80/*
81 * Returns the current script name.
82 */
83GetScriptName: PROCEDURE
84PARSE SOURCE Result
85RETURN WORD(Result, 3)
86
87
88/*
89 * Returns the current script path, without "\" at the end.
90 */
91GetScriptPath: PROCEDURE
92ScriptName = GetScriptName()
93RETURN SUBSTR(ScriptName, 1, LASTPOS("\", ScriptName)-1)
94
95
96/*
97 * Returns True if the given file exists.
98 */
99FileExists: PROCEDURE
100PARSE ARG FileName
101CALL SysFileTree FileName, Result
102RETURN Result.0 > 0
103
104
105/*
106 * Returns the current directory, without "\" at the end.
107 */
108GetCurrentDir: PROCEDURE
109RETURN DIRECTORY()
110
111
112/*
113 * Returns the parent directory of the directory passed as argument, without "\" at the end.
114 */
115GetParentDirectory: PROCEDURE
116PARSE ARG DirName
117RETURN SUBSTR(DirName, 1, LASTPOS("\", DirName)-1)
118
119
120/*
121 * Prints out a short help on how to call this script.
122 */
123PrintUsage: PROCEDURE
124SAY "DocBook Framework for OS/2, Prints Formatting Objects directly on a printer"
125SAY "Usage: FO2Printer <Formatting Objects>"
126RETURN
127
Note: See TracBrowser for help on using the repository browser.