(Optional) Updating the Property Maintenance Component
Because any feed definition can be published through the Feed Publishing Wizard, it is optional to update the property maintenance component to add the Publish as Feed pages. If you decide to update the property maintenance component, then content and feed administrators can use either methodology to publish feeds for this type of data. To update property maintenance components, you complete the tasks described in this section.
This section discusses how to update the property maintenance components.
You must add these four standard Publish as Feed pages to the component as hidden pages:
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: You can clone and then modify all four pages to suit the 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:
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.
The advanced options page is used to set data source parameters for each feed definition. The standard advanced option page, PTFP_PUB_AS_ADVOPT, has one advanced option: Max Number of Entries. If your new feed data type has additional data source parameters (such as a paged feed, an incremental feed, or other parameters), then you must create a custom advanced options page. Otherwise, you can use the standard advanced options page shown in this example:
To create a custom advanced options page:
Clone the PTFP_PUB_AS_ADVOPT page as a feed data type-specific advanced options page.
Add the feed data type-specific data source parameters to the page.
In the page Activate event, create a PeopleCode program to read the data source parameter values from the feed definition.
Create an additional PeopleCode program to set the data source parameter values to the feed definition when the page is closed.
This is the Query Advanced Options page. Notice how this page differs from the standard page.
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);
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, then 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.