Creating the Feed Data Source Application Class

The feed data source application class manages all aspects of data collection and data security. This application class encapsulates all business logic about how to define feed definitions and how to gather feed data.

This section discusses the steps involved to create a feed data source application class for your new feed data type.

Implement a new class that extends the PTFP_FEED:DataSource:DataSource base class.

Image: PTFP_FEED application package showing the DataSource base class

This example illustrates the DataSource base class in the PTFP_FEED application package.

PTFP_FEED application package showing the DataSource base class

See Creating Application Packages.

When implementing the methods of the DataSource class, consider these method types:

  • Required methods

  • Recommended methods

  • Optional methods

Required Methods

This table describes the DataSource methods that you must implement:

Method

Purpose

clone

Clone the data source object.

getContentUrl

Return the feed content URL.

getDataSecurity

Return the allowed list of viewer roles, permission lists, or both.

isCurrentUserAuthorized

Validate whether the current user has permission to view the feed.

initializeSettings

Initialize the data source setting collection and other class properties.

processSettingsChange

Validate data source setting values and generate a data source parameter list accordingly.

execute	

Collect data based on user permissions and fill in the feed document.

Recommended Methods

This table describes the DataSource methods that you should consider implementing:

Method

Purpose

isCurrentUserAdmin

Validate whether the current user has permission to administer the feed.

copyProperties

The clone method uses protected methods for copying class properties.

Optional Methods

This table describes the DataSource methods that you might consider implementing:

Method

Purpose

onSave

Perform tasks after saving the feed definition.

onDelete

Perform tasks before deleting the feed definition.

getSettingDetail

Return data source setting details as HTML.

getParameterDetail

Return data source parameter details as HTML.

You should use these protected methods to set read-only flags:

  • setDataSourceType

  • setSettingsCompleted

  • setAllowRealTimeFeedSecurity