Author: johnh
Date: Tue Sep 30 14:26:53 2008
New Revision: 700585

URL: http://svn.apache.org/viewvc?rev=700585&view=rev
Log:
Minor bugfix: filling Summary field of JSON feed with Content rather than 
Description, if present.


Modified:
    
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/FeedProcessor.java

Modified: 
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/FeedProcessor.java
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/FeedProcessor.java?rev=700585&r1=700584&r2=700585&view=diff
==============================================================================
--- 
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/FeedProcessor.java
 (original)
+++ 
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/FeedProcessor.java
 Tue Sep 30 14:26:53 2008
@@ -18,6 +18,7 @@
  */
 package org.apache.shindig.gadgets;
 
+import com.sun.syndication.feed.synd.SyndContent;
 import com.sun.syndication.feed.synd.SyndEntry;
 import com.sun.syndication.feed.synd.SyndFeed;
 import com.sun.syndication.feed.synd.SyndPerson;
@@ -81,8 +82,13 @@
         entry.put("Title", e.getTitle());
         entry.put("Link", e.getLink());
         if (getSummaries) {
-          entry.put("Summary",
-              e.getDescription() != null ? e.getDescription().getValue() : "");
+          if (e.getContents() != null && e.getContents().size() > 0) {
+            entry.put("Summary",
+                ((SyndContent)e.getContents().get(0)).getValue());
+          } else {
+            entry.put("Summary",
+                e.getDescription() != null ? e.getDescription().getValue() : 
"");
+          }
         }
 
         if (e.getUpdatedDate() != null) {


Reply via email to