RSS News Feed Portlet

The RSS News Feed Portlet retrieves news content and links based on visitor news feed preferences. This portlet provides an edit mode that lets you change the news feed and set portlet preferences.

Concepts Demonstrated by this Sample

This JSP portlet, which uses a backing file, illustrates a news aggregator portlet that connects to external news feeds and weblogs that provide Really Simple Syndication (RSS) content. This portlet provides an edit mode.

Location of Sample Files

This sample is located in the <BEA_HOME>/<WEBLOGIC_HOME>/samples/portal/portalApp/portalApp.work application.

How to Run the Sample

See Viewing the Samples in Portal Samples.

How to Use the Sample in Your Portals

  1. Create a portal application.
  2. Import or copy the following directories and files into your portal application and portal Web project. You may need to create the appropriate directories in your application:
    Import or copy this to this directory (create if necessary)

    <WEBLOGIC_HOME>/samples/portal/portalApp/
    sampleportal/portlets/rss/

    <PORTAL_APP>/<project>/portlets/
    <WEBLOGIC_HOME>/samples/portal/portalApp/
    sampleportal/WEB-INF/src/examples/rss/
    <PORTAL_APP>/<project>/
    WEB-INF/src/examples/

    <WEBLOGIC_HOME>/samples/portal/portalApp/
    sampleportal/WEB-INF/
    lib/xmlx-tags.jar

    Add the following entry in the tag library section of <project>/WEB-INF/web.xml to register the tag library:

    <taglib>
        <taglib-uri>xmlx.tld</taglib-uri>
        <taglib-location>/WEB-INF/lib/xmlx-tags.jar</taglib-location>
    </taglib>
                             
    <PORTAL_APP>/<project>/
    WEB-INF/lib/
  3. Open your portal file and navigate the page where you want the portlet to appear.
  4. In the Data Palette window, drag the RSS News Feed portlet onto the portal page.
  5. In the Property Editor window, set any relevant properties.
  6. Save the portal file.
  7. View your portal with the WebLogic Test Browser or with your default browser.
    • WebLogic Test Browser - In the WebLogic Workshop toolbar, click the Start button (or press Ctrl+F5).
    • Default Browser - In the WebLogic Workshop menu, choose Portal-->Open Current Portal.

To Change the News Feed

  1. In the Portal Designer, double-click the portlet to open it.
  2. With the portlet file open, click the arrow icon on the Portlet Preferences bar on the portlet footer to expand the preferences.
  3. Select the contentURL preference.
  4. In the Property Editor window, enter an absolute HTTP path to a valid news feed (.rdf file) in the Preference Value field. For example: http://www.theserverside.com/rss/theserverside-1.0.rdf.

You can also let users change news feeds for a portlet with the portlet's edit mode.

The portlet's Edit mode uses the rss.properties file to let you select from a list of valid RSS feeds. Modify rss.properties to remove or add feeds. The rss portlet shows one feed at a time. To show multiple feeds, add more rss portlets and set a different contentURL for each. Set the Edit URI field to /portlets/rss/rssedit.jsp to allow users to change the portlet feed using the rss.properties list. Save the portal file.

Related Topics

Creating a Portal File

Portal Samples

<pref:getPreference> Tag

<pref:ifModifiable> Tag

<pref:else> Tag