Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How best to consume Confluence News feeds in an external application

Michael Tokar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2011

I have set up a Confluence instance as a documentation site and to publish announcements regarding my external application. In my external application, I want to display a feed of announcements (News) from Confluence. I used the Feed Builder to create a feed of only blog posts in the space that I am interested in. Unfortunately, the generated content for each item is in HTML, and includes additional information that I am not interested in displaying, namely the "Page added/edited by User" bit at the top.

How do I change what HTML is rendered for each entry? Is there a way to do it without modifying Confluence?

Also, I noticed in the XML of the feed, the body of each entry was in a "summary" element, with an attribute "type" set to "html". Does that mean there's a way to generate a feed which only outputs plain text? If so, why isn't it in the Feed Builder wizard?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Penny Wyatt (On Leave to July 2021)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2011

As far as I can tell from looking at the source, it's not possible to remove the "Blog post added by" header through the UI from RSS feeds.

However, a quick browse through the source shows that this content comes from a velocity template, so you should be able to hack it manually.

Disclaimer: This isn't a supported configuration, and any changes will be lost/broken on upgrade.

Assuming it's a standalone install (I used Confluence 3.5.2 because I had it handy):
1) Browse to confluence\WEB-INF\lib\confluence-3.5.2.jar
2) Extract confluence-3.5.2.jar to a temporary directory.
3) Browse to templates\rss\page-rss-content.vm
4) Hack the template as you see fit. For example, to get it to display the entire content every time, replace its content with:

#parse ("templates/rss/includes/header.vm")
$wikiStyleRenderer.convertWikiToXHtml($renderContext, $entity.content)
#parse ("templates/rss/includes/footer.vm")

5) Shut down Confluence.
6) jar up the directory again and copy it back into WEB-INF\lib (make a backup first).
7) [Optional] Say a prayer to the deity of your choice.
8) Delete the Tomcat "work" directory.
9) Start up Confluence.

No promises :-)

TAGS
AUG Leaders

Atlassian Community Events