[Prev] [Next] [Top] [Bottom] [Contents] (2 out of 44)

Overview

Sapphire/Web uses options to make the tool configurable to most development and http environments. Setting these options to the proper values is important for Sapphire/Web to work correctly on your system. These options can be located in 3 files.

Global Options

The global options file is located in $SAPPHIRE/config/Sapphire.cfg. This file contains all of the options that can be defined in Sapphire/Web. The values in this file will be used by all users of the tool until they save their user options or change specific options in a project. There is no way to directly modify this file from Sapphire/Web. You must either edit the file using a text editor like vi or use the options editor in Sapphire/Web to define the options, save these options to your home directory and then copy your user options file to $SAPPHIRE/config/Sapphire.cfg.

User Options

The user options file is located in $HOME/Sapphire.cfg. This file can be generated by pressing the Save Options button in the Edit pulldown menu in the Sapphire/Web Project Window. Once you save your user options, you will use these options for all of your new projects. If you want to revert back to options specified in the Global Options file you must remove this file from your home directory.

Project Options

The project options are saved with the project. The values saved to this file are any options you change using the Options Editor while in Sapphire/Web. These options replace any specified in your user or global option files.

When Sapphire/Web needs to figure out the value of an option, it first looks to see if the option is defined for the project. If the option is not defined for the project, it then looks in the user file and then the global file.

Dynamic Options

All options supported by Sapphire/Web are checked for two key strings before being used when generating the CGI. The first string is #user and is replaced with the value of $LOGNAME. The second string is #proj and is replaced with the name of the current project. What this allows you to do is setup a convention for all of the projects at your site. All options are checked for these special strings but they will be most useful with the options that define paths and URLs.

Project Categories

All options documented in this chapter start with a category name. There are 4 categories defined for Sapphire/Web:

Configuration Files

Configuration Files allow you to change the options defined in your project after it was generated. The values of options that are entered into the Options Editor affect how your CGI executes. If you would like to change options without going back to the tool you could edit a configuration file in any text editor (like vi or emacs).

If the option Project.Allow Config File is set to True Sapphire/Web will create a configuration file in your project directory that has the current value of all of the configurable options as it's contents. It is up to you to copy it to the location specified in the Project.Config File Name option. Here is an example configuration file:

	HTML URL : http://cezanne/~bnaugle/tut3
	HTML Path : cezanne:~bnaugle/public_html/tut3
	GIF URL : http://cezanne/~bnaugle/tut3
	Database Name : 
	Database Server : 
	Database Vendor : NODEFAULT
	Database User Name : sapphire
	Database User Password : the passwd
	Project.HTML Startup Document : index.html
	Project.Print Form Args : True
	Project.Print Environment : False
	ORB_HOST : 
	ORB_SEED : 
The syntax of the configuration file is Name : Value

There must be one space before and after the colon separating the Name and Value. There must be a space after the colon even if there is no Value defined for the Name. If you do not want to override an option that has been hard coded into your cgi you should remove the entire line containing the Name : Value pair from the file. Note that blank option values will override the hard coded option with an empty string. You should also note that the #proj and #user keywords cannot be placed into a configuration file. These two keywords have been replaced with their proper values when the cgi was generated.

Not all options can be placed into a configuration file. The example configuration file above shows all of the possible options that are allowed in a configuration file.

You may have noticed that some of the options in this configuration file do not have a Category in front of the name. These options can be found in both the Release and Test categories. Sapphire/Web does not write Release and Test in front of the option names so you can use the same configuration file in either Test or Release mode. The values put in the config file depend on how you generated your project. The Release options will be used when in Release mode and the Test options will be used when in Test mode.

When the CGI executes and has been defined to allow a config file it will request the configuration file from the local http server. If the configuration file cannot be found on the local server it will not generate an error, it will just use the hard coded values. If the configuration file is found all option values in the configuration file will override the hard coded values in the CGI.

Configuration files allow you to build a CGI that you want to run on several machines. You can build and test the CGI on one machine. After you verify that the application works you can copy the CGI and the html files needed by the CGI to another machine. You then modify the configuration file to reflect the new machine, database and path information and the application will now work on the new machine.


[Prev] [Next] [Top] [Bottom] [Contents] (2 out of 44)