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

Tutorial A

The objective of this tutorial is to learn the basic steps necessary to create a CGI with Sapphire/Web WITHOUT accessing any database functionality. This project will prove important for the third and final tutorial.

The steps listed below, detail creating a very simple project with Sapphire/Web.

Step 1. Create a temporary directory, then change directory into it. For example:
% mkdir $HOME/tutorial0a
% cd $HOME/tutorial0a
Step 2. Set the SAPPHIRE environment variable:
Bourne or Korn shell:
	SAPPHIRE sapphire_directory; export Sapphire
C Shell:
setenv SAPPHIRE sapphire_home
Step 3. Put $SAPPHIRE/bin in your path.
Bourne or Korn shell:
		PATH=$PATH:$SAPPHIRE/bin; export PATH
C Shell:
		set path=($path $SAPPHIRE/bin)
Step 4. If it is not currently started, please start Sapphire/Web by typing:
$SAPPHIRE/bin/saweb.sh
Step 5. At the Project Window, select Document Manager by clicking-on the Document Manager Icon
or by selecting the menu item Tools->Document Manager...

Figure 2-1 Project Window

Step 6. Click the Create New Html button
or
select the menu item File->Create.
Step 7. Type
begin.html
as the name of the first HTML document. 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>
Your Browser screen should look similar to Figure 2-2.

Figure 2-2 Browser view of begin.html

Step 8. Create another HTML document called end.html using Steps 5 and 6.
Step 9. 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>
Your Browser screen should look like Figure 2-3.

Figure 2-3 Browser view of end.html

Binding two HTML Documents

Once you have created the two HTML documents, the next steps will show you how to create a binding between them. Here's how:

Step 1. At the Project Window, open the Object Bind Editor, by clicking the Object Bind Editors' New Activator Icon,
or
by selecting the menu item Tools->Object Bind Editor.

Figure 2-4 Object Bind Editor's Intermediate Window

An intermediate window will pop up.
Step 2. In the document section, select begin.html.
In the Anchors section, select HREF=GO
Click OK.
Another window will pop up.
Step 3. In this window, click on the arrow button to bring up the menu of bind types.
Select NULL
Step 4. Click OK.
This will open the Object Bind Editor.

Figure 2-5 Object Bind Editor

Step 5. In the Object Bind Editor, from the down arrow next to Results <=> Temp, select end.html.
Step 6. Click OK. Since this is a NULL binding, no additional work is required.
Note: Null bindings are used to transition between HTML pages when there is no object in use.

Testing Your Project

Step 1. At the Sapphire/Web Project window, click on the Test button.

Figure 2-6 Test Icon located on the Project Window

Step 2. Sapphire/Web will prompt you for a project file., save the project as:
test.pj
The following messages, will be displayed in the project window messages area, if the tutorial was successful.

Figure 2-7 Project Window Messages

The test procedure will also pop up a Web browser window containing the initial page. When you click on the "here" hyperlink, the browser will pop up the final page, demonstrating how to simply link together two HTML pages with a NULL binding in Sapphire/Web. The next step is to bind to a database object.


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