From 7404f2c35c142bd0608bc3d809dfec21c3740d39 Mon Sep 17 00:00:00 2001 From: fuchsi <fuchsi@6c8d7289-2bf4-0310-a012-ef5d649a1542> Date: Tue, 2 Oct 2007 21:28:29 +0000 Subject: [PATCH] Fix some of the issues with the RSS search interface, see http://forum.yacy-websuche.de/viewtopic.php?f=6&t=392 Note: the new DateFormatter822 in the plasmaSwitchboard is just a copy of the DateFormatter that always uses the US locale to allow formatting of a loocale independent date String. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4124 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacysearch.rss | 4 ++-- htroot/yacysearchitem.java | 2 +- source/de/anomic/plasma/plasmaSwitchboard.java | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htroot/yacysearch.rss b/htroot/yacysearch.rss index 990a800c6..6b56bd4ec 100644 --- a/htroot/yacysearch.rss +++ b/htroot/yacysearch.rss @@ -11,9 +11,9 @@ <url>#[rssYacyImageURL]#</url> <title>Search for #[former]#</title> </image> - <opensearch:totalResults>#[type_results]#</opensearch:totalResults> + <opensearch:totalResults>#[results]#</opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> - <opensearch:itemsPerPage>#[type_results]#</opensearch:itemsPerPage> + <opensearch:itemsPerPage>#[results]#</opensearch:itemsPerPage> <opensearch:link rel="search" href="opensearchdescription.xml" type="application/opensearchdescription+xml"/> <opensearch:Query role="request" searchTerms="#[former]#" /> diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index da1c86658..0a7e82bcd 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -178,7 +178,7 @@ public class yacysearchitem { prop.put("rss_description", result.textSnippet().getLineRaw()); prop.put("rss_link", result.urlstring()); prop.put("rss_urlhash", result.hash()); - prop.put("rss_date", plasmaSwitchboard.dateString(result.modified())); + prop.put("rss_date", plasmaSwitchboard.dateString822(result.modified())); return prop; } diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 14ae7e93e..2d1ae8bcf 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -117,6 +117,7 @@ import java.util.Date; import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; +import java.util.Locale; import java.util.Map; import java.util.Properties; import java.util.Set; @@ -2895,6 +2896,13 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser if (date == null) return ""; else return DateFormatter.format(date); } + // we need locale independent RFC-822 dates at some places + private static SimpleDateFormat DateFormatter822 = new SimpleDateFormat("EEE, dd MMM yyyy", Locale.US); + public static String dateString822(Date date) { + if (date == null) return ""; else return DateFormatter822.format(date); + } + + public serverObjects action(String actionName, serverObjects actionInput) { // perform an action. (not used) return null;