cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r375699 - /cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
Date Tue, 07 Feb 2006 20:58:40 GMT
Author: danielf
Date: Tue Feb  7 12:58:33 2006
New Revision: 375699

URL: http://svn.apache.org/viewcvs?rev=375699&view=rev
Log:
A known file is needed for getting the context root path from the ServletContext. Using the
sitemap instead of a block specific file. In this way there is no dependencies on the blocks
fw anymore.

Modified:
    cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java

Modified: cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java?rev=375699&r1=375698&r2=375699&view=diff
==============================================================================
--- cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
(original)
+++ cocoon/trunk/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
Tue Feb  7 12:58:33 2006
@@ -33,7 +33,6 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.Processor;
-import org.apache.cocoon.blocks.BlockConstants;
 import org.apache.cocoon.components.LifecycleHelper;
 import org.apache.cocoon.components.treeprocessor.TreeProcessor;
 import org.apache.cocoon.core.Core;
@@ -94,8 +93,15 @@
             throw new ServletException("Could not find a Core object from the parent service
manager", e);
         }
         
-        Context context = CoreUtil.createContext(config, core.getSettings(), BlockConstants.BLOCK_CONF);
-        this.contextURL = CoreUtil.getContextURL(this.getServletContext(), BlockConstants.BLOCK_CONF);
+        String sitemapPath = null;
+        try {
+            sitemapPath = this.config.getAttribute("file");
+        } catch (ConfigurationException e) {
+            throw new ServletException("Faulty sitemap configuration ", e);
+        }
+        
+        Context context = CoreUtil.createContext(config, core.getSettings(), sitemapPath);
+        this.contextURL = CoreUtil.getContextURL(this.getServletContext(), sitemapPath);
         
         try {
             this.processor = (Processor) ClassUtils.newInstance(TreeProcessor.class.getName());



Mime
View raw message