FeedDoc Class Methods

In this section, the FeedDoc class methods are presented in alphabetical order.

Syntax

addCategory(category)

Description

Use this method to add a category attribute to the feed document as a string.

Note: This is an abstract method.

Parameters

Field or Control

Definition

category

Specifies the category as a string.

Returns

A Boolean value: True if the add was successful, False otherwise.

Syntax

addEntry(entry_ID)

Description

Use this method to create a FeedEntry object with the given ID.

Note: This is an abstract method.

Parameters

Field or Control

Definition

entry_ID

Specifies the ID of the feed entry as a string.

Returns

A FeedEntry object if successful, False otherwise.

Example

import PTFP_FEED:FeedFactory;
import PTFP_FEED:XML_FEED:FeedDoc;
import PTFP_FEED:XML_FEED:FeedEntry;

Local boolean &succeeded;
Local array of string &tempArray;

Local PTFP_FEED:FeedFactory &thisFeedFactory = create PTFP_FEED:FeedFactory();
Local PTFP_FEED:XML_FEED:FeedDoc &thisFeedDoc = &thisFeedFactory.Utility.getFeedDoc("feed_ID", &thisFeedFactory.Utility.FEEDFORMAT_ATOM10, Null);
Local PTFP_FEED:XML_FEED:FeedEntry &thisEntry = &thisFeedDoc.addEntry("entry_ID");

&thisEntry.Title = &contentTitle;
&thisEntry.Description = &contentEntryDesc;
&succeeded = &thisEntry.addCategory(&contentFolderTitle);
&thisEntry.ContentUrl = &contentUrl;
&thisEntry.GUID = &contentUrl;
&thisEntry.Published = &contentCreatedDateTime;
&thisEntry.Updated = &contentLastUpdatedDateTime;
&thisEntry.Author = &thisFeedFactory.Utility.getUserInfo(&contentCreatedByOprid);
&tempArray = &thisFeedFactory.Utility.getUserInfo(&contentLastUpdatedByOprid);
&succeeded = &thisEntry.addContributor(&tempArray [1], &tempArray [2]);
&succeeded = &thisEntry.addEnclosure(&contentAttachmentUrl, "application/octet-stream", 123456);

Syntax

datetimeToString(Datetime)

Description

Use this method to transform a DateTime value to a string in a feed-specific format— for example, in the “yyyy-MM-dd HH:mm:ss.SSS” format.

Note: This is an abstract method.

Parameters

Field or Control

Definition

Datetime

Specifies the DateTime value to be transformed.

Returns

A string in a feed-specific format or an empty string if the DateTime value is empty.

Syntax

deleteCategory(category)

Description

Use this method to delete a category attribute from a FeedDoc object.

Note: This is an abstract method.

Parameters

Field or Control

Definition

category

Specifies the category as a string.

Returns

A Boolean value: True if the delete was successful, False otherwise.

Syntax

deleteEntry(entry_ID)

Description

Use this method to delete the feed entry and the FeedEntry object with the given ID.

Parameters

Field or Control

Definition

entry_ID

Specifies the ID of the feed entry as a string.

Returns

A Boolean value: True if the delete was successful, False otherwise.

Syntax

equals(&Object)

Description

Use this method to evaluate the equivalency of an object with the current feed document. Equivalency is established based on the value of two properties: the object's ID and the ObjectType.

Parameters

Field or Control

Definition

&Object

Specifies the object to be compared to the current FeedDoc object.

Returns

A Boolean value: True if the items are equivalent, False otherwise.

Syntax

getEntry(entry_ID)

Description

Use this method to return a FeedEntry object with the given ID.

Parameters

Field or Control

Definition

entry_ID

Specifies the ID of the feed entry as a string.

Returns

A FeedEntry object if successful, Null otherwise.

Syntax

resetEntries()

Description

Use this method to reset the FeedEntry collection.

Parameters

None.

Returns

An empty FeedEntry collection.

Syntax

stringToDatetime(DatetimeString)

Description

Use this method to covert a date/time string of a feed-specific format to a DateTime value.

Note: This is an abstract method.

Parameters

Field or Control

Definition

DatetimeString

Specifies the string to be converted to a DateTime value.

Returns

A DateTime value.