velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henn...@apache.org
Subject svn commit: r491992 - in /velocity/site/velocity-news-plugin: pom.xml src/main/java/org/apache/velocity/maven/plugin/news/NewsFeedGenerator.java
Date Wed, 03 Jan 2007 00:47:21 GMT
Author: henning
Date: Tue Jan  2 16:47:21 2007
New Revision: 491992

URL: http://svn.apache.org/viewvc?view=rev&rev=491992
Log:
Add categories, bump version.


Modified:
    velocity/site/velocity-news-plugin/pom.xml
    velocity/site/velocity-news-plugin/src/main/java/org/apache/velocity/maven/plugin/news/NewsFeedGenerator.java

Modified: velocity/site/velocity-news-plugin/pom.xml
URL: http://svn.apache.org/viewvc/velocity/site/velocity-news-plugin/pom.xml?view=diff&rev=491992&r1=491991&r2=491992
==============================================================================
--- velocity/site/velocity-news-plugin/pom.xml (original)
+++ velocity/site/velocity-news-plugin/pom.xml Tue Jan  2 16:47:21 2007
@@ -9,7 +9,7 @@
   <artifactId>velocity-news-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Velocity News Plugin</name>
-  <version>1.0.0</version>
+  <version>1.0.1</version>
   <description>This plugin generates a news page and rss feed from news items. It also
allows timed display of these items and
     integration into other pages through doxia macros.</description>
   <url>http://people.apache.org/~henning/velocity-news-plugin/</url>

Modified: velocity/site/velocity-news-plugin/src/main/java/org/apache/velocity/maven/plugin/news/NewsFeedGenerator.java
URL: http://svn.apache.org/viewvc/velocity/site/velocity-news-plugin/src/main/java/org/apache/velocity/maven/plugin/news/NewsFeedGenerator.java?view=diff&rev=491992&r1=491991&r2=491992
==============================================================================
--- velocity/site/velocity-news-plugin/src/main/java/org/apache/velocity/maven/plugin/news/NewsFeedGenerator.java
(original)
+++ velocity/site/velocity-news-plugin/src/main/java/org/apache/velocity/maven/plugin/news/NewsFeedGenerator.java
Tue Jan  2 16:47:21 2007
@@ -10,6 +10,7 @@
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.io.IOUtils;
@@ -22,6 +23,8 @@
 import org.apache.velocity.news.VelocityNewsException;
 import org.apache.velocity.news.utils.VelocityNewsUtils;
 
+import com.sun.syndication.feed.synd.SyndCategory;
+import com.sun.syndication.feed.synd.SyndCategoryImpl;
 import com.sun.syndication.feed.synd.SyndContent;
 import com.sun.syndication.feed.synd.SyndContentImpl;
 import com.sun.syndication.feed.synd.SyndEntry;
@@ -82,6 +85,22 @@
             content.setValue(getAsHtml(item.getText()));
 
             entry.setDescription(content);
+
+            List itemCategories = item.getCategories();
+
+            if (itemCategories != null) {
+                List categories = new ArrayList(itemCategories.size());
+
+                for (Iterator it = itemCategories.iterator(); it.hasNext(); ) {
+                    String category = (String) it.next();
+
+                    SyndCategory syndCategory = new SyndCategoryImpl();
+                    syndCategory.setName(category);
+                    categories.add(syndCategory);
+                }
+
+                entry.setCategories(categories);
+            }
 
             feedEntries.add(entry);
         }



Mime
View raw message