cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r606796 - in /cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main: java/org/apache/cocoon/core/container/spring/avalon/ resources/META-INF/cocoon/spring/
Date Tue, 25 Dec 2007 18:12:08 GMT
Author: cziegeler
Date: Tue Dec 25 10:12:05 2007
New Revision: 606796

URL: http://svn.apache.org/viewvc?rev=606796&view=rev
Log:
Hopefully fix lookup of per sitemap input modules by defining the relevant beans as per sitemap
components inside the sitemap creation.

Removed:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/LegacySitemapStringTemplateParser.xml
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/StringTemplateParserVariableResolver.xml
Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java?rev=606796&r1=606795&r2=606796&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
Tue Dec 25 10:12:05 2007
@@ -18,16 +18,17 @@
  */
 package org.apache.cocoon.core.container.spring.avalon;
 
+import org.apache.cocoon.core.container.spring.logger.ChildLoggerFactoryBean;
+import org.apache.cocoon.core.container.spring.logger.LoggerUtils;
+import org.apache.cocoon.spring.configurator.WebAppContextUtils;
 import org.apache.excalibur.source.SourceResolver;
+import org.springframework.beans.factory.config.RuntimeBeanReference;
+import org.springframework.beans.factory.support.BeanDefinitionReader;
 import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.ChildBeanDefinition;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.core.io.ResourceLoader;
 import org.springframework.web.context.WebApplicationContext;
-
-import org.apache.cocoon.core.container.spring.logger.ChildLoggerFactoryBean;
-import org.apache.cocoon.core.container.spring.logger.LoggerUtils;
-import org.apache.cocoon.spring.configurator.WebAppContextUtils;
-
 import org.w3c.dom.Element;
 
 /**
@@ -36,6 +37,30 @@
  * @version $Id$
  */
 public class SitemapElementParser extends BridgeElementParser {
+
+    /**
+     * @see org.apache.cocoon.core.container.spring.avalon.BridgeElementParser#createComponents(org.w3c.dom.Element,
org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo, org.springframework.beans.factory.support.BeanDefinitionRegistry,
org.springframework.beans.factory.support.BeanDefinitionReader, org.springframework.core.io.ResourceLoader)
+     */
+    public void createComponents(Element element, ConfigurationInfo info,
+            BeanDefinitionRegistry registry, BeanDefinitionReader reader,
+            ResourceLoader resourceLoader) throws Exception {
+        super.createComponents(element, info, registry, reader, resourceLoader);
+        // add string template parser for sitemap variable substitution
+        final ChildBeanDefinition beanDef = new ChildBeanDefinition("org.apache.cocoon.template.expression.AbstractStringTemplateParser");
+        beanDef.setBeanClassName("org.apache.cocoon.components.treeprocessor.variables.LegacySitemapStringTemplateParser");
+        beanDef.setSingleton(true);
+        beanDef.setLazyInit(false);
+        beanDef.getPropertyValues().addPropertyValue("serviceManager", new RuntimeBeanReference("org.apache.avalon.framework.service.ServiceManager"));
+        this.register(beanDef, "org.apache.cocoon.el.parsing.StringTemplateParser/legacySitemap",
null, registry);
+
+        final RootBeanDefinition resolverDef = new RootBeanDefinition();
+        resolverDef.setBeanClassName("org.apache.cocoon.components.treeprocessor.variables.StringTemplateParserVariableResolver");
+        resolverDef.setLazyInit(false);
+        resolverDef.setScope("prototype");
+        resolverDef.getPropertyValues().addPropertyValue("stringTemplateParser", new RuntimeBeanReference("org.apache.cocoon.el.parsing.StringTemplateParser/legacySitemap"));
+        resolverDef.getPropertyValues().addPropertyValue("objectModel", new RuntimeBeanReference("org.apache.cocoon.el.objectmodel.ObjectModel"));
+        this.register(resolverDef, "org.apache.cocoon.components.treeprocessor.variables.StringTemplateParserVariableResolver",
null, registry);
+    }
 
     /**
      * @see BridgeElementParser#addContext(Element, BeanDefinitionRegistry)



Mime
View raw message