[Prev] [Next] [Top] [Bottom] [Contents] (3 out of 4)

vi Quick Reference Table

Table 3-1 vi Keyboard Command and Reference

If your editor does not come up, the most likely problem is that Sapphire/Web cannot locate it. From the command line (in an xterm), edit $SAPPHIRE/bin/saedithtml.sh by invoking your editor. For example:

% vi $SAPPHIRE/bin/saedithtml.sh
At the beginning of saedithtml.sh, there is an environment variable called EDITOR. Please change that to reflect your preferred HTML editor. Example -- if want to use /usr/local/bin/emacs, change the line from:

EDITOR="xterm -e vi"
to:

EDITOR="/usr/local/bin/emacs"

sabrowser.sh

If you have not already done so, please start Sapphire/Web following the steps in the saweb.sh section. To make sure your web browser is configured, please do the following:

Step 1. From the Document Manager, highlight test.html. Then click the Preview Html button.

Figure 3-2 Document Managers Icon

Step 2. At this point, your web browser should appear, with the test.html file displayed¯ skip to the samake.sh section.
If your browser does not appear, the most likely problem is that Sapphire/Web cannot locate it.
From the command line (in an xterm), please edit $SAPPHIRE/bin/sabrowser.sh
% vi $SAPPHIRE/bin/sabrowser.sh
Step 3. At the beginning of /saedithtml.sh/, there is an environment variable called BROWSER. Please change that to reflect the full path for your preferred web browser. Example -- if Netscape is not in your path, but is in /pkg/ns-2.0, change the line from:
BROWSER=netscape
to:

BROWSER=/pkg/ns-2.0/netscape

samake.sh

Now that the web browser and editor are properly configured, the next step is to make sure the code generation tools are set up correctly. The best way to do this is to actually make a very simple project with Sapphire/Web. Here's what to do:

Step 1. Create a temporary directory, then change directory into it. For example:
% mkdir /tmp/foo
% cd /tmp/foo
Step 2. If it is not currently started, please start Sapphire/Web by typing:
$SAPPHIRE/bin/saweb.sh
Step 3. Once Sapphire/Web comes up, bring up the Document Manager by pressing the Document Manager button or

by selecting the menu item Tools->Document Manager...

Step 4. Click the Create New Html Icon or

select the menu item File->Create.

Figure 3-3 Document Managers' Create HTML Icon

Step 5. Type
begin.html
as the name of the first HTML document.

Step 6. Using your HTML editor, change begin.html to the following.
<HTML>
<HEAD><TITLE> Initial Document </TITLE></HEAD>
<BODY>
This is the first document. Click 
<A HREF="GO">here</A> to go to the next.
</BODY>
</HTML>
Use your editor/browser to view the HTML document.

Figure 3-4 Browser view of begin.html

Step 7. Following Steps 2 through 4, create a second HTML document called end.html.
Step 8. Using your HTML editor, change end.html to the following.
<HTML>
<HEAD><TITLE> Final Document </TITLE></HEAD>
<BODY>
This is the final document. Cool.
</BODY>
</HTML>
Use your editor/browser to view the HTML document.

Figure 3-5 Browser view of end.html document

Once you have completed both of the HTML documents, you will then use both of these documents to create a binding.

To begin Binding Documents go back to the Sapphire Project Window....

Step 1. At the Project Window, select the Object Bind Editor, by clicking the Object Bind Editor (New Activator) Icon or

by selecting the menu item Tools->Object Bind Editor.

Figure 3-6 Activator Selector

Step 2. An intermediate window pops up (the Activator-Selector), under Document section select begin.html. Under the Anchors section, select HREF=GO. Click OK.

Another window pops up (the Open DSQL or PROC).

Figure 3-7 Open DSQL

In this window, click on the arrow button to bring up the menu of bind types. Select NULL, then click OK.

Figure 3-8 Object Bind Editor

Step 3. In the Object Bind Editor, click on the Results<=>Template, then select end.html. Click OK.

Since this is a NULL binding, no additional work is required.

At this point the Object Bind Editor will close., and the Project Window appears¯you will now test the project.

Testing the Project from the Project window

Step 1. Select menu item File->Build Project. Sapphire/Web will prompt you for a project file.

Step 2. Save your project as test.pj. If you see the following messages, samake.sh is configured correctly.
Compiling test.c [ANSI C]
Compiling begin.c [ANSI C]
Linking test.cgi
Finished Linking
Step 3. If not, please edit $SAPPHIRE/bin/samake.sh and change the line
MAKE=make
to point to wherever Make is installed on the system. Also make sure that CC=, is pointing to a valid compiler/linker.

satest.sh

satest.sh is the script that installs your project into a test HTML directory after the Common Gateway Interface (CGI) program has been generated. The script also uses two of the scripts mentioned before (sabrowser.sh and samake.sh), make sure that these two scripts are configured correctly. To correctly set up the scripts, there are four configuration options that need to be set:

Start-up

Step 1. Create a temporary directory and change directory into it. For example:
% mkdir /tmp/foo
% cd /tmp/foo
Step 2. If Sapphire/Web is not already started, please start it by typing:
$SAPPHIRE/bin/saweb.sh

Installing CGIs

Step 1. To set up configuration options, in Sapphire/Web, from the Project Window, select the menu item Edit->Options. At Category popup menu, select the Test category, then CGI test Path

This is the file path that CGIs are installed to¯therefore, if your HTTP server is configured to execute CGIs from any directory, you should probably use something of the form:

/my/home/directory/public_html/cgi-bin
where /my/home/directory is your home directory. If you plan to install your CGIs to a different machine, this option should have the form:

machine:/my/home/directory/public_html/
Step 2. Your web administrator should be able to tell you where to install CGI executables CGI URL -- This is the URL used to reference a CGI installed to the above CGI path. For example, if a CGI were installed to

/home/netscape/ns-home/docs/cgi-bin
and the HTTP server document root was /home/netscape/ns-home/docs then the CGI URL would be set to:

http://machine/cgi-bin/
HTML Path--This is the file path that HTML documents are installed to. Since this is the project test phase rather than the final release, you probably want to use a personal home directory rather than the main HTTP server document root. For example,

/my/home/directory/public_html/
where /my/home/directory is your home directory. If you plan to install your HTML documents to a different machine, this option should have the form:

machine:/my/home/directory/public_html/cgi-bin.
HTML URL--This is the URL used to reference an HTML document installed to the above HTML path. For example, if a document were installed to:

/home/netscape/ns-home/docs/
and the HTTP server document root was /home/netscape/ns-home/docs then the HTML URL would be set to:

http://machine/
Step 3. Click OK once these options are set. In the Project window, click the Test button or

select the menu item File->Test.

Your web browser should pop up with the first page.

Step 4. Click on the here link. The browser should then switch to the end.html page.

Step 5. Make sure you save your Options by selecting the menu item Edit->Save Options.
You have successfully validated your CGI and HTML set-up. Please complete Chapters 4 and 5 to set up the Gateway and the tutorials.


[Prev] [Next] [Top] [Bottom] [Contents] (3 out of 4)