home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / fxclsv01.zip / FXCLASS.TXT < prev    next >
Text File  |  1997-04-15  |  7KB  |  216 lines

  1. FxClassObject v.01 (Alpha)
  2.  
  3.  
  4. This is my first effort at writing in Object REXX.  (Inside my Class
  5. and Method definitions there is still too much TREXX procedural
  6. programming and my next step is to redo it.)
  7.  
  8. What I have tried to do is to model a real world Fax Department in
  9. software.  There are three classes defined:
  10.  
  11. A .FxMachine -- This accepts FaxJobs and performs Methods on them. 
  12. The methods are from the FaxWorks Pro API and some others. It returns
  13. the information to both the FaxJob and to the calling object.
  14.  
  15. A .FxOperator -- The Fax operator takes jobs from the user (through 
  16. the 'submit' method) and processes it. It determines what job is to 
  17. be done and checks to make sure that all the necessary information 
  18. has been submitted. It also checks to make sure that any submitted 
  19. data files really exist. It then creates a FaxJob from the .FxJob 
  20. class  and sends it to the FaxMachine.
  21.  
  22. A .FxJob -- I was playing around with this one. The FxJob is 
  23. basically a collection class, like an array but with a string and not
  24. numeric index. But I actually made it a 'directory' class. This array
  25. type class has another feature: you can specify a method to be run if
  26. an item does not really exist in the array. So I had this idea of
  27. doing file type conversions right in the FaxJob itself. If you submit
  28. a TIFF file, for example, when the FaxMachine asks for the Fax file
  29. name, the FaxJob first creates a Faxfile and then passes the name to
  30. the FaxMachine. If you submit a PCL or PostScript name, it creates a
  31. TIFF file and then processes it further to create a fax file.
  32.  
  33. At the moment, the user is expected to just deal with the operator.
  34.  
  35. The only method the operator understands is SUBMIT.  So you create
  36. programs using the FxClass by writing
  37.  
  38. FaxOperator = .FxOperator~new ResultCode =
  39. FaxOperator~Submit(SomeCommand SomeArguments) SAY ResultCode
  40.  
  41. The Commands and Arguments are separated by a space.  Arguments are
  42. separated by a semicolon.
  43.  
  44. SEND or QUEUE -------------
  45.  
  46. filename;TO=name,company,fax#;From=name,company,voice,fax;
  47. INFO=comment,heading,note,bitmap,size,coversheet;AT=time,date
  48.  
  49. Filename and TO are required.  Others are optional.  (The program
  50. will use any Faxworks defaults for parameters not specified.  Only
  51. the Fax# is required.  But you must use the commas even if you do not
  52. specify the name or company.
  53.  
  54. The filename can be a TIF, PCL or DCX file.  If you put an index
  55. number with INDEX as the extension (1243.INDEX), The program will
  56. strip off the extension and process the job using the old fax file
  57. with that index.
  58.  
  59. d:\faxworks\test.pcl;TO=,,1 603 253 4730 1243.INDEX;TO=,,1 603 253
  60. 4730
  61.  
  62. See the FaxWorks Pro docs for complete descriptions of the values.
  63. Order IS important to FxClass.  If you want to include INFO but not
  64. FROM, use a null entry -- TO,,1 603 253 4730;;INFO=....
  65.  
  66. The return string is the job TAG number.  It is used by commands.
  67.  
  68. IMPORT ------
  69.  
  70. filename
  71.  
  72. Imports a job into FaxWorks.  Under the right conditions, DCX, PCL,
  73. PS and TIF formats will work if they have these extensions.
  74.  
  75. Returns Tag and Index of the new fax job
  76.  
  77. STATUS ------
  78.  
  79. Tag
  80.  
  81. Returns the status and whether or not it is Final.
  82.  
  83. COPY or EXPORT -------------- source#;targetfilename
  84.  
  85. Source is a TAG number or -Index number (the index is proceeded by a
  86. minus).
  87.  
  88. Exports or copies the source to the specified filename.
  89.  
  90. Returns OK or NOTOK
  91.  
  92. PRINT ----- source;target
  93.  
  94. Prints the existing fax to a printer.
  95.  
  96. Source is the index number of the fax to print.  Target is optional.
  97. If not specified, it prints to the default printer for FaxWorks.  Or
  98. you enter the print queue to print to.
  99.  
  100. TEXTTOFAX ---------
  101.  
  102. testfilename;faxfilename
  103.  
  104. Creates fax using the FxPrinter object.
  105.  
  106. DELETE ------ filename
  107.  
  108. Deletes the log entry.
  109.  
  110. REPORT ------ Index
  111.  
  112. Displays the 'activity.rpt' entry for the index number.
  113.  
  114. There are some intermediate methods that I will not document at this
  115. time.  A couple that might be interesting, though:
  116.  
  117. CONVERT ------- sourcefile;targetfile;sourcetype;targettype
  118.  
  119. File Types are:  TIF,PCL or DCX
  120.  
  121. If the target extension is different from the specified type, the
  122. program will use your extension in the name but the type in the
  123. processing.
  124.  
  125. You must have the PCL Enhanced version of FaxWorks Pro for this to
  126. work.  The drivers for this must be in the subdirectory LASERFAX
  127. under your FaxWorks directory.  This is where Faxworks puts it.  All
  128. routines that rely on this internal routine require that you have the
  129. PCL enhancement.  (It is well worth the money in any case!)
  130.  
  131. CONVERTPS --------- source;target;GS_String
  132.  
  133. Source is a postscript file with PS extension.  Target is the target
  134. file name.  GS_String is the string you want to use for the
  135. conversion.  You must have GSOS2 in your PATH and properly set up.
  136. The following command line parameters are hard coded in:
  137.  
  138. -q -dNOPAUSE -sOutputFile='target' 'source' -c quit
  139.  
  140. Target and Source are, of course variables set by the program based
  141. on your input.
  142.  
  143. I have included several little applications that rely on the FxClass.
  144.  
  145. FxShell.  Allows interactive, command line manipulation.  Enter the
  146. command and the Arguments.  It is intended to run as the shell for
  147. telnetd or to me run from CMD.  One can then manipulate the Faxworks
  148. on a server over the internet.
  149.  
  150. FxImport, FxSend, FxStatus all send the necessary command to the Fax
  151. Operator, You need only supply the Arguments.
  152.  
  153. GSImport uses the included program, 'printmon.exe', to allow direct
  154. PS printing to Faxworks.
  155.  
  156. I found printmon on the internet and use it myself.  I hope the
  157. author does not mind my inclusion of it.  I do not have the
  158. documentation any longer.  But I can tell you this:
  159.  
  160. Install a PS driver to an unused printer port, let's say LPT2.  Run
  161. PRINTMON as follows;
  162.  
  163. printmon lpt2 "GSImport.cmd"
  164.  
  165. You must change GSImport.cmd to reflect the proper information for
  166. your installation.  The 'filename' you enter is a dummy name.  The
  167. extension 'PSPIPE' must reads exactly like this!  It is never used as
  168. a real file name, so HPFS is not required.  The rest of the path and
  169. file name is used to create a temporary file during processing.
  170.  
  171. In theory, printing ps to lpt2 will now automatically add a fax job
  172. to your log as an EDIT job.
  173.  
  174. REQUIREMENTS
  175.  
  176. Object REXX must be set up on your system.  RexxUtils is also used.
  177.  
  178. You must have a full retail version of Faxworks Pro with the PCL
  179. option.
  180.  
  181. You must have Ghostscript for OS2 set up.  The executive must be
  182. GSOS2.exe in your PATH.
  183.  
  184. INSTALLATION
  185.  
  186. The file FxMObj.cls contains the class and method definitions.  It
  187. must be installed by that name in a directory in your path.  I use
  188. C:\OS2\SYSTEM.
  189.  
  190. Put the other programs wherever you want.
  191.  
  192. You must have the PCL enhanced FaxWorks version with a LASERFAX
  193. subdirectory.  And you must install Ghostscript for OS/2.  The
  194. executive GSOS2.EXE must be in your path.
  195.  
  196. WARNING AND NOTICE!
  197.  
  198. This is an alpha version!  I make no guarantees as to its suitability
  199. for any purpose.  I present it only for evaluation and comment.  I
  200. will not be responsible for damage that might result from its use.  I
  201. am such a novice at all this that I compiled the class file with
  202. REXXC rather than expose myself to ridicule.
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.