vit$oft freeware home page

JAM2HTM convertor

What is it good for

The utility JAM2HTM converts messagebase from JAM format to HTML pages. You may want to use it if you run a Fidonet node and a Web site simultaneously, or if you like to read Fidonet messages using your Internet browser.

How to give it a quick try

  1. Create default templates INDEX.HTX and SUBJECT.HTX using JAM2HTM /G.
  2. Copy a JAM board from your messagebase (for instance the files GOLDED.JDT and GOLDED.JHR) to the current directory.
  3. Convert the board using command such as JAM2HTM GOLDED GoldEd Message editor. The 1st parameter (GOLDED) is full-path name of the board (withouth file extension) and the rest of the command line is optional board description.
  4. View the converted file INDEX.HTM with an HTML viewer and browse the messages for a while to get acquainted with the product.
  5. Use an HTML editor to trim the HTX templates if you are not satisfied with the default design.
  6. In case you decide to employ this utility regulary to bring some Fido conferences to the users of your Internet/Intranet site, create a batch file (use JAM2HTM.BAT as an inspiration) and schedule it to be submited each night or whenever a new Fido mail arrives.

What are the system requirements

JAM2HTM is an unattended DOS utility which may be run in pure DOS, OS/2 or Windows. Minimal requirements are CPU 386 or better and 320KB of memory.

Which files does it work with

JAM messagebase consists of four files per board. Only two of them are important for JAM2HTM: Board.JHR and Board.JDT. The JAM2HTM convertor reads msgbase in shareable mode and never changes the messagebase files.

Fido board (conference) may contain lots of messages concerning various subjects. Separate files SUBJ000.HTM, SUBJ001.HTM etc. are created for each subject which occured in the board. When all SUBJxxx pages have been generated, names of used subject are alphabetically sorted and INDEX.HTM is created. The index page contains sorted list of subjects linked with corresponding SUBJxxx.HTM files.
Messagebase filename may have fully qualified path. Names of template files are hard-coded and they are expected in the current directory. Output pages are always created in the current directory.

   JAM messagebase           convertor           target HTML pages
   +-----------+        +-----------------+       +-------------+
   | board.JHR |------->|                 |------>|  INDEX.HTM  |
   +-----------+        |                 |       +-------------+
   +-----------+        |                 |       +-------------+
   | board.JDT |------->|                 |------>| SUBJ001.HTM |
   +-----------+        |                 |       +-------------+
                        |JAM2HTM.COM board|       +-------------+
    templates           |                 |------>| SUBJ002.HTM |
  +-------------+       |                 |       +-------------+
  |  INDEX.HTX  |------>|                 |       +-------------+
  +-------------+       |                 |------>| SUBJ003.HTM |
  +-------------+       |                 |       +-------------+
  | SUBJECT.HTX |------>|                 |              .
  +-------------+       +-----------------+              .

How to put it on the Web

Create WWW page (e.g.FIDO.HTM) with list of available boards, their descriptions and links to corresponding INDEX.HTM files. Make separate directory for each board on your WWW server. Run JAM2HTM for each conference and move converted pages to their appropriate folders.
In most cases the directory tree will look like this:
      /HOME.HTM                             your homepage
      |
      |
      +------/FIDO/
      |        |   FIDO.HTM                 list of boards
      |        |
      |        +---/FIDO/GOLDED/
      |        |               INDEX.HTM
      |        |               SUBJ000.HTM
      |        |               SUBJ001.HTM
      |        |               SUBJ002.HTM
      |        |
      |        +---/FIDO/NOVELL/
      |        |               INDEX.HTM
      |        |               SUBJ000.HTM
      |        |               SUBJ001.HTM

How to make HTX templates

Templates are ordinary HTML text files with some additional tags surrounded in percent signs such as <%SenderName%>. These variables are replaced with their values during the conversion. The complete list of %variables% is presented below. Default template files INDEX.HTX and SUBJECT.HTX can be created using the command JAM2HTM /G.

What is the structure of HTX template

HTX file contains two special delimiters: <%BeginDetail%> and <%EndDetail%>. The division between these tags is called Detail and is repeated as many times as there are messages to be processed. Prolog and Epilog divisions are copied to output HTML page only once.
      template.HTX                   division
   +-----------------------+
   | <HTML>                |
   |  .                    |          Prolog
   |  .                    |
   | <%BeginDetail%>       |
   +-----------------------+
   |  .                    |          Detail
   |  .                    |
   +-----------------------+
   | <%EndDetail%>         |
   |  .                    |          Epilog
   |  .                    |
   | </HTML>               |
   +-----------------------+

Which Variables are supported in templates

Variable nameINDEXSUBJECTExampleDescription
PrologDetailEpilogPrologDetailEpilog
<%BeginDetail%> ®  ®   Delimiter
<%EndDetail%>   ®  ® Delimiter
<%Today%> ®®®®®®31.12.1999 23:59Time of conversion
<%BoardName%> ®®®®®®GOLDEDFilename (1st parameter)
<%BoardTitle%> ®®®®®®GoldEd message editorBoard description (2nd parameter)
<%BoardTotal%> ®®®  ®1234Total number of messages in all subjects
<%Subject%>  ® ®®®Brand New AccessSubject of message(s)
<%SenderName%>     ® Pavel SrubarWho wrote this msg
<%ReceiverName%>    ® Odinn SorensenRecipient of this msg
<%DateWritten%>     ® 31.05.1998 18:20When was the msg written
<%MessageNr%>     ® 0001E053Identificator of this msg
<%Reply1st%>     ® 0000B805Identificator of 1st reply to this msg
<%ReplyNext%>     ® 00008A6CIdentificator of next reply in chain
<%ReplyTo%>     ® 00000201Identificator of previous question
<%MessageText%>     ® Hi!The message body
<%SubjectCnt%>  ®  (®)®5Number of msgs concering this subject
<%SubjectNr%>  ® ®®®000Subj Nr (part of filename SUBJxxx.HTM)
<%SubjectNext%>  ®   ®015Subj Nr of next subject in sorted list
<%SubjectPrev%>  ®   ®099Subj Nr of previous subject

Variables may occur anywhere in the template tables, however their values are defined only in divisions marked with ®. Variable names are case insensitive.

How is the message body processed

Variable <%MessageText%> should only occur in the Detail division of SUBJECT.HTX file. It is replaced with actual text of the message processed. Some lines in the message body may have special meaning: Some CSS style may be used in the Prolog division to change the default appearance of these idioms.
Carriage returns are replaced with <BR>, other control characters are omitted.
Spaces in the beginning of line are replaced with non-breakable spaces.

Some simple formatting methods are inherited from Fidonet message styles. Words surrounded with special formating characters * / _ # are presented in different styles:

How can the size of WWW pages be limited

JAM2HTM converts all messages in JAM messagebase which do not have any of the following flags set: DELETED PRIVATE COMPRESS ENCRYPT NODISP.
The only limitation is free disk space. However, only the first 999 subjects per conference are processed.
If you wish to restrict the size of target WWW pages, please run some messagebase maintenance tool before conversion. This is also important for updating reply chains, i.e. the links between <%MessageNr%> and <%ReplyTo%>.
Using the build-in hypertext navigation you will be able to browse the thread of messages in the same sequence as they interacted with each other.

How to automatize the conversion

Here is an example of batch file JAM2HTM.BAT which will convert three Fido boards from JAM messagebase on network server called FidoServer to WWW pages on internet server called WebServer:
 @ECHO OFF
 CD /d  C:\JAM2HTM
 REM  Files SUBJECT.HTX, INDEX.HTX, JAM2HTM.COM, JAM2HTM.BAT are expected here
 IF NOT "%1"=="" GOTO :OneBoard
:AllBoards
 REM When JAM2HTM.BAT is run without parameter, it calls itself
 REM  recursively once per each conference
 CALL JAM2HTM.BAT GOLDED Gold Editor International
 CALL JAM2HTM.BAT NOVELL Novell Netware World Wide Echo
 CALL JAM2HTM.BAT MUSIC  All about Music
 GOTO :End
:OneBoard  called with %1=BoardName   %2=Board title
 DEL *.HTM
 COPY \\FidoServer\FIDO\MSGBASE\%1.JHR
 COPY \\FidoServer\FIDO\MSGBASE\%1.JDT
 JAM2HTM.COM %1 %2 %3 %4 %5 %6 %7 %8 %9
 DEL %1.JHR
 DEL %1.JDT
 IF NOT EXIST \\WebServer\WWW\FIDO\%1\INDEX.HTM  MD \\WebServer\WWW\FIDO\%1
 DEL \\WebServer\WWW\FIDO\%1\*.HTM
 MOVE *.HTM \\WebServer\WWW\FIDO\%1
:End

How to register this software

JAM2HTM convertor is freeware and does not have to be registerred. Nevertheless, I would appreciate if you mail me your comments, bug reports or an URL of your site where this product is running. Mailto
Pavel.Srubar@post.cz or Fidonet 2:421/71

History

vit$oft freeware home page