(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:

Image: Example of MY_CMPNT component showing the four hidden, standard Publish as Feed pages

This example illustrates the MY_CMPNT component that has the four hidden, standard Publish as Feed pages.

Example of MY_CMPNT component showing the four hidden, standard Publish as Feed pages

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.

Image: PTFP_DATATYPE page showing the Publish as Feed link

This example illustrates the fields and controls on the PTFP_DATATYPE page showing the Publish as Feed link.

PTFP_DATATYPE page showing the Publish as Feed link

See Using Push Buttons and Links.

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:

Image: Example PTFP_PUB_AS_ADVOPT page (the standard advanced options page)

This example illustrates the fields and controls on the PTFP_PUB_AS_ADVOPT page.

Example PTFP_PUB_AS_ADVOPT page (the standard advanced options page)

To create a custom advanced options page:

  1. Clone the PTFP_PUB_AS_ADVOPT page as a feed data type-specific advanced options page.

  2. Add the feed data type-specific data source parameters to the page.

  3. In the page Activate event, create a PeopleCode program to read the data source parameter values from the feed definition.

  4. Create an additional PeopleCode program to set the data source parameter values to the feed definition when the page is closed.

Example

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

Image: Query feeds advanced options page

This example illustrates the fields and controls on the Query feeds advanced options page.

Query feeds advanced options 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);

Example

Image: PTFP_PUB_AS_PB field showing PeopleCode for the FieldChange event

This example illustrates the PTFP_PUB_AS_PB field showing PeopleCode for the FieldChange event.

PTFP_PUB_AS_PB field showing PeopleCode for the FieldChange event

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.