Creating Active Channels

Creating Active Channels


This article explains Active Channels™ for Microsoft® Internet Explorer 4.0. Feature descriptions, screen shots, examples, guidelines, and a reference guide are provided to help Web publishers understand how to create their own Active Channels with a Channel Definition Format (CDF) file.

arrowr.gifWebcasting

arrowr.gifWhat Is an Active Channel?

arrowr.gifActive Channel Types

arrowr.gifActive Channel Features

arrowr.gifDeveloping an Active Channel

arrowr.gifOptimizing Active Channels over HTTP

arrowr.gifGuidelines for Active Channel Logo Images

arrowr.gifUsing Dynamic HTML with Active Channels

arrowr.gifNetcaster CDF Compatibility Notes

Webcasting

Web publishers can now broadcast content to their users on a regular schedule with new "push" and "pull" technologies that are collectively referred to as Webcasting. Users benefit by having the information that is most important to them automatically delivered directly to their desktop without having to go look for it and also by being notified when the information has been updated. Web publishers benefit through improved feedback from increased exposure, more interactive relationships with their users, and a better understanding of their user base.

Microsoft® Internet Explorer 4.0 supports these new open, standards-based technologies as an "information receiver" client. Web sites can broadcast their content to an information receiver like Internet Explorer by turning their Web site into an Active Channel. This article describes Active Channels and provides a sample that illustrates how to create one. Consult the CDF Reference for Active Channels for detailed descriptions of the CDF file elements and attributes. Further information on Webcasting is available on Microsoft's Web site, located at http://www.microsoft.com/ie/ie40/press/push.htm.

What Is an Active Channel?

An Active Channel is a Web site that has been enabled for Webcasting to information-receiving programs such as Internet Explorer 4.0. The mechanism that makes this possible in Internet Explorer 4.0 is the Channel Definition Format (CDF) file. The CDF file provides an index of resources available in the channel and a recommended schedule for when the channel should be updated on the user's computer.

A typical CDF file contains a top-level CHANNEL element to define the channel itself, along with ITEM elements to specify the actual contents of the channel. Subsequent occurrences of the CHANNEL element define subchannels and allow publishers to create a hierarchy for the channel. The TITLE and ABSTRACT elements can be used to describe the contents of each item or channel element. Publishers may also want to use the LOGO element to associate an image with each item in the channel, as well as with the channel itself.

Web Publisher's Perspective

Web publishers can give users a better browsing experience by offering their content in a channel. A channel can be created that Webcasts the following items to a browser:

A traditional Web site can be viewed as an Active Channel with a minimal amount of work by the Web publisher. These are the required tasks:

Active Channel Types

This section describes basic types of channels that properly use the strengths of Internet Explorer's information delivery architecture within the constraints of bandwidth available in the home or the corporation. Web publishers can create channels to take advantage of the following three key Internet Explorer 4.0 capabilities.

Notification Internet Explorer 4.0 uses a red "gleam" (resembling an asterisk) to visually flag the logos and icons of channels that have changed since their previous update. Users can choose to have an e-mail message sent to them when a channel is updated.
Sitemap The Channels Explorer Bar can display a navigable outline of URLs as specified in a channel's CDF file. The exposed hierarchy of the channel helps users efficiently navigate through a channel to find the content they are most interested in.
Offline Content Caching Internet Explorer 4.0 will download the set of resources specified in the CDF file to be locally cached. This allows users to browse through the entire content of an active channel even when they are offline. It is important to note that offline content is only available to users accepting the default "download content" option when subscribing to the channel.

Channel Sitemaps and Notifications

Channel Sitemaps and Notifications

These capabilities can, of course, be combined to create different types of end-user channels experiences. It's important to realize, however, that this flexibility also permits authors to define impractical channels (for example, a channel that tries to replicate an extensive Web site to the user's local disk). As a general rule, an Active Channel should fit into one of the following categories:

News Channels

A news channel is used to keep the user up-to-date on breaking news. This channel periodically Webcasts a hierarchically structured set of news items to the desktop, through the CDF file. The actual content referenced in the CDF file is downloaded into the user's cache and available for offline use. A news channel uses all three Internet Explorer key capabilities: notification, sitemap, and offline content caching. When developing the content for a news channel, keep the following guidelines in mind.

The CDF file allows Web publishers to hierarchically organize items in a channel into subchannels. The TITLE of each subchannel serves to classify the items contained within the subchannel. By default, subchannels and items in the Channel's CDF are displayed in an outline format in the Channels Explorer Bar. In addition to any navigation mechanism authored into the pages themselves, the user can expand and collapse subchannels in the outline and jump to individual news items.

Example: A news publisher, Action News, generates business stories as individual HTML pages.

Today's business stories are:

The pages are primarily textual, sharing a common masthead graphic, as shown here:

Action News Channel Pages

For the purpose of this example, the publisher's channel consists of only these stories organized into a single subchannel called The Market. The publisher could deliver these articles to the desktop by providing the following CDF file:

<?XML VERSION="1.0" ENCODING="UTF-8"?>

<CHANNEL 
	HREF="home.htm" 
	BASE="http://www.action.com/channel/" >

	<TITLE>Action News</TITLE>
	<ABSTRACT>Description of the Action News Channel</ABSTRACT>
	<LOGO HREF="ActionLogo16x16.gif" STYLE="ICON"/>
	<LOGO HREF="ActionLogo32x80.gif" STYLE="IMAGE"/>

	<SCHEDULE STARTDATE="1997-10-17" ENDDATE="1997-10-17">
		<INTERVALTIME DAY="1"/>
	</SCHEDULE>

	<CHANNEL
		HREF="bus001.htm">
		<TITLE>The Market</TITLE>
		<ABSTRACT>"Summary of today's market news"<ABSTRACT>
		<LOGO HREF="marketLogo.gif" STYLE="ICON"/>

		<ITEM HREF="bus002.htm" LASTMOD="1997-10-17T11:12">
			<TITLE>Business nirvana: low inflation, high growth</TITLE>
			<ABSTRACT>Best environment for business in 25 years due to convergence of factors.</ABSTRACT>
			<LOGO HREF="TopStoryLogo.gif" STYLE="ICON"/>
		</ITEM>

		<ITEM HREF="bus003.htm" LASTMOD="1997-10-17T11:12">
			<TITLE>Tech stocks soar on XYZ Corp. news </TITLE>
			<ABSTRACT>XYZ Corp. showed unexpected growth this quarter, dragging up prices through the technology segment.</ABSTRACT>
			<LOGO HREF="TopStoryLogo.gif" STYLE="ICON"/>
		</ITEM>
	</CHANNEL>
</CHANNEL>

Once subscribed to by the user, Action News would appear within the browser's Channels Explorer Bar as:

Action News Channel

Since none of the stories in the CDF include the PRECACHE="NO" attribute on the ITEM elements, all of the pages will be pre-cached during updating. Therefore, each news page will be available for offline viewing if the user subscribes to the channel and chooses to receive channel content.

Immersion Channels

An immersion channel presents the user with an authored "environment" that provides all navigation (for example, the Channels Explorer Bar is assumed to be hidden). All content is pre-cached so the channel can be used offline. It is important to note that this channel's items and subchannels do not appear in the Channels Explorer Bar. In this case, the CDF file is used exclusively to specify content that needs to be downloaded and to notify the user when the channel has been updated. Downloading channel content helps increase online performance and allows offline use. Similar to the CDF of a news channel, the author specifies a list of items to be updated and a schedule for updating them. However, unlike a news channel, each item in the CDF must include the following child element:

<USAGE VALUE="None"></USAGE>

This element instructs Internet Explorer 4.0 not to display the subchannel or item in the Channels Explorer Bar, but it will download and pre-cache each item. Resources other than HMTL pages, such as images and ActiveX™ controls, can also be specified in the CDF to be pre-cached when the channel is updated. Since the channel is designed for offline use, the amount of content specified by the CDF file must be compatible with bandwidth constraints of the target audience.

Example: A maze game immersion channel containing a set of inter-linked rooms implemented as HTML pages. On each subsequent update of the CDF file, the publisher dynamically generates a new CDF file that adds new rooms or modifies the existing maze.

Maze Game Immersion Channel

The CDF file to deliver a simple maze game might look something like this:

<?XML VERSION="1.0" ENCODING="UTF-8"?>

<CHANNEL 
	HREF="home.htm" 
	BASE="http://www.gamer.com/channel/" >

	<TITLE>The Castle</TITLE>
	<ABSTRACT>A always changing maze of rooms for you to explore</ABSTRACT>
	<LOGO HREF="Castle16x16.gif" STYLE="ICON"/>
	<LOGO HREF="Castle32x80.gif" STYLE="IMAGE"/>

	<SCHEDULE STARTDATE="1997-10-17" ENDDATE="1997-10-17">
		<INTERVALTIME DAY="1"/>
	</SCHEDULE>

	<ITEM HREF="room01.htm" LASTMOD="1997-10-17T11:12">
		<USAGE VALUE="None"></USAGE>
	</ITEM>

	<ITEM HREF="room02.htm" LASTMOD="1997-10-17T11:12">
		<USAGE VALUE="None"></USAGE>
	</ITEM>

	<-- a list of additional items -->

	<ITEM HREF="roomNN.htm" LASTMOD="1997-10-17T11:12">
		<USAGE VALUE="None"></USAGE>
	</ITEM>

</CHANNEL>

Maze Game Immersion Channel

Notification Channels

A notification channel informs the user when new information is available within a channel and provides a sitemap (through the CDF file) to the new information without downloading the content itself. The CDF file of a notification channel is similar to a news channel, except that the PRECACHE= attribute of each subchannel and item is explicitly set to "No." The hierarchy of items and subchannels in the CDF file will be displayed in the Channels Explorer Bar, but the content referenced by the outline will only be available online. It's important that the publisher sets the user's expectations appropriately, specifically indicating that this type of channel is designed to notify the user of changes to content available online. Like all channels, a "gleam" appears on the channel's logo to inform the user that the channel has been updated.

Example: A corporation wants to create a channel to notify employees about the latest information on their employee services, benefits, company policies, and so on.

Corporate Notification Channel

The following illustrates the notification channel's CDF file. The example only includes the "Employee Services" subchannel.

<CHANNEL 
	HREF="home.htm" 
	BASE="http://www.corp.com/channel/" 
	PRECACHE="No">

	<TITLE>Corporate Channel</TITLE>
	<ABSTRACT>CorpCo's Corporate Channel</ABSTRACT>
	<LOGO HREF="CorpLogo16x16.gif" STYLE="ICON"/>
	<LOGO HREF="CorpLogo32x80.gif" STYLE="IMAGE"/>

	<SCHEDULE STARTDATE="1997-10-17" ENDDATE="1997-10-17">
		<INTERVALTIME DAY="1"/>
	</SCHEDULE>

	<-- omitted subchannels -->

	<CHANNEL
		HREF="services.htm"
		PRECACHE="NO">

		<TITLE>Employee Services</TITLE>
		<ABSTRACT>Employee services  from CorpCo</ABSTRACT>
		<LOGO HREF="CategoryLogo.gif" STYLE="ICON"/>

		<ITEM HREF="companyStore.htm" PRECACHE= "NO" LASTMOD="1997-10-17T11:12">
			<TITLE>Company Store</TITLE>
			<ABSTRACT> Offerings from the Company Store </ABSTRACT>
			<LOGO HREF="BulletLogo.gif" STYLE="ICON"/>
		</ITEM>

		<ITEM HREF="StockServices.htm" PRECACHE= "NO" LASTMOD="1997-10-17T11:12">
			<TITLE>Stock Services</TITLE>
			<ABSTRACT>Buying and selling CorpCo stock</ABSTRACT>
			<LOGO HREF="BulletLogo.gif" STYLE="ICON"/>
		</ITEM>

		<ITEM HREF="Career.htm" PRECACHE= "NO" LASTMOD="1997-10-17T11:12">
			<TITLE>Career Center</TITLE>
			<ABSTRACT>Job opportunities at CorpCo</ABSTRACT>
			<LOGO HREF="BulletLogo.gif" STYLE="ICON"/>
		</ITEM>

		<ITEM HREF="Handbook.htm" PRECACHE= "NO" LASTMOD="1997-10-17T11:12">
			<TITLE>Employee Handbook</TITLE>
			<ABSTRACT>Rules and regulations for CorpCo Employees</ABSTRACT>
			<LOGO HREF="BulletLogo.gif" STYLE="ICON"/>
		</ITEM>

		<ITEM HREF="Cafeteria.htm" PRECACHE= "NO" LASTMOD="1997-10-17T11:12">
			<TITLE>CafeteriaMenus</TITLE>
			<ABSTRACT>Today's Eats </ABSTRACT>
			<LOGO HREF="BulletLogo.gif" STYLE="ICON"/>
		</ITEM>

		<ITEM HREF="Vacation.htm" PRECACHE= "NO" LASTMOD="1997-10-17T11:12">
			<TITLE>Vacation and Sick Reporting </TITLE>
			<ABSTRACT>Vaction and Sick Day Reporting Form </ABSTRACT>
			<LOGO HREF="BulletLogo.gif" STYLE="ICON"/>
		</ITEM>
	</CHANNEL>

	<-- omitted subchannels -->

</CHANNEL>

Hybrid Channels

Hybrid channels combine two or more of the news, immersion, and navigation channel types. When creating a hybrid channel, follow these guidelines:

Hybrid Channel

Design Guidelines for Active Channels

To take true advantage of the "push" mechanism available in Internet Explorer 4.0, channels must be as small as possible to minimize download time and provide compelling content and interaction when used offline. When designing your Active Channel, follow these guidelines:

Active Channel Features

The following sections explain the details of various Active Channel features, as well as what Web publishers need to know to take advantage of them.

Scheduled Updates and Server Loads

Web publishers can create a default schedule in the CDF file that Internet Explorer uses to determine when the channel information on the user's computer should be updated. Specifying a schedule with a range of valid update times can help effectively manage server loads when Webcasting to Internet Explorer. The actual time Internet Explorer updates the channel is randomly selected from the valid time range for each update. The CDF file specifies the valid time range for updates by including the EARLIESTTIME and LATESTTIME elements as child elements of the SCHEDULE element. The INTERVALTIME element specifies how often, on average, the updates will occur. The following examples illustrate different update schedules for an Active Channel.

Note The shaded areas in the diagrams below represent the range of time during which the actual channel update will occur.

Daily Schedule

The schedule shown below would cause the channel to be updated every day at a random time between 2 and 6 A.M. Since the publisher didn't specify a start or end date, the schedule takes effect immediately and doesn't expire.


<SCHEDULE>
	<IntervalTime Day="1" />
	<EarliestTime Hour="2" />
	<LatestTime Hour="6" />
</SCHEDULE>

Daily Schedule

Hourly Schedule

For channels that Webcast extremely time-critical information, a channel may need to be updated many times during the day. The example below shows a channel that is updated four times per day. The actual updates occur sometime after the second hour of each six-hour interval. This schedule is set to expire on December 31, 1999, at which point no further updated information will be downloaded for this channel.


<SCHEDULE EndDate="1999-12-31">
	<IntervalTime Hour="6" />
	<EarliestTime Hour="2" />
	<LatestTime Hour="6" />
</SCHEDULE>

Hourly Schedule

Weekly Schedule

A schedule that updates a channel once a week is shown below. Because this weekly schedule started on a Monday, this channel will be updated every Monday sometime between 2 and 6 A.M. until it reaches the expiration date. This schedule takes effect on Monday, September 29, 1997, and expires on December 31, 1999.


<SCHEDULE StartDate="1997-09-29" EndDate="1999-12-31">
	<IntervalTime Day="7" />
	<EarliestTime Hour="2" />
	<LatestTime Hour="6" />
</SCHEDULE>

Weekly Schedule

By default, users accessing the Internet with a dial-up connection need to manually update their channels by either right-clicking on a logo image representing a channel subscription and selecting the Update Now option from the context menu, or by selecting the Update All option from the Favorites menu. Modem users can also configure their subscriptions to automatically dial up their Internet connection on a regular basis without any user intervention. To set up automatic updates over a modem, the user must check the "Dial as needed..." check box in the Schedule tab of the Channel Properties. Once automatic updates are enabled by modem users, the publisher's recommended schedule or a standard schedule (daily, weekly, monthly) can be used. If the "Dial as needed..." feature is not enabled, the channel updating schedule is effectively manual for modem users. Users connected to a network should use the publisher's recommended schedule specified in the CDF file for updating channels.

Personalized Channels

The HTTP cookie standard provides a powerful mechanism for personalizing Web content. The CDF file integrates this standard with Internet Explorer. A Web publisher who wants to create a personalized channel can use regular HTTP cookies to deliver personalized information to users by dynamically generating a custom CDF file based on user preferences. The CDF file thus leverages the existing cookie standard for personalized HTML on the Web and takes it one step further by allowing personalized channels for individual users. Web publishers can create personalized channels for users or groups of users by performing the following tasks:

  1. The first time users visit a channel, present them with a form asking for their preferences, as they relate to the channel.
  2. Store those user preferences on the Web server or within a cookie on the user's computer.
  3. Whenever Internet Explorer 4.0 subsequently requests an updated CDF for that user, the server could either download an existing CDF file or dynamically generate one that matches the user's profile information stored locally in the cookie.

Web publishers using active server pages with Microsoft Internet Information Server (IIS) to dynamically generate personalized CDF files (named with an .asp extension) must insert the following line at the top of the CDF file:

<% Response.ContentType = "application/x-cdf" %>

Note As an alternative for IIS 4.0 site authors, the CDF file can be created with a .cdx extension instead of .asp, and the MIME content type line above can be omitted.

This ensures that the server will return the correct MIME/content type to the browser. Without this line, the browser will not perform the expected actions for CDF files. For example, the CDF file might display as text in the browser window rather than launch the Add Channel dialog box.

Password-Protected Active Channels

Web publishers implementing HTTP authentication in their channels need to make sure Internet Explorer has the user name and password so it can update the channel content without user intervention. To accomplish this, publishers can force Internet Explorer to ask users for this information during the channel subscription setup process by using the LOGIN element in the CDF file. When the channel subscription wizard encounters this element in a CDF file, it will prompt users to enter their username and password. When the channel setup is complete, the user name and password are stored with the channel's subscription properties. Therefore, subsequent CDF files sent to that user for updating the channel don't require the LOGIN element. Internet Explorer will automatically authenticate HTML pages when using Basic, NTLM, RPA, and HTML forms.

If the authentication process is based on an HTML form, Internet Explorer needs to be able to fill out the form correctly. For the login process to be successful, follow the guidelines just mentioned for the HTTP authentication, and make sure the HTML form complies with these requirements:

Note All other elements on the form will be posted with their default values.

Page-Hit Logging

Important Note The page-hit logging feature enables Active Channels to collect the same page-hit information from offline users as they can already collect from online users. This feature can easily be disabled by a home user or a corporate administrator, if desired.

Page-hit logging collects information for Web publishers about activity on their channel pages by logging page hits in the browser, screen saver, and Active Desktop in both offline and online modes. The page-hit engine allows the collection of data for the time and date that the channel pages were loaded into the browser.

Client-side logging

Using the CDF file, publishers can tightly control exactly what page hits are logged. They can also define the maximum time to archive the data. To enable page-hit logging of a channel, the CDF file should contain the LOG element, indicating what items are to be logged, and the LOGTARGET element, indicating where the log file should be sent. Web publishers should use discretion when using the LOG element in the CDF file and select specific items for logging. Be aware that a large number of items marked for logging could potentially create large log files, which could raise bandwidth issues for the user when the log file is uploaded to the LOGTARGET URL. The uploading of the log file back to the server occurs when the CDF file is updated. For more information about the LOG and LOGTARGET elements, including examples, see the CDF Reference for Internet Explorer.

Note Items marked for logging must have an HREF attribute that falls under the URL of the CDF file or the path specified in the LOGTARGET element.

Web publishers receive the page-hit logging files in the directory (URL) specified in the LOGTARGET element, in "Extended Log File Format," as defined by the World Wide Web Consortium (W3C). Every page hit that is logged has two types of records associated with it. The first record is a "header" that contains the URL of the channel item being logged. The records subsequent to the header are details of the page hits. Here is a sample record:

#Fields: s-URI 
http://www.foosports.com/news/default.htm 
#Fields: c-context c-cache c-date c-time c-duration  
N 1 06-02-1997 19:12:37 00:00:04 
T 1 06-03-1997 11:38:04 00:00:23 

These records indicate that the URL "http://www.foosports.com/news/default.htm" was viewed in normal mode on June 2, 1997, from the cache at 7:12 P.M. for four seconds, and again in full screen view on June 3 at 11:38 A.M. for 23 seconds. The context value can be "N", "T", "D", or "S" to indicate whether the URL was viewed in a normal browser window, full screen view (Theater View), as an Active Desktop item, or in the Internet Explorer screen saver, respectively. The value for the cache field can be "1" to indicate the URL was retrieved from the local cache or "0" to indicate the URL was retrieved from the site itself. The Web publisher can filter out online or offline records by using the SCOPE= attribute of the LOGTARGET element. The date field shows the date on which the URL was viewed. The time value indicates what time (on the local computer) the URL was viewed, and the duration indicates how long the user viewed the page. The time and duration fields are in HH:MM:SS format, while the date is in MM-DD-YYYY format.

Server-side log file processing

Web publishers that receive page-hit log files can extract and process the data listed above in any way they choose. However, Microsoft provides the following two methods for parsing the information in the log file:

The following Perl script can be used to parse the log file.

require("cgi-lib.pl");
$logfile='log/cdfpost.dat';
$method=$ENV{REQUEST_METHOD};
$clen=$ENV{CONTENT_LENGTH};
print "Content-type: text/html\n\n"; 
print "<HTML>\n";
&open_logfile;
    &print_env;
&ProcessRawdata;
print "Just to show we got here too <BR>\n";
print "</HTML>\n";
sub ProcessRawdata
{
    &add_logdata;
    close(OUT);
}

sub print_env
{
    print OUT "<!--Request method : ", $method, "\n";
    print OUT "Server : ", $ENV{SERVER_NAME}, "\n";
    print OUT "Script : ", $ENV{SCRIPT_NAME}, "\n";
    print OUT "Client : ", $ENV{REMOTE_ADDR}, "\n";
    print OUT "Content-length : ", $clen, "-->\n";
}

sub open_logfile
{
    if (-e $logfile) { 
        open (OUT, ">>$logfile");
    } else {
        open (OUT, ">$logfile");
    }
}

sub add_logdata
{
    open(IN, "-");
    binmode IN;

    while ($clen) {
        print OUT getc(IN);
        $clen=$clen-1;
    };
    print OUT "\n";
}

When running Microsoft Internet Information Server (IIS), you can use the ISAPI DLL to parse the log file. For more information about how to accomplish this, see the readme file located in the inetsdk\samples\iislog directory. Note that this sample also demonstrates how to decompress encoded posted strings, and the associated CDF file must contain the HTTP-EQUIV element as follows:

<LOGTARGET HREF="http://www.mysite.com/logging/" METHOD="POST">
	<HTTP-EQUIV NAME="encoding-type" VALUE="gzip">
</LOGTARGET>

Additional information is available on how to programmatically access the log file in the page-hit logging API reference.

Active Channel Screen Savers

As part of the CDF file, the publisher may designate a specific URL to be downloaded as content for the Channel Screen Saver. This screen saver supports standard HTML pages, including scripting, images, Java applets, and ActiveX Controls. Screen saver content pages can include scripting and Dynamic HTML support to provide a page that dynamically changes the content, style, and position of the HTML elements on the screen. These pages are displayed on the full screen during computer idle times. The Channel Screen Saver cycles through enabled channel screen savers, allocating the same amount of display time to each one (by default, 30 seconds per channel). A channel's screen saver page is automatically included in the rotation when the channel is subscribed to, or subsequently through the Screen Saver Properties dialog box. If a user subscribes to a channel containing a screen saver page and the Channel Screen Saver isn't currently selected, the following dialog box will be displayed:

Screen Saver Confirmation

Publishers can enable a specific URL as a screen saver page by including the USAGE element in a channel's CDF file. In the following example, the HTML page at URL "http://www.foosports.com/screensaver.htm" is defined as the screen saver for the channel in which it occurs.

<ITEM HREF="http://www.foosports.com/screensaver.htm">
    <USAGE VALUE="ScreenSaver"></USAGE>
</ITEM>

Note The screen saver item's USAGE element must be a child of the top-level CHANNEL element. If the USAGE element occurs within a nested CHANNEL element representing a subchannel, the screen saver will be ignored.

Unlike many common screen savers, the user can move the mouse and click objects without immediately dismissing the Internet Explorer screen saver. Clicking a link opens a new browser window and dismisses the screen saver. Pressing a key or clicking on a location that is not an image, link, or object also closes the screen saver. Moving the mouse causes the screen saver toolbar to appear in the upper-right corner of the screen. From this toolbar, the user can close the screen saver or access the screen saver properties.

Active Channel screen saver

Category Folders

The desktop Channel Bar contains some category folders, such as News and Technology, Sports, Business, Entertainment, and Lifestyle and Travel for grouping channels that have similar types of content. When the user clicks one of these categories, the browser opens a page of all the channels in that category and their associated branded logo images. Selecting one of these channels causes the browser to navigate to the associated channel's main page. The Add Channel dialog box is automatically displayed if the user does not already subscribe to the channel.

Category folders

Developing an Active Channel

To create an Active Channel on an existing Web site, simply create a CDF file by following these steps:

  1. Design the channel.
  2. Create the logo images.
  3. Create the CDF file.
  4. Post the CDF file.
  5. Offer the new channel to users.

Design the Active Channel

When creating a CDF file, the first step is to determine the structure of the channel. The channel can be designed to represent the structure of an existing Web site, or it can be a subset of a Web site's content with a completely different hierarchy. The structure of the channel is created in the CDF with the use of the CHANNEL and ITEM elements to represent the subchannels hierarchy and HTML items (content). To prevent users from being overwhelmed with information and images, as well as to provide a uniform "look and feel" among channels, keep the following guidelines in mind:

Create the Logo Images

There are several places in the user interface where images associated with an Active Channel are displayed.

When creating a channel, Web publishers should provide appropriate images for each of these categories, although Microsoft will provide default images wherever necessary. The top-level CHANNEL element should include three LOGO child elements, one for each type of STYLE attribute, as follows:


<CHANNEL HREF="http://www.mysample.com/mainchannel.htm">
	<LOGO HREF="http://www.mysample.com/widelogo.gif" STYLE="IMAGE-WIDE"/> <!-- For Channels Explorer Bar -->
	<LOGO HREF="http://www.mysample.com/logo.gif" STYLE="IMAGE"/> <!-- For desktop Channel Bar -->
	<LOGO HREF="http://www.mysample.com/icon.gif" STYLE="ICON"/> <!-- For category folder -->
	<subitems omitted>
	.
	.
	.
</CHANNEL>

The STYLE=ICON is included in case the user places an Active Channel in a category folder. When this occurs, the channel will appear in the list of available channels in the Channels Explorer Bar when that channel folder group is selected. All other CHANNEL and ITEM elements in the CDF file should include only one LOGO child element with the STYLE=ICON attribute. When creating your image files, be sure to make the background color transparent, if applicable. It's also recommended that your image be fairly simple so that it's easy to recognize at the 16H x 16W size. Additional information about image specifications is available in the Guidelines for Active Channel Images.

Create the CDF file

When the channel structure has been designed and the logos have been created, the CDF file can be written. The CDF file must include at least one CHANNEL element and should include the SCHEDULE and LOGO elements. The ITEM element must be used to include any Web pages as part of the channel's content. As the content contained in the channel is added, removed, or modified over time, Web publishers should update the CDF file to reflect the changes. For information about using a channel creation tool, see Microsoft CDF Generator.

The CHANNEL element is used to define the top-level channel itself, along with any subitems nested within that channel. Thus, the occurrence of the <CHANNEL> and </CHANNEL> tags defines the hierarchy of the channel. The LOGO element is used to specify an image file that is displayed in the desktop Channel Bar.

Post the CDF file

After creating the CDF file, it should be posted on the Web site it describes. Typically, the file would be placed in a public folder on the Web site's HTTP server.

Offer the New Channel to Users

Finally, Web publishers need to provide a method for users to install their Active Channel (or Active Desktop item). Users will be able to add channels from three primary sources:

Although a simple HREF in an anchor (<A>) element pointing to a CDF file will initiate the channel subscription process, your page should include the Add Active Channel™ or Add to Active Desktop™ logo buttons for consistency and maximum usability. These buttons should have scripts associated with them that, when clicked, perform the proper behavior in any browser. When using the scripts in the following example, clicking the button with Internet Explorer 4.0 displays the Add Channel dialog box by linking to the CDF file. If users without Internet Explorer 4.0 click on the button, they will be directed to download the new version.

Note To use the Microsoft Add Active Channel™ button logo image or the Add to Active Desktop™ button logo image, you must sign up and accept the terms of the Active Channel Logo Agreement at http://www.microsoft.com/sbnmember/ielogo/default.asp.

Follow these steps to add the logos and scripts to your HTML page.

Step 1. Place these logo image buttons on your Web server.

Add Active Channel

Use this image to allow users to install your Active Channel.

Add to Active Desktop

Use this image to allow users to add your item to their Active Desktop.

Web publishers are encouraged to use these official Internet Explorer button logo images to provide users with a more visible, consistent, and easily recognizable method for adding Active Channels and Active Desktop items.

Step 2. Using Notepad or your favorite HTML editor, open the HTML page that will contain these logos.

Step 3. Copy and paste the following script between the <HEAD> and </HEAD> tags in the HTML page you are editing:


<!-- Begin Put this script into the head of the page -->
<script language="JavaScript">
	function isMsie4orGreater() { 
	var ua = window.navigator.userAgent;   var msie = ua.indexOf ( "MSIE " );
	if  (msie > 0)
 		{return (parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) ) >=4) && 
		(ua.indexOf("MSIE 4.0b") <0) ;}
	else {return false;}}
</script>
<!-- End   Put this script into the head of the page -->

Step 4. For each individual Add logo included on the HTML page, copy and paste the following lines of HTML:

<a name="uniqueName" 
href="http://www.microsoft.com/ie/ie40/download/?/ie/ie40/download/redirect.htm"> 
<img src="urlOfLogoImage" border=0 width=136 height=20></a>
<script language="JavaScript">
	if ( isMsie4orGreater()) { uniqueName.href ="urlToCDF"; }
</script>

Edit the script above by making the following changes:

Tip: Web publishers may also want to use Dynamic HTML to conditionally display or hide content based on whether the user has a subscription to their Active Channel.

The channel guide

Web publishers can include their Active Channels in the Internet Explorer 4.0 channel guide. This acts as a primary resource for users to find channels that match their interests. The channel guide provides users with several channel listings that are separated into the following categories:

Microsoft Active Channel partners will be listed in the guide with a 32H x 80W GIF logo image. All other channels will be listed in the guide with the channel's title only. When a user places the mouse pointer over the publisher's logo or title, a tooltip appears with the channel's description. When the user clicks the channel title or logo in the channel guide, a "Preview Page" is displayed. This page is a 365H x 460W-pixel HTML page located on the publisher's server that acts as an advertisement for all of the publisher's Webcasting offerings. The use of Dynamic HTML is strongly encouraged on this page to make the experience more interactive and engaging for the user. Similar to the "Webcasting Offerings Page" described above, the Preview Page should contain the official button and script for each Active Channel or Active Desktop item offered by the Web publisher. The logo image (where applicable), channel description, and Preview Page URL must be provided to Microsoft by the publisher to be placed in the Internet Explorer channel guide. For more information about placing your channel in the Internet Explorer 4.0 channel guide, see the Microsoft SiteBuilder Network Web site at http://www.microsoft.com/sitebuilder, or look in the channel guide itself.

CDF Sample and Explanation

The following sample CDF file shows the syntax used in the CDF, with detailed explanations in the next section. This sample is included in the \samples\channel directory, which is installed in the c:\inetsdk directory by default. To subscribe to the sample channel, follow the instructions provided in the Readme.txt file located in that directory. To subscribe to a channel on a Web page, simply click one of the channel logos in the desktop Channel Bar, or click on the Channel Guide to find a list of additional channels. To subscribe to the Internet Client SDK channel, use Internet Explorer 4.0 to navigate to http://www.microsoft.com/msdn/sdk/inetsdk/help/default.htm, and click the Add Active Channel button. Following is the sample CDF file included in the SDK.


<?XML version="1.0"?>
<CHANNEL HREF="http://www.mysite.com/Channel/homepage.htm"
	 BASE="http://www.mysite.com/Channel/">
	<TITLE>Sample "Color" Channel</TITLE>
	<ABSTRACT>The sample color channel contains a red, green, and blue page for viewing.</ABSTRACT>
	<LOGO HREF="logo_big.gif" STYLE="IMAGE-WIDE"/>
	<LOGO HREF="logo_med.gif" STYLE="IMAGE"/>
	<SCHEDULE STARTDATE="1997-09-23">
		<INTERVALTIME DAY="1" />
		<EARLIESTTIME HOUR="2" />
		<LATESTTIME HOUR="6" />
	</SCHEDULE>
   	<ITEM HREF="page1.htm">
		<LOGO HREF="red.gif" STYLE="ICON"/>
		<TITLE>The Red Page</TITLE>
		<ABSTRACT>This is the abstract description for the red page.</ABSTRACT>
	</ITEM>
	<ITEM HREF="page2.htm">
		<LOGO HREF="green.gif" STYLE="ICON"/>
 		<TITLE>The Green Page</TITLE>
		<ABSTRACT>This is the abstract description for the green page.</ABSTRACT>
   	</ITEM>
	<ITEM HREF="page3.htm">
		<LOGO HREF="blue.gif" STYLE="ICON"/>
		<TITLE>The Blue Page</TITLE>
		<ABSTRACT>This is the abstract description for the blue page.</ABSTRACT>
	</ITEM>
	<ITEM HREF="scrnsave.htm">
		<USAGE VALUE="ScreenSaver"></USAGE>
	</ITEM>
</CHANNEL>

The following section lists portions of the CDF example file and then describes the function of the elements and their associated attributes. Where possible, the effect on the user is also indicated.

<CHANNEL HREF="http://www.mysite.com/Channel/homepage.htm"
	 BASE="http://www.mysite.com/Channel/">

In this case, the CHANNEL element defines the top-level channel of the hierarchy. Every element that follows until the matching </CHANNEL> element is subordinate to this channel. The HREF attribute defines the Web page to be displayed in the browser when the channel is selected either in the desktop Channel Bar or in the Channels Explorer Bar. The BASE attribute defines the URL of the location where the channel's resources exist. This allows Web publishers to specify other URLs in the CDF file using relative paths.

<TITLE>Sample "Color" Channel</TITLE>
<ABSTRACT>The sample color channel contains a red, green, and blue page for viewing.</ABSTRACT>

The TITLE element defines the text that is associated with this channel in the browser's channel pane. The ABSTRACT element defines a text string that is displayed in a tooltip when the cursor is placed over the channel.

<LOGO HREF="logo_big.gif" STYLE="IMAGE-WIDE"/>
<LOGO HREF="logo_med.gif" STYLE="IMAGE"/>

The LOGO element marked with the "IMAGE-WIDE" style attribute is displayed in the Channels Explorer Bar, while the "IMAGE" style is shown in the desktop Channel Bar. Clicking this image results in opening the URL specified in the top-level CHANNEL element, or the channel hierarchy is shown, if applicable.

<SCHEDULE STARTDATE="1997-09-23" ENDDATE="1997-11-23">
	<INTERVALTIME DAY="1" />
	<EARLIESTTIME HOUR="2" />
	<LATESTTIME HOUR="6" />
</SCHEDULE>

The SCHEDULE element indicates how often, and during what time range, the channel should be updated. This is designed to help Web sites manage their server traffic. The example above is set to update the channel every day between 2 A.M. and 6 A.M.. This schedule information is set to expire on November 23, 1997.

<ITEM HREF="page1.htm">
	<LOGO HREF="red.gif" STYLE="ICON"/>
	<TITLE>The Red Page</TITLE>
	<ABSTRACT>This is the abstract description for the red page.</ABSTRACT>
</ITEM>

The ITEM element defines a Web page as a subitem in the sample CDF channel. This item will be displayed in the channel's hierarchy exposed in the Channels Explorer Bar, along with the "ICON" image specified in the LOGO element.

<ITEM HREF="scrnsave.htm">
	<USAGE VALUE="ScreenSaver"></USAGE>
</ITEM>

This occurrence of the ITEM element (along with USAGE)defines the URL of an HTML page to be displayed in the Channel Screen Saver page. The ITEM and USAGE elements can also be used to define an HTML page as an Active Desktop item. These items can contain any valid HTML elements, like images, ActiveX Controls, Java applets, and so on, and can be placed directly on the desktop with Internet Explorer 4.0. For more information on Active Desktop items, review the documentation for Creating Items for the Active Desktop.

</Channel>

This end tag indicates that the definition of the sample CDF channel is complete.

Optimizing Active Channels over HTTP

Web publishers are strongly encouraged to follow the size guidelines discussed in the Design Guidelines for Active Channels section. In addition to considering bandwidth issues, Web publishers should support the HTTP headers listed below to ensure efficient use of their site by eliminating unnecessary data transfer.

Guidelines for Active Channel Logo Images

The guidelines listed in this section are provided to help Web publishers create useful and compelling logos that represent their channel content. When creating images, be aware that the logos will be displayed with a fixed 256-color palette, regardless of the monitor's color depth. Therefore, we recommend using the Microsoft® Windows® halftone palette if possible. The height (H) and width (W) of the images described in these guidelines are assumed to be in pixels.

Active Channel Logos

Internet Explorer 4.0 uses different logo sizes for channels displayed on the desktop and channels displayed inside the browser window, as previously discussed. The desktop Channel Bar logo is 32H x 80W, and the Channels Explorer Bar logo is 32H x 194W. When a user resizes the width of the Channels Explorer Bar beyond 194 pixels, the remaining area on the right side of the 32H x 194W logo will be filled in with the rightmost top pixel. If only the 32H x 80W image is provided, it will be displayed in both places—on the desktop and inside the browser window. When displayed in the browser window Channels Explorer Bar, the remaining area on the right side of the logo will be filled in with the same color as the leftmost top pixel. The 32H x 80W logo for the desktop must have a black background, while the logo for the browser should use a colored background. To specify the logos in the CDF file, the following format is used.

For the 32H x 80W logo:

<LOGO HREF="example.gif" STYLE="Image">

For the 32H x 194W logo:

<LOGO HREF="example-wide.gif" STYLE="Image-Wide">

For the 16H x 16W icon images:

<LOGO HREF="example-icon.gif" STYLE="Icon">

Logo Image Descriptions

Desktop Channel Bar Logos

The desktop Channel Bar will display the smaller logo (32H x 80W) for each available channel. To match the visual elements used on the desktop, a black background is required for each logo. All logos in the desktop Channel Bar will be shown at the same time. The illustration below shows the hot tracking behavior for when a user moves the mouse over a logo. As the cursor is placed on an image in the desktop Channel Bar, the border around the logo will surface into a 3-D button, much like other toolbars within Internet Explorer 4.0. This behavior helps make the desktop Channel Bar look like a well- integrated part of the product.

Desktop Channel Bar

Channels Explorer Bar Logos

Inside the Browser window, Internet Explorer 4.0 will use the full width logo (32H x 194W) in the Channels Explorer Bar. By default, only the channel name is displayed in white text on a black background for each channel. However, when the user moves the mouse over an item, it will hot-track to show the logo for that item. We recommend using a color background for the large logo. If a user clicks on a channel to activate it, that logo will remain visible. This allows users to easily determine the current channel because they aren't distracted with logos from other channels.

Channels Explorer Bar

Icons with Visual Clues

When designing your icons, use different images, colors, or shapes to indicate whether an item is a container for other subitems or is actual content. This will help the user to discover your channel's content.

Icon Types

Update Gleams

The channel bar provides the user with a 14H x 14W "gleam" to indicate when content has been updated. This gleam is a triangular overlay applied to the upper-left corner of a channel logo. When authoring images for any size, it's important not to place critical text or visual elements in this area, as it will be covered when the gleam is visible. Gleams are also overlaid on any 16H x 16W icon in the channel's hierarchy when that page has been updated. The gleam placed on icons is 7H x 7W.

Gleam Notifications

Guideline Summary for Active Channel Images

Using Dynamic HTML with Active Channels

A variety of Dynamic HTML features can be used to modify the appearance of a Web page, including changing the text or images that are displayed. As an example, the following steps show how a publisher might use the window.external.isSubscribed() method to hide an Add Active Channel logo button if its associated channel is already subscribed.

Assuming the Add Active Channel button was placed on a Web page as previously described, the page would include the following Add Active Channel button:

<a name="channelA"
href="http://www.microsoft.com/ie/ie40/download/?/ie/ie40/download/redirect.htm"> <img src="IEAddChannel.gif" border=0 width=136 height=20></a>
<script language="JavaScript"> 
	if ( isMsie4orGreater()) { channelA.href ="urlToCDF"; }
</script> 

Step 1. Add the ID attribute to the anchor element. The value must be unique.

<a name="channelA" id="idA"
href="http://www.microsoft.com/ie/ie40/download/?/ie/ie40/download/redirect.htm"> <img src="IEAddChannel.gif" border=0 width=136 height=20></a>
<script language="JavaScript"> 
	if ( isMsie4orGreater()) { channelA.href ="urlToCDF"; }
</script>

Step 2. Include the following script between the page's <HEAD></HEAD> tags. Note that the isMsie4orGreater() function should already exist in the HEAD section of this page.

<SCRIPT LANGUAGE="JavaScript">
function HideIfSubscribed(elementID, urlToCDF){
if (window.external.isSubscribed(urlToCDF)) {ss.addRule("#"+ elementID,"visibility: hidden");}}

var ss = null;
ss = document.createStyleSheet()
if(isMsie4orGreater()){ //Test if the browser is IE
// For each element you wish to conditionally hide, include the following line
// (uniqueID is the unique value for the ID attribute of the element and
// urlToCDF is the URL to the channel's CDF).
HideIfSubscribed("uniqueID","urlToCDF");
}
</SCRIPT>

When using these scripts, remember that the URLs of the channels must include the same protocol and secondary domain name as the page that contains the scripts. Also, any element in Dynamic HTML that has the visibility property can be hidden using the same code.

The following HTML page shows a full example of the scripting shown above.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
		function isMsie4orGreater() { 
			var ua = window.navigator.userAgent;   var msie = ua.indexOf ( "MSIE " );
			if  (msie > 0)
				{return (parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) ) >=4) && (ua.indexOf("MSIE 4.0b") <0) ;}
			else    {return false;}}

		function HideIfSubscribed(elementID, urlToCDF){
			if (window.external.isSubscribed(urlToCDF)) {ss.addRule("#"+ elementID,"visibility: hidden");}}

		var ss = null;
		if(isMsie4orGreater()){ //Test if the browser is IE
			ss = document.createStyleSheet()
			HideIfSubscribed("idA","http://www.mycorp.com/channelA.cdf");
		}
	</SCRIPT>
</HEAD>


<BODY>
<a name="channelA" id="idA"
href="http://www.microsoft.com/ie/ie40/download/?/ie/ie40/download/redirect.htm"> <img src="IEAddChannel.gif" border=0 width=136 height=20></a>
<script language="JavaScript"> 
	if ( isMsie4orGreater()) { channelA.href ="urlToCDF"; }
</script>

</BODY>
</HTML>

If the Web page contains more than one Add Active Channel or Add to Active Desktop logo button, the name and ID attributes must be unique.

Netcaster CDF Compatibility Notes

Due to the similarities between HTML and the Channel Definition Format, other browsers might be able to perform site crawling on a CDF file. This section describes the CDF file compatibility issues related to the release of Netscape Netcaster. For more information about CDF files and the implementation of this standard, see Microsoft's Webcasting White Paper.

Site Crawling a CDF File

Site crawling is the process of a browser proceeding through the following steps:

  1. Retrieve an HTML page.
  2. Store that page locally on a user's computer.
  3. Find the links (anchors) in the HTML page.
  4. Repeat this process from step 1 for each link (anchor) to an HTML page.
  5. Stop the above process when the browser has run out of links to follow or when the process has repeated enough times based on some criteria.
  6. Retrieve the actual content for each link to a non-HTML document, such as an image file or a text file.

Netcaster can use CDF files only toward site crawling and not for full CDF processing. For this to happen, Netcaster must use a CDF file as though it is an HTML page. The key to a browser site crawling CDF files lies in the anchor (A) element, which defines links in HTML.

<A HREF="http://www.microsoft.com/">Visit Microsoft!</A>

This element identifies links for browsers to follow when site crawling. The anchor element can be found inside ITEM and CHANNEL elements of a CDF file. The HREF attribute of these anchor (A) elements identify which HTML pages are displayed when items and channels are selected.

<CHANNEL>
    <A HREF="http://www.microsoft.com/cover.htm"></A>
    <ITEM>
        <A HREF="http://www.microsoft.com/page1.htm"></A>
        <TITLE>Page 1</TITLE>
    </ITEM>
</CHANNEL>

When a browser uses the above CDF section as an HTML page for site crawling, it identifies the links "http://www.microsoft.com/cover.htm" and "http://www.microsoft.com/page1.htm". How the remaining content of the CDF file is used by the browser is less important. Some of it will be rendered, while most of it is ignored. In the majority of circumstances, a CDF file will never be displayed as HTML; it will simply be used for site crawling.

It is important to note that because Netcaster does not take advantage of the BASE attribute in a CDF file, relative URLs will be resolved by Netcaster against the base URL of the CDF file itself rather than the BASE attribute. For this reason, it is suggested that when authoring a CDF file for both Netcaster and Internet Explorer, either omit BASE attributes or make sure their value is the base URL of the CDF file itself. For example, if the CDF http://msn.com/channels/channel2.cdf has any BASE attributes, they should have the value "http://msn.com/channels/".

MIME Types and Extensions

For Netcaster to use a CDF file toward site crawling, it must process the file as an HTML file. To process the CDF file as HTML, one of the following three criteria must be met:

After one of these criteria has been met, a Netcaster user can subscribe to a channel defined by a CDF file. The user simply proceeds in the usual manner when subscribing to any Web page, except entering the URL of the CDF file.

Netcaster CDF Site Subscriptions

In Netcaster, when a user subscribes to a channel by specifying the URL of a CDF file created through the mentioned methods, the initial page for the channel will not be a normal HTML page. Instead, it will be a CDF file rendered as an HTML page and will probably not appear as desired. To remedy this situation, a channel author can create an intermediate HTML page to represent the channel content along with a reference to the CDF file. This can be achieved using Netscape's LAYER tag. A hidden LAYER tag referencing the new CDF file is inserted into the desired initial HTML as follows:

<LAYER SRC="cdf_file.htm" VISIBILITY=HIDDEN></LAYER> 

With this additional work, a user can use the URL of the intermediate HTML page rather than the URL to the CDF file when subscribing to a channel in Netcaster. To enable Netcaster to automatically subscribe to a CDF channel, script can be inserted into the intermediate HTML page as specified in Netscape documentation. This would allow a CDF channel to be subscribed to when a user clicks a button on the intermediate HTML page. The following examples show a CDF file and an intermediate HTML page that could be used with Netcaster.

A CDF file named "cdf_file.cdf":

<?XML VERSION="1.0"?>
<CHANNEL HREF="http://msn.com/default.htm">
    <ABSTRACT>This channel was created using the proposed CDF standard.</ABSTRACT>
    <LOGO HREF="http://msn.com/logo.gif" STYLE="IMAGE" >
    <SCHEDULE> <INTERVALTIME DAY="1" /> </SCHEDULE>
    <!-- the following items are needed for offline use -->
    <ITEM> <A HREF="http://msn.com/page1.html"></A> </ITEM>
    <ITEM> <A HREF="http://msn.com/page2.html"></A> </ITEM>
    <ITEM> <A HREF="http://msn.com/page3.html"></A> </ITEM>
</CHANNEL>

An intermediate Netcaster-compatable HTML page named "channel.htm" is provided below. This page references a copy, named "cdf_file.htm", of the above CDF file.

<HTML>
<BODY>

<LAYER SRC="cdf_file.htm" VISIBILITY=HIDDEN></LAYER>

<SCRIPT language="JavaScript1.2" >

var nc = components["netcaster"];
nc.activate();
var chan = nc.GetChannelObject();
chan.url = "http://msn.com/channel.htm";
chan.name = "My Channel";	
chan.desc = "This Channel was created using JavaScript API extensions";
chan.cardURL = "http://msn.com/logo.gif";
function openDialog() { nc.AddChannelObject(chan); }

</SCRIPT>

</BODY>
</HTML>

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.