REXXweb.dll

Version 1.0 Build 51

05 May 2009

(c) 2000-2009 Igor Pool, igor@igor.co.nz

____________
DESCRIPTION:

  REXXWEB.DLL provides additional functions which greatly assist in writing OS/2
  REXX based cgi scripts. 

______________
PREREQUISITES:

  OS/2 Warp V4, eComStation 1.0 or higher with REXX.
  TCP/IP 4.0 or higher
  OS/2 or eCS HTTP server with support for REXX base CGI scripts.
  An Internet browser.
  Some knowledge of REXX for OS/2.

_____________
INSTALLATION:

  1. copy rexxweb.dll to a directory specified in your libpath statement in
     your config.sys
  2. load the functions in the DLL by creating a script with the following:

     call RxFuncAdd 'RexxwebLoadFuncs', 'REXXWEB', 'RexxwebLoadFuncs'
     call RexxwebLoadFuncs

  NOTE: Some of the sample scripts already have this included.

______________
DOCUMENTATION:

  Please refer to rexxweb.htm for function descriptions.

________
SAMPLES:

  To get the samples working change to REXX scripts so they point to your IP
  address if you have an IP address other that 127.0.0.1

  To use the example graph.cmd put the contents of \graph into an html directory
  accessible by your http server.

  Copy the REXX scripts from the sample\cgi directory to your cgi-bin directory.

  Start you HTTP server and access the samples by entering:

      http://127.0.0.1/cgi-bin/script.cmd

  where script.cmd is the name of the sample script you are trying to run.

  The REXX scripts from the sample\scripts directory should be run from the
  command line - THEY ARE NOT CGI SCRIPTS AND DO NOT REQUIRE A WEBSERVER!

________________
ERROR-REPORTING:

  Please send any bug reports or ideas for additional functions to:

  igor@igor.co.nz

  When sending bug reports please include information on how to reproduce the 
  bug/issue as well as the environment - browser used, http servers, mail server
  and TCP/IP level etc.

_______
CREDIT:

Many thanks to those who have contributed ideas, source code and programming
tips as well as the all important bug reports.

____________
LIMITATIONS:

  No character translation is performed.
  Testing has only occurred using the following software applications:

     REXX:
        - Only tested under Classic REXX however should work with Object REXX

     HTTP Servers:
        - web/2 (http://dink.org)
        - IBM HTTP Server 1.3.12 [Apache for OS/2]
        - Apache 2.0 for OS/2
        - Lotus Domino Go Web Server 4.6.2.8

     Mail Servers:
        - Weasel 1.x for OS/2
        - Mercury Mail Server 3.21c for Win32

     Browsers:
        - Netscape 4.61 for OS/2
        - IBM Web Browser 1.x for OS/2
        - Firefox 1.x/2.x/3.x for OS/2 and Windows
        - Netscape 4.72 for Windows 
        - Internet Explorer 5/5.5/6/7/8

_____________
KNOWN ISSUES:

  + Internet Explorer exhibits strange behaviour after receiving a document
    using returnByHTTP() function. This is a known IE issue.

________
VERSION:

  1.051 Fixed support for using REXXweb under Quercus Personal REXX 3.0.
  1.050 Added copyDirectory() function.
        Fixed internal memory leak in several REXX variable pool functions.
  1.049 Fixed getFieldData() validation for empty strings on non-mandatory
              fields.
  1.048 Expanded error messaged for getFormData() function.
  1.047 Fixed typo in getFieldData() error messages.
  1.046 Fixed getFieldData() function - greatly improved performance for large
              file uploads.
  1.045 Added gmtTimeStamp() function to generate a timestamp string for use
              with http cookies.
        Added httpCookie() function to generate cookie strings.
        Added prefix option to getFile() function to only populate variables
              prefixed with specified string.
        Added validation type option to getFieldData() function.
        Added label option to getFieldData() function.
  1.044 Rewrote significant parts of callRexx() function to improve performance
              and stability.
  1.043 Fixed CopyFile() function.
  1.042 Added CopyFile() function.
  1.041 Removed CRLF in between list items in BuildHTMLList() function.
        Added nested-list capability to BuildHTMLList() function.
  1.040 Rewrote HORIZONTAL type bar graphs in BuildHTMLGraph() function.
        **********************************************************************
  1.039 Dropped BuildHTMLGraph() function and renamed BuildHTMLCSSGraph() to
                BuildHTMLGraph().
        **********************************************************************
        Added VERTICAL type bar graph to BuildHTMLGraph() - accessed using 
              ORIENTATION option.
  1.038 Added user defined conditions to replaceString() function.
        Added additional file types to internal mimetype() function.
  1.037 Fixed sendSMTP() function to handle valid SMTP return code for RCPT-TO
              command of 251.
  1.036 Fixed error in callRexx() function where REXX ARG() function was passed
              an incorrect number of parameters (1 more than actually passed) 
              which could result in REXX.DLL crashing.
  1.035 Fixed ascii2html() function where LF converted to space instead of being
              discarded.
        Added exlusion option to ascii2html() function so CR are not converted
              to html paragraph tag.
  1.034 Added SENDSMTP_CHARSET variable to sendSMTP() function to permit user 
              defined charsets.
        Default charset is us_ascii.
  1.033 Fixed error in getFormData() when using Apache and form method="POST" 
              where form data returned is greater than 1024 bytes.
  1.032 Added createDirectory() and deleteDirectory() functions.
        Added OS2ENVIRONMENT option to getFormData() function.
        Added user defined variable marker to getTextFile() function.
  1.031 Added dateWithinRange() function to permit check if date falls within 
              specified range.
        Added charCount() function to count the occurences of a single character
              in a string.
  1.030 Temporary fix for getImageSize() function which returned invalid JPG 
              image sizes.
        Changed data validation of type 'T' to permit all ASCII values > 31 as 
              well as values 9 (TAB), 10(CR) and 13(LF) for better code page 
              support.
        Added parameter SHOW to getTextFile() function to not remove variable 
              markers if variable doesn't exist in REXX variable pool.
  1.029 Fixed replaceString() function for an infinite loop problem.
        Fixed error in CallRexx() functon when no parameters supplied.
        Fixed sendSMTP() function to better handle e-mail addresses supplied in
              parameters.
        Added TAB as valid character to data validation of type 'T'.
  1.028 Added CallRexx() function which can be used to call rexx files and pass
              multiple parameters and obtain return a value.
        Added T2D() function to convert time formats into the decimal equivalent.
        Added BuildHTMLCSSGraph() function with support for grouped data and
              cascading style sheet support.
  1.027 Fixed replaceString() function were StrIn contained a subset of StrOut.
  1.026 Fixed sendSMTP() function when connecting to ESMTP Exim 3.33 Server.
  1.025 Added RebootPC() function - uses undocumented OS/2 DOS call.
        Added ability to CC and BCC recipients in sendSMTP() function.
        Added getFile() function.
  1.024 Added ENDOFMONTH, STARTOFMONTH, LASTBUSINESSDAY keywords to DateAdjust().
  1.023 Fixed sendSMTP() function for single rexx variable attachments.
        Fixed sendSMTP() function for rexx variable attachments containing 
              non-ascii characters.
        Fixed BuildHTMLGraph() function - reported broken :-)
        Fixed BuildHTMLGraph() function to only insert hyperlink when a URL is
              specified.
        Fixed writetofile() function to handle empty path strings.
  1.022 Added D2M(), M2D() and D2T() month/time functions.
        Added BuildHTMLCSSCalendar() function with CSS support.
        Added support international formated phone numbers in getFieldData()
              and validate() function.
  1.021 Added support for date type fields in getFieldData() function.
        Added message read parameter to sendSMTP() function.
        Added stemstearch() function.
  1.020 Fixed SYS3175 in CapitaliseString() function when empty string involved.
        Added support for {} and [] for phone numbers in getFieldData() function.
  1.019 Added option parameter to DateWeekday() to return long or short name
              or day index with the week starting Monday.
        Added option to return rexx variable for returnByHTTP() function.
        Added DATELINKTARGET option to BuildHTMLCalendar() function.
  1.018 Added capitaliseString() function.
        Added stringCase() function.
        Added NTPDateTime() function.
        Added mime types to sendSMTP().
        Fixed sendSMTP() message date header to use timezone from config.sys.
        Fixed sendSMTP() message encoding to handle <period>.
        General clean up of DateAdjust() code.
        Corrected DateDifference() to return an empty string instead of 0 if
                  either date is in error.
        Corrected minor typos in rexxweb.htm documentation.
  1.017 Added getAllTextCollection() function.
        Added filename2 parameter to returnByHTTP() function.
  1.016 Added getAllTextStrings() function.
  1.015 Added (-) dash as valid character to data validation of type 'A'.
        Added ability to reference current system date by using 'Today'
              keyword in DateAdjust(), DateDifference() and DateWeekday()
  1.014 Added encoding parameter to sendSMTP() function to permit either no
              encoding or quoted-printable (default).
        Added returnByHTTP() function to allow files to be send by HTTP without
              exposing URL of file location.
        Fixed getFieldData() function to handle forms with an encoding type
              set to text/plain.
        **********************************************************************
        RENAMED getString, setString, getCollection, setCollection,
        getStringname and addString functions to avoid conflict with internal
        Virtual Pascal functions. This was an oversight on my part when 
        initially writing these functions.
        **********************************************************************
  1.013 Added getDirectoryUsage() function.
  1.012 Fixed sendSMTP() function when connecting to SMTP Servers which
        return a multiline response on initial connection. For now ALL 
        other SMTP responses must be single line.
  1.011 Added WIDTH, DAYFORMAT, BLANKDAYCOLOUR and BORDER to options list
        in BuildCalendar() function.
  1.010 Added color parameter to RECT command in BuildPDF() function.
        Added DIVISION command and Courier-Bold/Helvetica-Bold font support to
        LABEL command in BuildPDF() function.
        Added support for receiving values from multiple occurances of the
        same field name to getFormData() function.
        Added length parameter to Validate() function.
  1.009 Added getStringName() function.
  1.008 Added commands LINE, RECT, LABEL and NEWPAGE to BuildPDF function.
        Added optional rexxvar parameter to setString and addString functions.
        Added optional width and height parameters to getImageSize functions.
        Corrected file handling code for getString, setString, getCollection
        setCollection and addString functions.
  1.007 Fixed internal IsInteger() function broken in 1.006 which result in a
        number of functions returing erroneous results.
        Added setCollection function.
        Added getFieldNames function.
        Added optional rexxvar parameter to getFieldData function.
  1.006 Fixed sendSMTP() function to send e-mail addresses in accordance
        with rfc821.
        Fixed invalid header in getHTTPDocument when if-modified-since date
        not specified.
        Added support for GET and POST common gateway interface (CGI) methods
        to getHTTPDocument function.
  1.005 Fixed sendSMTP memory over-run which sometimes resulted in a return
        code rc = 6 for servers specified by name.
        Added POP3mail function.... may think of adding IMAP4 support later. 
        Added optional datelink parameter to BuildHTMLCalendar.
  1.004 Fixed SYS3175 for data validation types Number and Integer where data 
        contained only - (negative sign) and no digits.
        Corrected minor typos in rexxweb.htm documentation.
        Added IP address support to getHTTPDocument and sendSMTP.
  1.003 Added if-modified-since and browser type parameters to getHTTPDocument.
        Changed return codes for getHTTPDocument() to permit Document not
        returned.
        Fixed text wrapping error in BuildPDF which resulted in PDF document
        with corrupt pages.
  1.002 Added a format-specifier to all date functions.
        Changed DateVerify to return a return code.
        Corrected spelling errors in rexxweb.htm for buildCalendar function.
        Corrected sendSMTP HELO command which resulted in a return code rc = 5
        for a few mail servers.
  1.001 Corrected a page error in BuildPDF.
  0.99z Changes sendSMTP to allow rexx variables as file attachments.
  0.99y Added BuildPDF function.
  0.99x Added justification commands to getTextFile.
  0.99w Added file attachment facility to sendSMTP.
  0.99u Added functions getImageSize + minor bug fixes.
  0.99t Fixed bug in sendSMTP.
  0.99s Fixed memory leak in getFielddata + other minor bug fixes.
  0.99g Added functions sendSMTP, getHTTPdocument.
  0.98c Correct mis-spelt function BuildHTMLCalendar.
  0.98b Corrected getFieldData validation return code errors.
  0.98a First public release beta.

  0.01 - 0.98 So many fixes and improvements I never kept track of!!

________________________
DISTRIBUTION CONDITIONS:

  This package may be freely distributed providing the package is 
  distributed unchanged. In the case where distribution is on CD-ROM the 
  author is also sent a copy of the CD-ROM without charge.

___________
DISCLAIMER:

   *************************************************************************
   *                                                                       *
   *   THE PROGRAM IS PROVIDED "AS-IS".  NO WARRANTIES OF ANY KIND,        *
   *   EXPRESSED OR IMPLIED, ARE MADE AS TO IT OR ANY MEDIUM IT MAY BE ON. *
   *   WE WILL PROVIDE NO REMEDY FOR INDIRECT, CONSEQUENTIAL, PUNITIVE     *
   *   OR INCIDENTAL DAMAGES ARISING FROM IT, INCLUDING SUCH FROM          *
   *   NEGLIGENCE, STRICT LIABILITY, OR BREACH OF WARRANTY OR CONTRACT,    *
   *   EVEN AFTER NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.               *
   *                                                                       *
   *************************************************************************
