
| Setting up the LAN Server | An Example Setup |
Conclusions |
This article describes how to run a COMAL script from a LAN server on a client computer on the network. The client computer doesn't need UniCOMAL, so long as the UniCOMAL interpreter, COMAL.EXE, is available on the server. The client computer doesn't need JAVA either, so long as a copy of the Java Runtime Environment is stored on the server. If you haven't already done so, you should read the first article on WebCOMAL, webcomal.html to get an idea of how WebCOMAL works.
There are two ways to run WebCOMAL remotely. Firstly, Method 1, you can run the Servlet on the Server PC, and point the browser (running in the Client) at the Servlet on the server. This means that all data to and from the client PC will be passed along the network to the Java Servlet on the Server PC, and from there to the COMAL Interpreter. Or, secondly, Method 2 you can run the Servlet locally, on the client PC, in which case data is passed to and from the browser to the local servlet, and from there along the network to the COMAL interpreter running in the Server PC. This method has the advantage, for the developer, that error messages displayed in the servlet window are visible on the client PC. The two different methods look like this:
In use, calls to the Servlet are very similar in each of the two methods. For method 1, the Servlet is invoked using an address like this:
<A HREF="http://Cyrix300:8080/servlet/comal.ComalServlet........
where "Cyrix300" is the network name of the server PC. For Method 2, the address is:
<A HREF="http://localhost:8080/servlet/comal.ComalServlet.......
Apart from that simple difference in the calling address, everything else is exactly the same in each method. For classroom use, Method 2 seems better because students can get error-related information at their workstations.
The following notes assume a MicroSoft (TM) Windows Network. The examples given were worked through on a mixed Win98 / Win95 network using share-level access control with NetBEUI as the default protocol. The TCP/IP protocol must be enabled, but it needn't be the default protocol.
The server can be any computer on the network. It should have the following software stored in a shared read-only folder visible to the other computers on the network:
You can find details on how to get hold of these components in the first WebCOMAL article.
We tested remote operation of WebCOMAL on a small LAN at MacharSoft HQ, using Method 2 above. We used a PC with a Cyrix 300 processor as our host server, and a Toshiba P100 laptop as the client station. We placed the software components in a shared read-only folder on Cyrix300 called "wcr" for "WebComalRemote". Here is the folder tree for "wcr": The whole "wcr" folder takes up about 21 Mbytes, of which nearly all is made up of the JRE folder. It's important to be able to specify exact paths to the various software components, so that the Servlets can be found by the remote client's browser.
The file "remstart.bat" sets up these paths and launches the ServletServer on the client PC. Here is the text of the file we used:
Notice particularly the use of the LAN path, \\cyrix300\wcr\jre, to the JRE folder on the host computer.
The 'remstart.bat' batch file can be called from an HTML file, which can launch the Servlet and then proceed to launch a COMAL Weblet. The HTML file we used to do this is called WebStart.html. We navigated to it from MS-IE 5 running on the Toshiba Laptop, then clicked a link to launch the JAVA Servlet, then finally clicked another link to launch the Color Triangle example COMAL weblet. It all worked most satisfactorily. Please be aware, however, that "WebStart.html" and "remstart.bat" are included here only as examples - they will only work on the MacharSoft test system. You should, however, be able to use them as a guide to setting up your own server/client system.
WebCOMAL runs well from a LAN host, and can be launched remotely from a client PC which does not need either UniCOMAL or JAVA to be installed on it. Care needs to be taken in setting up the paths, but once that is done, the entire LAN can use WebCOMAL scripts (Weblets) very easily by calling them from the server.
The next stage is to see if it is possible to export the system to the World Wide Web from an Internet Service Provider. We will have to either convince an ISP to let us run the ComalServlet on their hardware; or set MacharSoft up as an ISP; or find some way to set up DOS path names to a JRE which is held on an http site. It might be necessary for remote stations to have a JRE locally-installed. We are considering this at the moment.It would be nice to be the world's first COMAL-scripting ISP!
We should be very glad to get feedback from users who have implemented WebCOMAL on their own systems, and will be delighted to publish sample WebCOMAL weblets - how about a Wordsearch Weblet to begin with?
An Example Setup
wcr
| cml
| | colortri.cml
| | comal.exe
| | internet.mod
| | sample.cml
| | samplet.cml
| | samremot.cml
| | system.exe
| jre
| | bin
| | | - the Java Runtime Environment Files
| | java
| | | classes
| | | | com
| | | | - various JRE components
| | | | comal
| | | | ComalServlet.class
| | | | ComalServletException.class
| | | | ReadBufferThread.class
| | | | ServletServer.class
| | | | lib
| | | jsdk.jar
| | lib
| | | - the JRE library
remstart.bat
WebStart.html
@echo
echo starting servlet server
rem # clear environment
set PATH=
set CLASSPATH=
rem # Set the complete path to a Java Runtime Environment
rem # This should be the location of .\bin\java.exe...
rem # NOTE: omit trailing '\'!!!!
SET JRE=\\cyrix300\wcr\jre
SET LIB=%JRE%\lib
SET CLASSPATH=%JRE%\java\classes;%JRE%\java\lib\jsdk.jar;
%LIB%\rt.jar;%LIB%\jaws.jar;%LIB%\i18n.jar
REM Run the ServletServer
%JRE%\bin\java.exe -cp %CLASSPATH% comal.ServletServer
-d %JRE%\java\classes -p 8080
Conclusions
Updated 6 May 2000