logo - curve
analysis - design - implementation
Logo - left1 logo - left2 logo - middle Logo - right
index development profile products jcmjhp excel web contactinfo ball_left ball_left ball_left ball_left ball_leftball_left ball_left ball_left ball_left ball_right ball_right ball_right ball_right ball_rightball_right ball_right ball_right ball_right
frame frame frame
JADE Hypertext Preprocessor (JHP)

corner corner
corner corner

Download JHP
JHP consists of two halves. An webserver module (either an Apache module or an IIS extension), and a small Jade schema. Both are required for JHP to work.

The latest version can be downloaded from here:

Filename Description File size Link
mod_jhp.tar.gz JHP Apache module (for Linux) 13.24 KB Download mod_jhp.tar.gz
mod_jhp.zip JHP IIS extension (for Windows) 86.25 KB Download mod_jhp.zip
JHPSchema.zip JHP JADE schema 62.06 KB Download JHPSchema.zip

Install JHP on Linux (Apache module)
  • Copy the mod_jhp.so file into the /usr/lib/apache directory.
  • add the following to the /etc/httpd/conf/httpd.conf file:
  •     LoadModule mod_jhp
    
    (Note: add that command in the section of the file where the other LoadModule commands are)
        AddModule mod_jhp.c
    
    (Note: add that command in the section of the file where the other AddModule commands are)
  • add the following at the bottom of the /etc/httpd/conf/commonhttpd.conf file:
  •     <IfModule mod_jhp.c>
          AddHandler jhp-parsed .jhp
          JHPServerAddress 192.168.1.5
          JHPServerPort 7010
          JHPJadeTimeout 5000
          JHPAllowUndefinedVariables true
        </IfModule>
    
    Where:
    • JadeServerAddress is the IP Address of the Jade JHP server
    • JadeServerPort is the port number of the Jade JHP server (the default is 7010)
    • JHPJadeTimeout is the number of ms to try and connect to Jade for
    • JHPAllowUndefinedVariables set this to false if you want the http server to generate an error if Jade embedded code refers to a variable that doesn't exist. Best to leave this on true

    Note: Some Linux distributions organise the Apache confirguration files differently. The above is how it is in Mandrake 9.0 and 9.1
If you have php installed then you can make a .php file that just has:
  <?php phpInfo(); ?>
Display that page in a browser and it will tell you which apache modules are loaded. mod_jhp should be listed as an installed module. (Note that PHP is not required for JHP to work, the previous tip is simply an easy way to check that JHP is installed.)

Install JHP on Windows (ISAPI Extension for IIS)
  • Copy mod_jhp.dll into your scripts directory (often c:\inetpub\wwwroot\cgi-bin)
  • Edit jhp.reg and make the last 3 lines look like this:
      "jadeServerAddress"="192.168.1.5"
      "jadeServerPort"="7010"
      "jadeTimeout"="16000"
  • Where:
    • jadeServerAddress is the IP Address of the Jade JHP server
    • jadeServerPort is the port number of the Jade JHP server (the default is 7010)
    • jHPJadeTimeout is the number of ms to try and connect to Jade for
  • Import the jhp.reg file into the registry (double clicking on the file should suffice)
  • Click on the "Home directory" tab of the IIS configuration dialog. Click on the configuration button. You will see a screen similar to this:

    IIS Admin dialog

    The purpose of this configuration dialog is to associate .jhp files with the mod_jhp.dll ISAPI extension. This is done by clicking on the "Add" button of the above form. Once that has been accomplished all .jhp files will be passed through the JHP extension.


Install JHP (Jade schema)
  • Import the JHPSchema.scm and JHPSchema.ddb files as a subschema of the schema you want to expose. You will need to click on the "Advanced" button in the schema load form and specify Subschema of as the schema you wish to expose using JHP. Specify Target schema as "JHPSchema".

    Note: Because of a limitation in Jade, when you import JHPSchema it will complain that 3 of the classes in the schema file could not be found. If (for example) the schema yo are importing JHPSchema under is called ABCSchema then make sure the JHPSchema class is subclassed underneath ABCSchema, GJHPSchema is a subsclass of GABCSchema and SJHPSchema is a subclass of SABCSchema. This can be done by editing the .scm file during the schema load process.

  • Run the JHPSchema::JHPAdmin application. It will prompt asking for registration information, if you would like to evaluate it as a demonstration copy then click on the Run Unregistered> button, otherwise enter the supplied registration code.

  • The JHP administration form looks like this:

    JHP Admin form

    • Port number: This is the port number the JHP server runs on. This must be the same as that specified in the commonhttpd.conf file (See Install JHP (Apache module) section above.
    • Enable debugging: When this is checked it will write to the interpreter output window on each request to the JHP server. Useful for debugging and testing.
    • Output Code: When this is checked the code that is executed by Jade (that is send by the Apache module) is also output to the interpreter output window. Also useful to debugging and testing.
    • Number of worker threads: This is the number of worker threads Jade will use to process JHP requests from the Apache web server. The default value is 10.
    • Start more threads...: The JHP server will start more worker threads when the number of available threads is equal to (or lower than) the number specified here. Defaults to 2.
    • ...and start this many more: When more worker threads are started, this setting determines how many more will be started. Defaults to 2.
    • ...but no more than this many: This determines the maximum number of worker threads that are started.
    • Initialise method: Each time a worker is started this method will be executed. If you would like each worker thread to be initialised (e.g by setting up reference to root objects etc.) then enter the name of the initialise method here. This method must exist on the app class.
    • Show detailed exception information: When this setting is checked and an exception occurs, you will be able to click on the exception and more detailed exception information will be displayed. Note: Only use this for debugging and testing, leaving this setting on will allow users of your site to see the Jade code that gets executed.
    • Exception page: This contains the name of the web page that displays exception information.

    • You can stop the JHP server by clicking on the Stop JHP Server button.

  • Start the JHP server by running the JHPSchema::JHPServer application.

Testing JHP
Here is a very simple way to test that JHP has been installed correctly and is working as expected:
In your DocumentRoot directory (e.g. /home/apache/html) make a file called "test.jhp". In that file put this:
<html></body>
<B>Test JHP page</B><BR>

<?jhp
  vars
    time: TimeStamp;
  begin
    echo("The current time is " & time.String & ".");
  end;
?>

</body></html>
Display that page in your web browser and hopefully it will have executed the Jade code and displayed what the current date and time.

For more information
Please refer to the JHP manual for more details on using JHP.
frame frame frame
contact us

Web site designed and developed by Silvermoon Software.