Dynamic HTML in Action

Active Channels, based on Microsoft's Channel Definition Format (CDF), are one implementation of "push" technology. CDF can be a powerful tool for packaging and delivering content. Channels can be used to give access to the Windows desktop Channel Bar (shown in Figure 22-8) and the Channels folder in Internet Explorer, scheduled updates, the channel screen saver, software distribution channel, active desktop items, and much more. Users can also "pull" content from various content providers according to a schedule they create.

Figure 22-8. The Windows Channel bar.

An Active Channel is simply a Web site that is described using CDF, the Channel Definition Format. Like an HTML file, a CDF file is structured text made up of various elements, each enclosed within opening and closing tags. For an HTML file, the opening and closing tags are <HTML> and </HTML>. For a CDF file, the tags are—you guessed it—<CHANNEL> and </CHANNEL>.

Code Listing 22-7 shows the structure of a basic CDF file. To experiment with this example, you must copy the entire \chap22\cdftest folder from the companion CD to drive C on your computer. Then double-click lst22-7.cdf from c:\cdftest to try the channel. This will open the page and add it to your favorites, under Channels. The secondary pages of the channel can be accessed by clicking on this channel in your favorites.

Code Listing 22-7.

<?xml version="1.0"?> <CHANNEL HREF="FILE://c:\cdftest\main.htm"> <TITLE>Dynamic HTML in Action Test Channel</TITLE> <LOGO HREF="FILE://c:\cdftest\cdftest.gif" STYLE="image" /> <LOGO HREF="FILE://c:\cdftest\cdftest.ico" STYLE="icon" /> <ITEM HREF="FILE://c:\cdftest\page1\page1.htm"> <TITLE>Channel test page 1</TITLE> <ABSTRACT>Page 1 of our channel test</ABSTRACT> </ITEM> <ITEM HREF="FILE://c:\cdftest\page2\page2.htm"> <TITLE>Channel test page 2</TITLE> <ABSTRACT>Page 2 of our channel test</ABSTRACT> </ITEM> </CHANNEL>

Figure 22-9.The channel logo is displayed in the Internet Explorer Channels Folder.

NOTE


The HREF attribute in a <CHANNEL> tag and all other HREF attributes in a CDF file require absolute paths or complete URLs—for example, HREF="http://www.domain.com/channel/myChannel.htm". Relative paths such as /channel/myChannel.htm do not work in a CDF file. (In Code Listing 22-7, for instance, we had to use the absolute path c:\cdftest\.) Most often, these attributes refer to actual Internet sites.

You can learn more about channels (including technologies like Offline Browsing and the CDF Generator) from the Site Builder Network Workshop. On the companion CD see Workshop (References); Content & Component Delivery; Channel Definition Format (CDF).

Категории