Web Document subsystem

The Web Document subsystem consists of a text viewer that displays a document of editable text and responds to user input. For example, a user might view a home page for an online museum and choose "Museum Hours" from the text on the page. This text could provide a link to scheduling information for the actual museum site.

To support this functionality, the subsystem needs to replace its current contents (such as the home page) with a page that represents the schedule as a passage of styled hypertext containing embedded link components.

In addition, this subsystem must be able to respond to user interface directives for Undo and Redo as well as display the title of individual documents in a view.

Other subsystems within WebRunner Sample function as embedded components within the Web Document subsystem. Currently, the Web Link subsystem and the Graphic Document subsystem both produce components that are embedded within the flow of editable text, but the Translation subsystem allows the sample to import new foreign data types as embedded components whenever an appropriate global translator is available. Detailed information on each of these subsystems is provided in the following sections.

This program uses the templatized TGUIComponentStationeryFor to create a document out of a TWebModel and TWebPresenterState. All the document mechanics are handled by the stationery, so this program can focus on representing its data (using the model) and displaying it (using the
presenter state).

At its simplest, the data represented by WebRunner Sample is little more than specialized editable text, along with a document address and title. TEmbedderTextModel already supports editable text with component embedding. To add support for the document address and title, this program derives TEmbedderTextModel to produce TWebModel. It then adds a range of text to the model to store the title of the currently-viewed document, and holds an internet URL to store the document's address. For a description of a uniform resource locator, see "Data Access subsystem" (page 85).

Because views already exist to display text labels, scrolling, and editable text, this program only needs to construct a top-level view that composes the parts and maintains consistency with the model. TEmbedderTextView and its clipping view are both created and initialized by the text presenter so that it is only necessary for TWebView to invalidate and update the title whenever this program switches to a new page.



[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