Developing New Feed Data Types

This chapter discusses how to:

Click to jump to parent topicAnalyzing Requirements for New Feed Data Types

Consider these tasks when developing new feed data types:

Click to jump to parent topicCreating the Feed Data Source Application Class

The feed data source application class manages all aspects of data collection and data security.

To create the feed data source application class:

Click to jump to top of pageClick to jump to parent topicExtending the Base Class

Access and extend the PTFP_FEED:DataSource:DataSource base class.

See Creating Application Packages and Classes.

Click to jump to top of pageClick to jump to parent topicImplementing the Methods

Consider these method types:

Required Methods

This table describes the 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 and/or permission lists

isCurrentUserAuthorized

Validate whether the current user has viewer permission of the feed

initializeSettings

Initialize data source setting collection and other class properties

processSettingsChange

Validate data source setting values, and generate data source parameter list accordingly

execute

Collect data based on user permission, and fill in the feed document

Recommended Methods

This table describes the methods that you should consider implementing:

Method

Purpose

isCurrentUserAdmin

Validate whether the current user has administration permission for the feed.

copyProperties

The clone method uses protected methods for copying class properties.

Optional Methods

This table describes the 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.

Click to jump to top of pageClick to jump to parent topicSetting Flags by Using Protected Methods

You should set flags by using these methods:

Click to jump to parent topicDefining the Feed Data Type

This section lists the steps for defining feed data types and discusses how to:

Click to jump to top of pageClick to jump to parent topicPage Used to Define Feed Data Types

Page Name

Definition Name

Navigation

Usage

Define Feed Data Types

PTFP_DATATYPE

PeopleTools, Feeds, Define Feed Data Types

Define feed data types.

Click to jump to top of pageClick to jump to parent topicSteps for Defining Feed Data Types

You complete these steps to define feed data types:

  1. Select PeopleTools, Feed, Define Data Types.

  2. Specify the data source application class.

  3. Select service operations to be used by feeds of this data type, and specify the default service operation.

  4. Specify the default feed head level attributes for feeds of this data type.

  5. (Optional) Click the Publish as Feed link to create a Feed List feed, which lists all feeds of this data type accessible by the user.

Click to jump to top of pageClick to jump to parent topicDefining Feed Data Types

Access the Define Feed Data Types page (PeopleTools, Feeds, Define Feed Data Types).

PeopleSoft applications contain four delivered feed data types: FEED, GENERICFEED, PSQUERY, and WORKLIST. To create a new feed data type, use Add New Value from the search page.

Data Type

The type of feed that you are creating or editing. This field is display only.

Description

Enter a short description of the type of feed. You may enter up to 30 characters.

Long Description

Enter a long description of the type of feed to clearly clarify its purpose. You may enter up to 255 characters.

Active

Select to activate the feed definition.

Default Feed Properties

Not all readers display all properties. This table describes the default feed properties that some feed readers process and display.

Note. These are default properties. You may change any of these default properties at the individual feed level.

Copyright

Enter copyright information to be included in the XML.

Logo

Enter a URL to the logo to be included in the XML, for example, http://myserver.com/img/logo.gif.

Icon

Enter a URL to an icon to be included in the XML, for example, http://myserver.com/img/icon.gif.

Author Name

Enter an author to be included in the XML.

Author Email

Enter an author email address to be included in the XML.

Contributor Name

Enter a contributor to be included in the XML.

Contributor Email

Enter a contributor email address to be included in the XML.

Supporting Application Class

Package Name

Enter the application class package name that you want to use for the data type.

Each Feed Data Type application class should be associated with one Feed Data Type service operation.

Path

Enter the application class path that you want to use for the data type.

Application Class ID

Enter the name of the application class that you want to use for the data type. The class must exist in the application package name that you specify.

Feed Service Operations

Service Operation

Enter the name of the service operations associated with the feed definition that are used to retrieve data.

Type

This field displays whether the service operation is real time or scheduled. This field is display only.

Default

Select this check box to make this service operation the default.

Click to jump to top of pageClick to jump to parent topicDefining Advanced Options

You can create your own Advanced Options page to manage options unique to the new feed data type.

The standard advanced option page, which is used by IB Generic message feeds, has one advanced option. You can control the maximum number of entries to display in the feed reader to the user.

Access the Define Generic Feeds - Advanced Feed Options page.

Click to jump to parent topicUpdating the Property Maintenance Component

You complete the tasks described below to update the property maintenance component.

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicAdding the Four Standard Publish as Feed Pages

You must add these four standard, hidden Publish as Feed pages to the component:

Note. All four pages can be modified to suit unique requirements of the new feed data type.

Access the component, add the pages, and configure the pages as hidden as shown in this example:

See Adding Pages to Components.

Click to jump to top of pageClick to jump to parent topicAdding the Publish as Feed Link to a Page

To publish the new feed data type, the feed administrator must have access to the Publish as Feed pages. To access these pages, you must add the Publish as Feed link to a page in the component.

Example

Notice the Publish As Feed link in the lower left corner of the PTFP_DATATYPE page:

See Using Push Buttons and Links.

Click to jump to top of pageClick to jump to parent topicCreating an Advanced Options Page

If necessary, replace the following standard Advanced Feed Options page (PTFP_PUB_AS_ADVOPT) with a feed data type specific Advanced Options page to configure any properties specific to the new feed data type:

Example

This is the Query Advanced Options page. Notice how this page differs from the standard page.

See Also

Creating Page Definitions

Click to jump to top of pageClick to jump to parent topicAdding Record PeopleCode

Add the following code to the FieldChange event for the “Publish as Feed” component record field:

import PTFP_FEED:UTILITY:PublishAsRequest; Declare Function initialize PeopleCode PTFP_PA_WORKREC.FUNCLIB FieldFormula; Local PTFP_FEED:UTILITY:PublishAsRequest &request; Local array of string &thisDSS; /* Create and fill in the request object */ &request = create PTFP_FEED:Utility:PublishAsRequest("<unique ID>"); &request.TransactionPageName = Page.<Page Name>; &request.TransactionTitle = "<Page Title>"; &request.ContentTitle = "<Default Feed Title>"; &request.ContentDescription = "<Default Feed Description>"; &request.AdvancedOptionsPageName = Page.<Page Name>; &request.DataTypeID = "yourDataTypeID"; /* Fill in the data source setting values */ &thisDSS = CreateArray("<Data Source Setting Name>", "<Data Source Setting⇒ Value>"); &request.DataSourceSettings.Push(&thisDSS); /* Start the process */ initialize(&request);

Example

Notice the Component Record Field PeopleCode on the PTFP_PUB_AS_PB field in this example:

Note. Where you add the record PeopleCode depends on which record field is used for the Publish as Feed page. If you use the standard page (DERIVED_PTFP.PTFP_PUB_AS_PB), you should only add code in the component record field FieldChange event. If the field is in your own work record, you can use the record FieldChange event directly

See Also

Accessing Record Field PeopleCode

Accessing Component Record Field PeopleCode

Click to jump to parent topicUpdating the View Content Component or Pagelet

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicAdding the Related Feeds Hover Menu to Pages

Add an HTML area to the page for hosting the Related Feeds hover menu.

Example

Notice the HTML area in the upper right of the PTFP_DATATYPE page:

See Also

Using HTML Areas

Click to jump to top of pageClick to jump to parent topicAdding Component or Page PeopleCode

Add the following PeopleCode to the Activate event for the page:

import PTFP_FEED:FeedFactory; import PTFP_FEED:UTILITY:HoverMenu; import PTFP_FEED:UTILITY:RelatedFeedsRequest; Local PTFP_FEED:FeedFactory &PTFP_FEED_FACTORY; Local PTFP_FEED:UTILITY:RelatedFeedsRequest &request; Local array of PTFP_FEED:UTILITY:RelatedFeedsRequest &requests; Local PTFP_FEED:UTILITY:HoverMenu &resultMenu; &PTFP_FEED_FACTORY = create PTFP_FEED:FeedFactory(); /* Fill in the search criteria */ &request = create PTFP_FEED:UTILITY:RelatedFeedsRequest("<Unique ID>"); &request.DataTypeID = "<yourDataTypeID>"; &request.DataSourceSettings.Push(CreateArray("<Data Source Setting Name>", "<Data⇒ Source Setting Value>")); &requests.Push(&request); try /* Generate the menu */ &resultMenu = &PTFP_FEED_FACTORY.getRelatedFeedsHoverMenu(&requests); DERIVED_PTFP.PTFP_HTMLAREA.Value = &resultMenu.getHtml(); catch Exception &e WinMessage(&e.ToString(), %MsgStyle_OK); end-try;

See Accessing Page PeopleCode.

Example

In this example, you see the Page PeopleCode on the Activate event:

Click to jump to top of pageClick to jump to parent topicAdding the Related Feeds Hover Menu to Pagelet Wizard Pagelets

When adding the hover menu, consider these points:

Related Feeds Hover Menu XSL Example

This is sample XSL:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="NumRows"> <xsl:value-of select="count(/queryresult/queryrows/row)" /> </xsl:variable> <xsl:template match="/"> <table border="0" cellpadding="1" cellspacing="1" width="100%" summary=""> <xsl:if test="$NumRows=0"> <tr><td class="PSTEXT">no data available</td></tr> </xsl:if> <xsl:if test="$NumRows>0"> <tr><td> <PSRELATEDFEEDSLINK> <feed id="ADMN_LIST_OF_FEEDS" /> <feeds> <label>PSQUERY Feed List Feeds</label> <description>List of all PSQUERY feed list feeds</description> <feedDataType id="FEED" /> <dataSourceSetting id="PTFP_DATATYPE_ID" value="PSQUERY" /> </feeds> </PSRELATEDFEEDSLINK> </td></tr> </xsl:if> </table> </xsl:template> </xsl:stylesheet>

Click to jump to parent topicDeveloping Up-front Scheduled Feeds

Some additional steps are required for creating upfront scheduled feeds. This section discusses the configuration options:

Click to jump to top of pageClick to jump to parent topicUp-front Scheduled Feeds Prerequisites

You must complete the following tasks when creating up-front scheduled feeds:

  1. The service operation that you use to publish the up-front freed messages to the Integration Broker (IB) queues must satisfy these conditions:

  2. The service operation used to publish the upfront feed messages has to be listed in the Define Feed Data Types page. This information is used for archiving feeds.

  3. The feed format should be set as the message attribute before publishing the message.

    /* Set the feed format of the message (i.e. Atom 1.0). */ &succeeded = &responseMsg.IBInfo.AddAttribute(&feedFactory.Utility.QUERYPARAMETE⇒ R_FEEDFORMAT, &feedDoc.FeedFormat);

  4. DSPARAMETER_MAXROW, DSPARAMETER_SF_PAGING and DSPARAMETER_SF_MAXMINUTES data source parameters found in PTFP_FEED:UTILITY:Utility application class, should be defined and set to appropriate values. DSPARAMETER_MAXROW and DSPARAMETER_SF_MAXMINUTES are required for archiving feeds. DSPARAMETER_SF_PAGING is for paged feeds. It should be set to SF_PAGINGOPTION_NOPAGING value. SF_PAGINGOPTION_SEGMENTED value is not supported for this release and will return an empty feed.

    &thisDSP = %This.addParameter(&utility.DSPARAMETER_MAXROW, String⇒ (&utility.SF_MAXROWOPTION_LATESTMSG)); &thisDSP.Name = &thisDSP.ID; &thisDSP.Description = MsgGetText(219, 3005, "Message Not Found - Max⇒ Entries"); &thisDSP.FieldType = &utility.FIELDTYPE_NUMBER; &thisDSP.DefaultValue = String(&utility.SF_MAXROWOPTION_LATESTMSG); &thisDSP.Value = &thisDSP.DefaultValue; &thisDSP.Required = True; &thisDSP = %This.addParameter(&utility.DSPARAMETER_SF_PAGING, String⇒ (&utility.SF_PAGINGOPTION_NOPAGING)); &thisDSP.Name = &thisDSP.ID; &thisDSP.Description = MsgGetText(219, 3006, "Message Not Found - Paging"); &thisDSP.FieldType = &utility.FIELDTYPE_SIGNEDNUMBER; &thisDSP.DefaultValue = String(&utility.SF_PAGINGOPTION_NOPAGING); &thisDSP.Value = &thisDSP.DefaultValue; &thisDSP.Required = True; &thisDSP = %This.addParameter(&utility.DSPARAMETER_SF_MAXMINUTES, String⇒ (&utility.SF_MAXMINUTES_ALLMSGS)); &thisDSP.Name = &thisDSP.ID; &thisDSP.Description = MsgGetText(219, 3007, "Message Not Found - Max Min"); &thisDSP.FieldType = &utility.FIELDTYPE_SIGNEDNUMBER; &thisDSP.DefaultValue = String(&utility.SF_MAXMINUTES_ALLMSGS); &thisDSP.Value = &thisDSP.DefaultValue; &thisDSP.Required = True; (XRef - Archiving Feeds section at the end of this section)