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

Data Drop Sites

As noted in the introduction, the basic Sapphire/Web Data Drop Site is of the form

##Sa_ExampleDataDropSite##
where the #Sa_ string denotes the start of the site and the following ## the end. In between these two markers lies the name of the site.

There are a number of different pre-defined types of data drop sites available for different uses in Sapphire/Web:

##Sa_Name##

This tag (shown in the title above) is the simplest. When the server application encounters this tag in a template it simply replaces it with whatever data it has, including whatever formatting that may be included within the data.

Thus the server application could obtain a filename from a database and insert it into the template HTML in order to dynamically determine which of a number of graphics should be displayed. The HTML for that would look like this:

<img src="##Sa_ImageName##" height=60 width=45>
After substitution, the HTML that arrives at the browser might be

<img src="gifs/promorg3.gif" height=60 width=45>
which would then result in a callback from the browser for the named GIF file.

These tags are used in many different ways. You should also refer to the help on HTML extensions to see examples on using loops and creating hotlists for your HTML pages.

##Sa_SQL=<SQL String>##

Sapphire/Web allows you to include SQL statements directly within the HTML Template. It looks like this:

##Sa_SQL =select * from authors##
The SQL code is delimited by the "=" and the "##" symbols.

##Sa_FILE=filespec##

Sapphire supports the use of the following site markup in a template file:

##Sa_FILE=filespec##
where filespec is the path to a file. When the server application encounters this markup while playing a template file, the contents of the file are substituted for the tag. Note that the path must be valid for the server application as it runs on the server side.

Notes

When the server application encounters this tag, its current directory will be the HTML directory that was specified for the project. The contents of the file are not processed in any way.

For example if the file contains other sites, they will not only not be processed, but the sites would actually appear in the returned HTML. This capability is a form of server-side include.

The following file path specification is valid for both the Windows and UNIX versions of Sapphire:

##Sa_FILE=../librarydir/JavaScripts.js##
This relative file path enables you to include files from a common area in multiple projects. Project maintenance is streamlined because you have only one copy of a file to update. The above example assumes that all your projects have an HTML directory option such that the projects are at the same directory level and the common area is also at the same level. This makes the task of moving this "site" easy since all you need is to copy from the parent directory on down.



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

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