Re: [xwiki-users] datetime in xwiki rss feeds
Actually I saw that code. The simplest fix I could figure was this... In the page http://.../xwiki/bin/edit/XWiki/WebRssCode, I replaced this line <dc:date>$currentdoc.date</dc:date> with <dc:date>$xwiki.formatDate($currentdoc.date, "yyyy-MM-dd'T'HH:mm:ss")</dc:date> The fix however omits the timezone. There is java code at http://www.dpawson.co.uk/relaxng/schema/datetime.html which handles the timezone as well. The SimpleDateFormat pattern "yyyy-MM-dd'T'HH:mm:ss.SSSZ" is close as it gives 2005-06-29T17:20:46.171-0800 This however does not work because of the missing colon. It needs to be 2005-06-29T17:20:46.171-08:00 The simplest way seems to be to use commons-lang utilities DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(new Date()) Since commons-lang is already part of the distribution is there a easy way to add this code? I just don't know how to incorporate it in here at this point due to unfamiliarity with velocity, groovy etc. Thanks very much. regards Sudhir On 6/29/05, Ludovic Dubost <[email protected]> wrote:
Yes.. You need to customize the code in BlogRssCode
http://www.xwiki.com/xwiki/bin/view/XWiki/BlogRssCode?xpage=code
You can get this code and put it in your wiki and modify it. The line <dc:date>$currentdoc.display("date", "view", $currentobj)</dc:date> Should be changed to some conversion.. I'm not sure which one though If you send us some java code that does the conversion and right formatting we can adapt it for the scripting
Ludovic
Sudhir Rao a écrit :
Is there any easy way to change the timestamp format in the rss feed which gets generated without modifying xwiki source code?
The field <dc:date>Tue Jun 28 16:31:33 PDT 2005</dc:date> should have been formatted as per the dateTime spec at http://www.w3.org/TR/xmlschema-2/#dateTime
The current behavior seems to throw off the date/time sorting in RSS readers as they just ignore the value.
A SimpleDateFormat conversion has been given here..
http://lists.xml.org/archives/xml-dev/200311/msg00153.html which uses the format "yyyy-MM-dd'T'HH:mm:ss,SSS'Z'"
Any thoughts?
-Sudhir
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
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
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 ------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
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 ------------------------------------------------------------------------
participants (4)
-
Ludovic Dubost -
Sudhir Rao -
Trevor Cox -
Trevor Cox