[Top] [Prev] [Next] [Bottom] [Contents]

Sapphire/Web Additions

Building Libraries

The easiest way to build new object files and libraries to add to the client API functionality is to add Application Objects to a project and compile using the Sapphire/Web-generated makefile. At this point you should decide if you wish to make the new functionality part of every CGI by adding the objects and/or libraries to the Makefile.tem template or let the developer choose when it is needed by adding application objects and libraries to the individual project. The former is more convenient, but makes each CGI bigger in size than it has to be, if the functionality is not always needed.

The Create Table Example

The directory, contrib/create_table, of the Sapphire/Web distribution contains the create table example that was used in the demo mentioned in the section on the Table Component Object. Unfortunately, the code only works with Sybase. It grants all permissions to public for the tables it creates and limits what data types you can use in the created table. However, the end result is rather powerful, and with a few modifications you can change the functionality or make it work for Oracle and Informix. Furthermore, the source code is another example of using the Sapphire/Web API. If you wish to use this in a project, just follow a similar set of steps as outlined in the Table Component Object section. The function, SaCreateTableForm, is the entry point in the source file, SaCrTabl.c.

If you wish to learn more about the create table component and how to make wide use of it, see the Bluestone demo at the URL:

http://www.bluestone.com/sapphire/table/tdemo.html
Make sure you read Instructions, on the demo Web page, which also serve s as a white paper.

Options

Sapphire/Web makes use of options internally. You can see these in several interfaces in the tool. The client library and the gateway also use this capability. The source code for the Table Component Object contained in the file, SaHtmlTb.c, in the client/src directory of the Sapphire/Web distribution also makes use of options. You can use that as an example if you wish to use them.

The Client Source Files

The client/src directory of the Sapphire/Web distribution contains two source files. These are part of the Sapphire/Web client library. These can be used as examples of functions that you may wish to write. You should not add or remove functionality to/from these files. Instead see the section above on the correct way to do that. If however, you wish to modify the behavior because Sapphire/Web has not given you what you want, then you must should do the following. First make a project. Copy the files into your project directory, and add them as files in your application. Make your changes. Use the Sapphire/Web-generated makefile to make your changes. Do not use C++. With the new objects modify the appropriate libraries, for example:

ar ruv libwebdb.a SaHtmlC.o SaHtmlTb.o
You may also need to run:

ar ts libwebdb.a
and also, for SUN/OS only, run:

ranlib libwebdb.a
Similar commands are needed for the client direct libraries if you use that functionality. These libraries are:

For SYBASE:

libwebdbSY.a
For ORACLE:

libwebdbOR.a
For INFORMIX:

libwebdbIF.a
Also note that future versions of these source files will not reflect your modifications. And remember to always backup the old versions just in case.



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.