I've posted a fix for bug #XWIKI-283, and I hope someone can include it
in the next release.
When trying to show an RSS or RSS2 feed in a wiki page using the {rss}
macro, you will see text like:
"SyndContentImpl.value= ... {blog text} ...
SyndContentImpl.type=text/plain"
Here's the fix to java/com/xpn/xwiki/render/macro/rss/RSSMacro.java.
It applies to xwiki 0.9.743 through subversion June 20, 2006. and to
rome 0.6 through 0.8.
185c184
< .append(NEWLINE).append(entry.getDescription())
---
.append(NEWLINE).append(entry.getDescription().getValue())
218c217
< .append(NEWLINE).append(entry.getDescription())
---
.append(NEWLINE).append(entry.getDescription().getValue())
Explanation:
The following code appends the result of
com.sun.syndication.feed.synd.SyndEntry.getDescription(). That would be
fine if getDescription returned a String, but in fact it returns a
feed.synd.SyndContent object.
buf.append(NEWLINE).append("<div class='rssitemdescription'>")
.append(NEWLINE).append(entry.getDescription())
.append(NEWLINE).append("</div>");
My test cases were:
RSS: {rss:feed=http://gigazad.blogspot.com/rss.xml|count=4|full=true}
RSS2:
{rss:feed=http://www.mikegiesbrecht.com/Blog.php?feed_type=rss2|count=1|full=true}
More details below.
--
Trevor Cox
skahasoftware.com
Vancouver, Canada
Ludovic Dubost wrote:
Looks like I missed this one !! There is probably a bug with to little
encoding of what we get from the feeds.
You should report an issue in
http://jira.xwiki.org
Ludovic
Trevor Cox a écrit :
Has anyone looked in to RSS2 feeds and the {rss}
macro? As far as I
can figure out, RSS2 is a new version of RSS. My {rss} macro works
fine with RSS feeds that are not labelled RSS2 (although Google seems
to block access somehow).
I tried upgrading to the latest version of rome.jar, 0.7, but that
didn't help. A Google search showed that many XWiki users are having
the same problem I am.
When I use {rss... |full=true} I see the following text. I've put in
bold the text that I should be seeing. The rest is coming from the
ROME code (not directly from the RSS source).
SyndContentImpl.value=*Be sure to check out my November Newsletter
for important tips for Buyers! Click on the Newsletter tab on my
Home Page and read about 6 questions a Buyer should ask before making
an offer. Read More <http://mikegiesbrecht.com/ViewBlog/14/>*
SyndContentImpl.type=text/plain SyndContentImpl.interface=interface
com.sun.syndication.feed.synd.SyndContent
-Trevor Cox
http://skahasoftware.com
------------------------------------------------------------------------