Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

Journal Articles to RSS Feed

RSS Feeds and Journal Content#

This entry will describe how to use an how to create an RSS feed using your Journal Articles. I am going to assume that you already know XSL.

Creating RSS Feeds using Journal Templates #

XSLT is a transform language to modify XML documents to another form of XML. Since Liferay's Journal is capable of returning search in an XML document, XSL is a great way to change the search results to an RSS feed.

The URL need to return search queries is below:


Immediately following the "?" is the criteria for the search in the format [parameter]=[variable]. In the example below we are asking for articles that have a display date less than 1/1/2003.


Listed below are the most commonly used arguments. Multiple parameters can be used and should be separated by an escaped ampersand, "&". Note: To use the URL in your browser be sure to change each "&" to an non-escaped ampersand, "&".

  • groupId
    • This parameter searches a particular group. When set to @group_ID@ it will only search for content in the community where the article resides.
  • templateId
    • This parameter restricts the search to articles created with a certain template. Note: Be sure to set this to the templates ID and not the templates name.
  • orderBy
    • This parameter sorts the results by the method passed.
  • type
    • Much like templateID, this parameter will restrict the results to articles that are created with the specified type.
  • displayDateGT
    • This parameter will restrict articles that are greater then the specified time. Note: Takes the form, YYYYMMDD.
  • displayDateLT
    • This parameter will restrict articles that are less than the specified time. Note: Takes the form YYYYMMDD.
  • delta
    • This parameter will restrict the result set to a specified amount.


The following is an incomplete example illustrating how to create an RSS Feed using XSL.

  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="" version="1.0">  
    <xsl:output method="xml" omit-xml-declaration="no" media-type="application/rss+xml" indent="yes" />
    <xsl:template match="/">
      <xsl:variable name="articles" select="document('http://@portal_url@/c/journal/get_articles?groupId=@group_id@&amp;templateId=BASIC-RSS-ITEM&amp;delta=20&amp;orderBy=display-date')/result-set/result"/>
      <rss version="2.0">
            <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='rss-title']/dynamic-content"/>
            <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='rss-link']/dynamic-content"/>
            <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='rss-description']/dynamic-content"/>
          <xsl:for-each select="$articles">
                <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='headline']/dynamic-content"/>
                <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='link']/dynamic-content"/>
                <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='description']/dynamic-content"/>
                <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='creator']/dynamic-content"/>
                <xsl:text> &lt;;</xsl:text>
              <guid isPermaLink="false">
                <xsl:value-of disable-output-escaping="no" select="root/dynamic-element[@name='reserved-article-id']/dynamic-content"/>

Journal Internal API shows in great detail on how the result set is formed.

0 Attachments
Average (3 Votes)
The average rating is 1.66666666666667 stars out of 5.