[jboss-svn-commits] JBL Code SVN: r5278 - labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jul 25 11:38:57 EDT 2006


Author: adamw
Date: 2006-07-25 11:38:56 -0400 (Tue, 25 Jul 2006)
New Revision: 5278

Modified:
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AttributesTagHandler.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java
Log:
Attributes sets

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AttributesTagHandler.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AttributesTagHandler.java	2006-07-25 15:24:28 UTC (rev 5277)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AttributesTagHandler.java	2006-07-25 15:38:56 UTC (rev 5278)
@@ -1,30 +1,14 @@
 package org.jboss.shotoku.feeds.tag;
 
-import org.apache.log4j.Logger;
-import org.apache.velocity.VelocityContext;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
-import org.jboss.shotoku.feeds.FeedFactory;
-import org.jboss.shotoku.feeds.data.NormalFeed;
-import org.jboss.shotoku.feeds.tools.FeedsConstants;
-import org.jboss.shotoku.feeds.tools.FeedsTools;
 import org.jboss.shotoku.feeds.variables.Substitution;
-import org.jboss.shotoku.search.*;
-import org.jboss.shotoku.tools.Tools;
-import org.jboss.shotoku.ContentManager;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
-import java.lang.reflect.Constructor;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Date;
-import java.io.Writer;
-
 /**
  * @author Adam Warski (adamw at aster.pl)
  */
 public class AttributesTagHandler extends FeedTagHandler {
-    private static final Logger log = Logger.getLogger(FeedsDescriptor.class);
+    //private static final Logger log = Logger.getLogger(FeedsDescriptor.class);
 
     public AttributesTagHandler(String feedName, String group, Node definition,
                                 Substitution s) {

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java	2006-07-25 15:24:28 UTC (rev 5277)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java	2006-07-25 15:38:56 UTC (rev 5278)
@@ -84,7 +84,8 @@
     }
 
     public static void createHandlers(String group, Node definition,
-                                      VariableResolverManager vrm, FeedsDescriptor fd) {
+                                      VariableResolverManager vrm,
+                                      FeedsDescriptor fd) {
         // Getting an appropriate construtor to the given feed tag type.
         Constructor handlerConstr = handlers.get(definition.getNodeName());
         if (handlerConstr == null) {
@@ -92,8 +93,14 @@
         }
 
         // Reading the feed name attribute.
-        String feedNameAttr = Tools.getAttributeValue(definition, FeedsConstants.NAME_ATTR);
+        String feedNameAttr = Tools.getAttributeValue(definition,
+                FeedsConstants.NAME_ATTR);
 
+        if (feedNameAttr == null) {
+            log.warn("Found a feed definition without a name. Ingoring.");
+            return;
+        }
+
         // Getting all variables that are in the given node.
         Set<String> variables = getVariablesForNode(definition);
 




More information about the jboss-svn-commits mailing list