Updating the View Content Component or Pagelet

This section discusses how to update the view content component or pagelet.

This task applies equally to feeds published with the Feed Publishing Wizard as well as to feeds published using the Publish as Feed pages. Completing the items in this task will make it easier for your users to discover published feeds.

Add an HTML area to the page for hosting the related feeds hover menu.

Example

Image: PTFP_DATATYPE page showing HTML area and HTML area properties dialog box

This example illustrates the PTFP_DATATYPE page showing HTML area and HTML area properties dialog box.

PTFP_DATATYPE page showing HTML area and HTML area properties dialog box

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 */
&requests = CreateArrayRept(&request, 0);
&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

Image: Example of PTFP_DATATYPE Page PeopleCode

This example illustrates Page PeopleCode on the Activate event of PTFP_DATATYPE.

Example of PTFP_DATATYPE Page PeopleCode

When adding the hover menu, consider these points:

  • Only home page pagelets and pagelets, which can be embedded, on application pages support the related feeds hover menu.

  • Transformer output must be XML or XHTML.

  • Multi-group feed menu is supported.

Example: Related Feeds Hover Menu XSL

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>