UpdateChannels

From HotDocs Wiki

Jump to: navigation, search

The UpdateChannels object represents a collection of UpdateChannel objects that make up the HotDocs update RSS document (RSS feed).

CAUTION: Although RSS specifications allow for multiple channels in an RSS feed, HotDocs update RSS documents should contain only one channel.

Contents

General Information

ProgID: HDNET.UpdateChannels.1
HDNET.UpdateChannels (version-independent)
CLSID: {6B64828D-7104-43B7-A4F6-A76DBE24E4F2}

Members

Methods
Method.gifAdd(newItem) Adds a new UpdateChannel to the collection. (Because HotDocs recognizes only one channel, you should add only one channel to the collection.)
newItem: An UpdateChannel object to add to the UpdateChannels collection.
Method.gifItem(index) Returns the specified UpdateChannel from the collection. (Normally 0 because HotDocs update RSS documents should contain only one channel.)
index: A long index to specify which item to return from the collection.
Properties
Property.gifCount Returns the number of UpdateChannel objects in the collection. (Normally 1 because HotDocs update RSS documents should contain only one channel.) [Read-only]

Example Code

Example of Creating an Update Document (Visual Basic)
Dim rss As New HDNETLib.UpdateDocumentClass
Dim rssChannel As New HDNETLib.UpdateChannelClass
Dim updateItem As HDNETLib.UpdateItemClass
rssChannel.title = "Hobble Creek Real Estate Forms" rssChannel.description = "Serving you since 1994" rssChannel.link = "http://www.HobbleCreek.com/update.rss"
'First Update Item updateItem = New HDNETLib.UpdateItemClass updateItem.required = True updateItem.title = "Real Estate Purchase Contract (REPC)" updateItem.link = "http://www.HobbleCreek.com/repc.hdi" updateItem.description = "This is the new form adopted by the State Real Estate Commission." updateItem.guid = "00001" updateItem.category = "File Update" updateItem.pubDate = System.DateTime.Now rssChannel.items.Add(updateItem)
'Second Update Item updateItem = New HDNETLib.UpdateItemClass updateItem.required = True updateItem.title = "Visit the new Hobble Creek Real Estate Web Site" updateItem.link = "http://www.HobbleCreek.com" updateItem.description = "New features are added daily" updateItem.guid = "00002" updateItem.category = "Message" updateItem.pubDate = System.DateTime.Now rssChannel.items.Add(updateItem)
'Third Update Item updateItem = New HDNETLib.UpdateItemClass updateItem.required = True updateItem.title = "Happy Holidays" updateItem.description = "Wishing you a happy holiday season from your friends at Hobble Creek Real Estate" updateItem.guid = "00003" updateItem.category = "Message" updateItem.pubDate = System.DateTime.Now rssChannel.items.Add(updateItem)
'Add channels collection to the update document and save. rss.channels.Add(rssChannel) rss.Save("c:\\example.rss")
Example of Creating an Update Document (Visual C#)
HDNETLib.UpdateDocumentClass rss = new HDNETLib.UpdateDocumentClass();
HDNETLib.UpdateChannel rssChannel = new HDNETLib.UpdateChannelClass();
HDNETLib.UpdateItemClass updateItem;
rssChannel.title = "Hobble Creek Real Estate Forms"; rssChannel.description = "Serving you since 1994"; rssChannel.link = "http://www.HobbleCreek.com/update.rss";
//First Update Item updateItem = new HDNETLib.UpdateItemClass(); updateItem.required = true; updateItem.title = "Real Estate Purchase Contract (REPC)"; updateItem.link = "http://www.HobbleCreek.com/repc.hdi"; updateItem.description = "This is the new form adopted by the State Real Estate Commission."; updateItem.guid = "00001"; updateItem.category = "File Update"; updateItem.pubDate = System.DateTime.Now; rssChannel.items.Add(updateItem);
//Second Update Item updateItem = new HDNETLib.UpdateItemClass(); updateItem.required = true; updateItem.title = "Visit the new Hobble Creek Real Estate Web Site"; updateItem.link = "http://www.HobbleCreek.com"; updateItem.description = "New features are added daily"; updateItem.guid = "00002"; updateItem.category = "Message"; updateItem.pubDate = System.DateTime.Now; rssChannel.items.Add(updateItem);
//Third Update Item updateItem = new HDNETLib.UpdateItemClass(); updateItem.required = true; updateItem.title = "Happy Holidays"; updateItem.description = "Wishing you a happy holiday season from your friends at Hobble Creek Real Estate"; updateItem.guid = "00003"; updateItem.category = "Message"; updateItem.pubDate = System.DateTime.Now; rssChannel.items.Add(updateItem);
//Add channels collection to the update document and save. rss.channels.Add(rssChannel); rss.Save("c:\\example.rss");
Example for Adding a New Update Item to a HotDocs Update RSS Document (Visual C#)
HDNETLib.UpdateDocumentClass rss = new HDNETLib.UpdateDocumentClass();
HDNETLib.UpdateChannel rssChannel = new HDNETLib.UpdateChannelClass();
HDNETLib.UpdateItemClass updateItem;
rssChannel.title = "Hobble Creek Real Estate Forms"; rssChannel.description = "Serving you since 1994"; rssChannel.link = "http://www.HobbleCreek.com/update.rss";
//First Update Item updateItem = new HDNETLib.UpdateItemClass(); updateItem.required = true; updateItem.title = "Real Estate Purchase Contract (REPC)"; updateItem.link = "http://www.HobbleCreek.com/repc.hdi"; updateItem.description = "This is the new form adopted by the State Real Estate Commission."; updateItem.guid = "00001"; updateItem.category = "File Update"; updateItem.pubDate = System.DateTime.Now; rssChannel.items.Add(updateItem);
//Second Update Item updateItem = new HDNETLib.UpdateItemClass(); updateItem.required = true; updateItem.title = "Visit the new Hobble Creek Real Estate Web Site"; updateItem.link = "http://www.HobbleCreek.com"; updateItem.description = "New features are added daily"; updateItem.guid = "00002"; updateItem.category = "Message"; updateItem.pubDate = System.DateTime.Now; rssChannel.items.Add(updateItem);
//Third Update Item updateItem = new HDNETLib.UpdateItemClass(); updateItem.required = true; updateItem.title = "Happy Holidays"; updateItem.description = "Wishing you a happy holiday season from your friends at Hobble Creek Real Estate"; updateItem.guid = "00003"; updateItem.category = "Message"; updateItem.pubDate = System.DateTime.Now; rssChannel.items.Add(updateItem);
//Add channels collection to the update document and save. rss.channels.Add(rssChannel); rss.Save("c:\\example.rss");
Example for Finding the Number of Channels in an Update Document (Visual C#)
//This example opens an existing RSS document and reports how many
//channels are found.
HDNETLib.UpdateDocumentClass rss = new HDNETLib.UpdateDocumentClass();
//Open the existing RSS document rss.Parse("C:\\example.rss");
//Report the number of channels found if (rss.channels.Count > 1) { System.Console.WriteLine("Error! There are more channels ({0}) in this document than expected.", rss.channels.Count.ToString()); } else { System.Console.WriteLine("Number of channels: {0}", rss.channels.Count.ToString()); }