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.
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.