Data Access subsystem

The Data Access Subsystem provides an interface to jump from an abstract URL to the hypertextual data it references. A URL is a string of characters which provides an absolute location for a file on the network. A URL encapsulates the network protocol to use, the machine to contact, and the location of the file on that machine. By representing resources using this absolute addressing scheme, you are guaranteed to reach the same information whether you access it from your office or your home.

The WebRunner Sample supports the URL functionality in a concrete class that provides a single interface between an internet resource address and tangible CommonPoint data. This interface wraps CERN's data access library (LibWWW) into a programming interface represented as a single C++ class.


This program uses the Follow member function on TURL as a bridge between the abstract resource location and a concrete value. The WebRunner Sample uses TURL::Follow to retrieve a piece of information (such as graphics or hypertext) which results in a new scrap item. This item represents CommonPoint's general interface for an unknown piece of data.

Unfortunately, the structure of LibWWW requires the WebRunner Sample to use two different paths to receive a scrap item. If the content pointed to by a URL is textual in form, then C-style structure `_HText' is filled in by the library, but if the data is in a raw form, then `_HTStream' is used.

Because there is no way to determine the data type prior to loading the document, TURL tells the library to load the content, and then checks to see if the library has filled in the _HText with hypertextual data. If it has, then TURL bundles together a THypertextScrapItem containing all of the useful information that makes up Web-style hypertext and then returns it as the resulting TScrapItem* value.

If, on the other hand, the data is in a raw format, such as a GIF image file, the library fills in _HTStream. TURL can then construct an appropriate CommonPoint stream with all of the new data. By bundling this Taligent stream up as a TMIMEDataStream, this program can construct a bundle of data that can be manipulated by the Data Translation framework. From a client's perspective, translation provides a way of extracting a TScrapItem* from a foreign data object when an appropriate global translator is installed on a system.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker