[jboss-svn-commits] JBL Code SVN: r5019 - 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 11 17:22:04 EDT 2006


Author: adamw
Date: 2006-07-11 17:22:02 -0400 (Tue, 11 Jul 2006)
New Revision: 5019

Modified:
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java
Log:
http://jira.jboss.org/jira/browse/JBLAB-711


Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java	2006-07-11 21:19:24 UTC (rev 5018)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java	2006-07-11 21:22:02 UTC (rev 5019)
@@ -13,6 +13,7 @@
 import org.w3c.dom.Node;
 
 import java.util.Map;
+import java.util.HashMap;
 
 /**
  * @author Adam Warski (adamw at aster.pl)
@@ -32,23 +33,28 @@
         Map<String, String> attributes = Tools.getMapFromNodeAttributes(definition);
         s.make(attributes);
 
-        // Creating a velocity context with parts that won't change in all
-        // generated feeds.
-        VelocityContext vc = new VelocityContext(attributes);
-        FeedsTools.prepareVelocityContext(attributes, fd, vc);
-
+        Map<String, Object> velocityAttributes = new HashMap<String, Object>();
         for (String key : attributes.keySet()) {
             if (key.startsWith(Constants.CLASS_ATTR_PREFIX)) {
                 try {
-                    vc.put(key.substring(Constants.CLASS_ATTR_PREFIX.length()),
+                    System.out.println("PUTTING WITH KEY: " + key.substring(Constants.CLASS_ATTR_PREFIX.length()));
+                    velocityAttributes.put(
+                            key.substring(Constants.CLASS_ATTR_PREFIX.length()),
                             Class.forName(attributes.get(key)).newInstance());
                 } catch (Exception e) {
                     log.error("Exception while loading a class to the " +
                             "velocity context: " + key, e);
                 }
+            } else {
+                velocityAttributes.put(key, attributes.get(key));
             }
         }
 
+        // Creating a velocity context with parts that won't change in all
+        // generated feeds.
+        VelocityContext vc = new VelocityContext(velocityAttributes);
+        FeedsTools.prepareVelocityContext(attributes, fd, vc);
+
         for (VelocityContextExpander vce : fd.getVelocityContextExpanderManager().
                 getExpandersForTagFeeds()) {
             vce.expandContext(vc);




More information about the jboss-svn-commits mailing list