Issue Details (XML | Word | Printable)

Key: XWIKI-283
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ludovic Dubost
Reporter: Trevor Cox
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XWiki Core

{rss} macro works with RSS but not RSS2

Created: 21/Jun/06 18:32   Updated: 22/Dec/06 15:20
Component/s: Wiki features
Affects Version/s: 0.9.840
Fix Version/s: 1.0 B2

keywords: rss,rss2,macro
Date of First Response: 21/Dec/06 14:40
Resolution Date: 22/Dec/06 15:20


 Description  « Hide
RSS2 is a new version of RSS. The {rss} macro works only with RSS feeds that are not labelled RSS2.

(This issue was raised in the forum and I was asked to post this bug by Ludovic 12/2005.)

This problem was originally found in 0.9.743 and still exists in the subversion repository as of June 20, 2006 (i.e. 1.0B1).

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. The "SyndContent" text 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://----.com/ViewBlog/14/>
SyndContentImpl.type=text/plain SyndContentImpl.interface=interface com.sun.syndication.feed.synd.SyndContent



 All   Comments   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Trevor Cox added a comment - 22/Jun/06 23:00
Here's the fix. 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().getValue())
.append(NEWLINE).append("</div>");


Trevor Cox added a comment - 22/Jun/06 23:05
Sorry, forgot to mention the file is: com/xpn/xwiki/render/macro/rss/RSSMacro.java

Vincent Massol added a comment - 21/Dec/06 14:40
From mailing list:
The {rss} macro is still not usable as per #XWIKI-283. It's a trivial fix! (You can see from code inspection it is dumping a Java object to the web page.) Here's the patch, updated for 10b1:

core/src/main/java/com/xpn/xwiki/render/macro/rss/RSSMacro.java
@@ -181,7 +181,7 @@
         if (paramObj.isFull() && entry.getDescription() != null)
         {
             buf.append(NEWLINE).append("{quote}")
-               .append(NEWLINE).append(entry.getDescription())
+               
+ .append(NEWLINE).append(entry.getDescription().getValue())
                .append(NEWLINE).append("{quote}");
         }
     }
@@ -214,7 +214,7 @@
         if (paramObj.isFull() && entry.getDescription() != null)
         {
             buf.append(NEWLINE).append("<div class='rssitemdescription'>")
-               .append(NEWLINE).append(entry.getDescription())
+               
+ .append(NEWLINE).append(entry.getDescription().getValue())

Ludovic Dubost added a comment - 22/Dec/06 14:34
These tasks need to be verified and put in the planning if these are bugs

Ludovic Dubost added a comment - 22/Dec/06 15:10
Commited in r1796
Sorry for the delay

Vincent Massol added a comment - 22/Dec/06 15:19
Reopening as this cannot be fixed for 1.0 as 1.0 is not released yet!

Vincent Massol added a comment - 22/Dec/06 15:20
Has this been tested?