This chapter discusses how to:
Analyze requirements for new feed data type.
Create the feed data source application class.
Define the feed data type.
Update the property maintenance component.
Update the view content component or pagelet.
Develop up-front scheduled feeds.
Consider these tasks when developing new feed data types:
Determine how to distinguish feeds of the same data type (Data Source Settings). For example, the data source settings for Discussion Forums is the Forum ID, and for Content Management Folders the data source settings are the Portal Name and Folder ID.
Determine how the feeds will be configured, and what the default value is for each parameter of the Data Source Parameters. For example, the data source parameter for Discussion Forums is Max Entries with a default of 10. The data source parameters for Content Management Folders are Max Entries with a default of 10 and Include Subfolder Flags with a default of yes.
Determine what to publish in the feed entry. For example, Discussion Forums publish the complete post, author, tags, attachment, and timestamp. Content Management Folders publish the content summary, author, tags, attachment, and timestamp.
Determine whether the feed will be generated Scheduled or Real Time.
Determine who can create and manage feed definitions.
Determine where to put the Publish as Feed link.
Determine where to put the related feeds hover menu.
Determine how to handle the real-time feed security and the GETFEED viewer permission requests.
The feed data source application class manages all aspects of data collection and data security.
To create the feed data source application class:
Extend the base class.
Implement the methods.
Set read only flags by using protected methods.
Access and extend the PTFP_FEED:DataSource:DataSource base class.
See Creating Application Packages and Classes.
Consider these method types:
Required
Recommended
Optional
This table describes the methods that you must implement:
Method |
Purpose |
|
Clone the data source object |
|
Return the feed content url |
|
Return the “allowed” list of viewer roles and/or permission lists |
|
Validate whether the current user has viewer permission of the feed |
|
Initialize data source setting collection and other class properties |
|
Validate data source setting values, and generate data source parameter list accordingly |
|
Collect data based on user permission, and fill in the feed document |
This table describes the methods that you should consider implementing:
Method |
Purpose |
|
Validate whether the current user has administration permission for the feed. |
|
The clone method uses protected methods for copying class properties. |
This table describes the methods that you might consider implementing:
Method |
Purpose |
|
Perform tasks after saving the feed definition. |
|
Perform tasks before deleting the feed definition. |
|
Return data source setting details as HTML. |
|
Return data source parameter details as HTML. |
You should set flags by using these methods:
setDataSourceType
setSettingsCompleted
setAllowRealTimeFeedSecurity
This section lists the steps for defining feed data types and discusses how to:
Define feed data types
Define advanced options.
Page Name |
Definition Name |
Navigation |
Usage |
Define Feed Data Types |
PTFP_DATATYPE |
PeopleTools, Feeds, Define Feed Data Types |
Define feed data types. |
You complete these steps to define feed data types:
Select PeopleTools, Feed, Define Data Types.
Specify the data source application class.
Select service operations to be used by feeds of this data type, and specify the default service operation.
Specify the default feed head level attributes for feeds of this data type.
(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.
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. |
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. |
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. |
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. |
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.
You complete the tasks described below to update the property maintenance component.
This section discusses how to:
Add the four standard Publish as Feed pages.
Add the Publish as Feed link to one of the pages in the component.
Create an Advanced Options page.
Add record PeopleCode.
You must add these four standard, hidden Publish as Feed pages to the component:
Publish Feed Definition (PTFP_PUB_AS_FEED)
Advanced Feed Options (PTFP_PUB_AS_ADVOPT)
Publish as Feed (PTFP_PUB_AS_LIST)
Publish Feed Definition to Sites (PTFP_PUB_AS_SITES)
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.
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.
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
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
This section discusses how to:
Add the Related Feeds hover menu to pages.
Add component or page PeopleCode.
Add the Related Feeds hover menu to Pagelet Wizard pagelets.
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
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:
When adding the hover menu, consider these points:
Only homepage pagelets and embeddable pagelets on application pages support the related feeds hover menu.
Transformer output must be XML or XHTML.
Multi-group feed menu is supported.
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>
Some additional steps are required for creating upfront scheduled feeds. This section discusses the configuration options:
You must complete the following tasks when creating up-front scheduled feeds:
The service operation that you use to publish the up-front freed messages to the Integration Broker (IB) queues must satisfy these conditions:
It should be an asynchronous - one way service operation.
It should have PT_FEED_REQUEST.VERSION_1 as the message.
The service operation should be secured appropriately. This security is enforced by the scheduled feed GetFeed service operation handler at run time.
The queue used in the service operation should have the Archive option enabled, if the upfront feeds are to be archived. If this is not enabled, then the Archival Feeds will delete the feed messages in the IB queue.
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.
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);
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)