[jboss-svn-commits] JBL Code SVN: r11369 - in labs/shotoku/trunk: shotoku-feeds/src/java/org/jboss/shotoku/feeds/data and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Apr 26 14:02:35 EDT 2007


Author: adamw
Date: 2007-04-26 14:02:35 -0400 (Thu, 26 Apr 2007)
New Revision: 11369

Modified:
   labs/shotoku/trunk/lib/jboss-blog/jboss-blog-common.jar
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java
Log:
http://jira.jboss.com/jira/browse/JBBLOG-30

Modified: labs/shotoku/trunk/lib/jboss-blog/jboss-blog-common.jar
===================================================================
(Binary files differ)

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java	2007-04-26 17:48:39 UTC (rev 11368)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java	2007-04-26 18:02:35 UTC (rev 11369)
@@ -17,6 +17,7 @@
 import com.sun.syndication.io.FeedException;
 import com.sun.syndication.feed.synd.SyndFeed;
 import com.sun.syndication.feed.synd.SyndEntry;
+import com.sun.syndication.feed.synd.SyndContent;
 import de.nava.informa.impl.basic.ChannelBuilder;
 import de.nava.informa.core.ChannelIF;
 import de.nava.informa.core.ItemIF;
@@ -39,6 +40,20 @@
                 }
             };
 
+    private static String getDescription(SyndEntry entry) {
+        if (entry.getDescription() != null) {
+            return entry.getDescription().getValue();
+        }
+
+        if (entry.getContents() != null) {
+            if (entry.getContents().size() > 0) {
+                return ((SyndContent) entry.getContents().get(0)).getValue();
+            }
+        }
+
+        return "";
+    }
+
     public static BlogModel parseWithRome(InputStream is)
             throws IOException, FeedException {
         // Parsing the generated feed.
@@ -66,7 +81,7 @@
             author = Tools.isEmpty(author) ? defaultAuthor : author;
             // TODO: categories
             posts.add(new BlogPostImpl(new BlogAuthorImpl(author, author, null),
-                    entry.getTitle(), entry.getDescription().getValue(),
+                    entry.getTitle(), getDescription(entry),
                     entry.getPublishedDate(), entry.getLink(), entry.getUri(),
                     null, commentsRss, null));
         }




More information about the jboss-svn-commits mailing list