UpdateItem

From HotDocs Wiki

(Redirected from UpdateItem Object)
Jump to: navigation, search

The UpdateItem object represents a single HotDocs update item, which may be an update to template files or a message to your users.

Contents

General Information

ProgID: HDNET.UpdateItem.1
HDNET.UpdateItem (version-independent)
CLSID: {1BACC645-FB55-4237-B947-0F87DC33FCD4}
Methods
Method.gifMarshallObject() Causes the object to be marshalled and returns a string. [For internal HotDocs use only.]
Method.gifUnMarshallObject(revVal) Unmarshalls the object. [For internal HotDocs use only.]
retVal: A string representing the object to unmarshall.
Properties
Property.gifcategory Indicates the type of update item. It can be one of the following two values: File Update (installs a HotDocs Auto-Install (.HDI) file) or Message (displays a message, or links to a Web page). [Read/Write]
Property.gifdescription A description of the update item. If a message update does not include a link, HotDocs displays this description when the user applies the update. [Read/Write]
Property.gifguid A string that uniquely identifies this update item. It must be different for each update item within a template set. [Read/Write]
Property.giflink The URL for the update item. For file updates, this is the URL for a HotDocs Auto-Install (.HDI) file. For message updates, this is either the URL for a Web site you want users to visit, or it can be empty if you just want to display a simple message. (In this case, HotDocs will use the description as the message.) [Read/Write]
Property.gifpubDate The date on which the update item was published. When HotDocs reads an update document (RSS feed), it ignores any items with a publication date earlier than the publication date in the catalog (.HCAT) file. [Read/Write]
Property.gifrequired A Boolean value that indicates if an item is required, which means that end users cannot discard (hide) the update. HotDocs does not force users to install the update, but it will appear in the list of updates every time HotDocs checks for updates until it has been installed. [Read/Write]
Property.gifstatus Indicates the status of the update item. [For internal HotDocs use only.] [Read/Write]
Property.giftitle The title of the update item. For example, if you update your template set monthly, the title may include the month in which the update is released. If the update fixes a problem with a particular template, the title may include the name of the template. [Read/Write]

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");