Setting Channel Usage

With the <USAGE> element, you can set various ways of using channels beyond active channels. To determine the usage of a channel, you assign a value to the VALUE attribute from this list:

ValueDescription
ChannelThe default. The items in a channel appear in the browser's Favorites bar.
DesktopComponentItems displayed directly on the desktop in Active Desktop installations.
EmailThe parent element that will be emailed to the user when updated.
NoneItem will not appear in the Favorites bar.
ScreensaverItem that is a screen saver.
SoftwareUpdateItem that is a software update.

We've already seen the default value, "Channel" at work. Using the "None" value just turns the item off as far as channels go. I'll take a look at the other possibilities here.

Updating Desktop Components

In Microsoft Active Desktop installations, desktop components are displayed directly on the Windows desktop and can be updated automatically. For example, say that some users want to keep tabs on all the major planets and want images continually updated on their desktops of those planets.

Here's how you might implement that, updating the image of Mercury every 20 minutes; note the child elements of <USAGE> in this case—<WIDTH>, <HEIGHT>, <OPENAS>, and <CANRESIZE>:

<?xml version="1.0"?>
<CHANNEL HREF="http://www.starpowder.com/planets.html">
    <TITLE>
        Planetary Images
    </TITLE>
    <ABSTRACT>
        These are updated planetary images.
    </ABSTRACT>

    <ITEM
        HREF="http://www.starpowder.com/mercury.gif">
        <TITLE>Image of Mercury</TITLE>
        <SCHEDULE TIMEZONE="-0800">
            <INTERVALTIME MIN="20"/>
            <EARLIESTTIME HOUR="0"/>
            <LATESTTIME HOUR="23"/>
        </SCHEDULE>
        
<USAGE VALUE="DesktopComponent">
            <WIDTH VALUE="400"/>
            <HEIGHT VALUE="400"/>
            <OPENAS VALUE="Image"/>
            <CANRESIZE VALUE="No"/>
        </USAGE>
    </ITEM>
</CHANNEL>
					

Updating Through Email

You can also indicate how to handle email updates; in this case, you can set the usage to "Email", which means that the parent item will be sent to the user in email. For example, here's how I indicate that I want update.html sent to the user when updates occur:

<?xml version="1.0"?>
<CHANNEL HREF="http://www.starpowder.com/planets.html">
    <TITLE>Planets</TITLE>

    <LOGO HREF="http://www.starpowder.com/icon.gif" STYLE="ICON"/>
    <LOGO HREF="http://www.starpowder.com/image.gif" STYLE="IMAGE"/>
    <LOGO HREF="http://www.starpowder.com/image-wide.gif" STYLE="IMAGE-WIDE"/>

    <SCHEDULE TIMEZONE="-0800">
        <INTERVALTIME DAY="5"/>
        <EARLIESTTIME HOUR="3" TIMEZONE="-0800"/>
        <LATESTTIME HOUR="5" TIMEZONE="-0800"/>
    </SCHEDULE>

    <ITEM HREF="update.html">
        <USAGE VALUE="Email"/>
    </ITEM>

    <ITEM HREF="mercury.html">
        <TITLE>All about Mercury</TITLE>
        <ABSTRACT>
            All planetary information for
            Mercury, including orbital specifications.
        </ABSTRACT>
    </ITEM>
    .
    .
    .
</CHANNEL>
					

Updating Screen Savers

If you set the usage of an item to "Screensaver", that HTML page will be downloaded and used as the new screen saver. To use this option, the user must have selected the "Channel Screen Saver" as the current screen saver, as shown in Figure 18.9; if the user has not, Windows will ask whether to do so when the screen saver's CDF file is opened.

Figure 18.9. Selecting a channel screen saver.


Here's an example where I'm adding a screen saver (you can set only one per CDF file) to planets.cdf:

<?xml version="1.0"?>
<CHANNEL HREF="http://www.starpowder.com/planets.html">
    <TITLE>Planets</TITLE>

    <LOGO HREF="http://www.starpowder.com/icon.gif" STYLE="ICON"/>
    <LOGO HREF="http://www.starpowder.com/image.gif" STYLE="IMAGE"/>
    <LOGO HREF="http://www.starpowder.com/image-wide.gif" STYLE="IMAGE-WIDE"/>

    <SCHEDULE TIMEZONE="-0800">
        <INTERVALTIME DAY="5"/>
        <EARLIESTTIME HOUR="3" TIMEZONE="-0800"/>
        <LATESTTIME HOUR="5" TIMEZONE="-0800"/>
    </SCHEDULE>

    <ITEM HREF="http://www.starpowder.com/planets.gif">
        <USAGE VALUE="ScreenSaver"/>
    </ITEM>
    <ITEM HREF="mercury.html">
        <TITLE>All about Mercury</TITLE>
        <ABSTRACT>
            All planetary information for
            Mercury, including orbital specifications.
        </ABSTRACT>
    </ITEM>
    .
    .
    .
</CHANNEL>
					

Updating Software

You can also update software packages automatically using the <USAGE> element in CDF files and setting its VALUE attribute to "SoftwareUpdate". You also must indicate what you want to have happen, using Open Software Description (OSD) in a special element, <SOFTPKG>. You can learn more about OSD here:

Here's an example; in this case, I'll set up updating for a software package named StarGazerKing. The actual installation uses Cabinet (CAB) files of the type that the Microsoft Visual Studio products such as Visual Basic create. I'm listing three alternate CABs, one for each of three operating systems—you can add a <SCHEDULE> element if you want the browser to check for updates regularly:

<?xml version="1.0"?>
<CHANNEL HREF="http://www.starpowder.com/planets.html">
    <TITLE>StarGazerKing Update</TITLE>
    <ABSTRACT>
        StarGazerKing now comes with a spellchecker!
    </ABSTRACT>

    <USAGE VALUE="SoftwareUpdate"/>

    <SOFTPKG NAME="StarGazerKing"
        AUTOINSTALL="No"
        VERSION="2, 1, 0, 0"
        STYLE="ActiveSetup">

        <TITLE>StarGazerKing</TITLE>
        <ABSTRACT>
            StarGazerKing now comes with spellchecking,
            and it'll increase your productivity greatly!
        </ABSTRACT>

        <IMPLEMENTATION>
            <OS VALUE="win95" />
            <CODEBASE HREF="http://www.starpowder.com/cabs/sgk95.cab">
        </IMPLEMENTATION>

        <IMPLEMENTATION>
            <OS VALUE="winnt" />
            <CODEBASE HREF="http://www.starpowder.com/cabs/sgknt.cab">
        </IMPLEMENTATION>

        <IMPLEMENTATION>
            <OS VALUE="mac" />
            <CODEBASE HREF="http://www.starpowder.com/cabs/sgkmac.cab">
        </IMPLEMENTATION>

    </SOFTPKG>

</CHANNEL>

Windows will ask users whether they want the update to take place because I set AUTOINSTALL to "No"; you can set it to "Yes" to make the installation automatic, but that also has the potential of making users angry because they'll be installing new versions of software without their consent. I suggest that you avoid automatic installation. There are a great many more options here—if you are interested, take a look at the software update material on the Microsoft CDF sites.

That completes our look at RDF and CDF, two popular XML applications. In the next chapter, I'll take a look at another XML application: VML.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.1.51