cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r648736 - in /cocoon/trunk: core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/blockdeployment/ core/cocoon-servlet-service/cocoon-servlet-service-impl/ core/cocoon-servlet-service/cocoon-servlet-service-im...
Date Wed, 16 Apr 2008 16:24:41 GMT
Author: reinhard
Date: Wed Apr 16 09:24:32 2008
New Revision: 648736

URL: http://svn.apache.org/viewvc?rev=648736&view=rev
Log:
move resources out of SSF and SpringConfigurator into the appropriate new modules (jnet, block-deployment

Added:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-callstack.xml
      - copied, changed from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-callstack-environment.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-context.xml
      - copied, changed from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servletservice-context.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-protocol.xml
      - copied unchanged from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-servlet-map.xml
      - copied, changed from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-urlhandler-advice.xml
      - copied, changed from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java
  (with props)
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java
  (with props)
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java
  (with props)
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockDeploymentServletContextListener.java
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/DeploymentUtil.java
      - copied unchanged from r648720, cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/blockdeployment/DeploymentUtil.java
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/url/
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/url/
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml
  (with props)
    cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/
    cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/
    cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java
      - copied, changed from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java
    cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/
    cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/
    cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/
    cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml
  (with props)
Removed:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/blockdeployment/
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-callstack-environment.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servletservice-context.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml
    cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/blockdeployment/
Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml
    cocoon/trunk/subprojects/cocoon-block-deployment/   (props changed)
    cocoon/trunk/subprojects/cocoon-block-deployment/pom.xml
    cocoon/trunk/subprojects/cocoon-jnet/pom.xml

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml?rev=648736&r1=648735&r2=648736&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml Wed Apr 16
09:24:32 2008
@@ -97,28 +97,6 @@
     <!-- Spring Framework -->
     <dependency>
       <groupId>org.springframework</groupId>
-      <artifactId>spring-aop</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>avalon-framework</groupId>
-          <artifactId>avalon-framework</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>logkit</groupId>
-          <artifactId>logkit</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.aspectj</groupId>
-      <artifactId>aspectjrt</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.aspectj</groupId>
-      <artifactId>aspectjweaver</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
       <artifactId>spring-core</artifactId>
     </dependency>
     <dependency>

Copied: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-callstack.xml
(from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-callstack-environment.xml)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-callstack.xml?p2=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-callstack.xml&p1=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-callstack-environment.xml&r1=648159&r2=648736&rev=648736&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-callstack-environment.xml
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-callstack.xml
Wed Apr 16 09:24:32 2008
@@ -15,7 +15,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!-- SVN $Id: cocoon-callstack-environment.xml 548029 2007-06-17 09:02:20Z danielf $ -->
+<!-- SVN $Id$ -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"

Copied: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-context.xml
(from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servletservice-context.xml)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-context.xml?p2=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-context.xml&p1=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servletservice-context.xml&r1=648159&r2=648736&rev=648736&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servletservice-context.xml
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-context.xml
Wed Apr 16 09:24:32 2008
@@ -24,9 +24,8 @@
 
     <!-- The context object of the current base call frame -->
     <bean name="javax.servlet.ServletContext/baseframe"
-          class="org.apache.cocoon.servletservice.spring.BaseServletContextFactoryBean"
-          scope="call">
-        <aop:scoped-proxy proxy-target-class="false"/>
+      class="org.apache.cocoon.servletservice.spring.BaseServletContextFactoryBean" scope="call">
+      <aop:scoped-proxy proxy-target-class="false" />
     </bean>
 
 </beans>

Copied: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-servlet-map.xml
(from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-servlet-map.xml?p2=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-servlet-map.xml&p1=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml&r1=648159&r2=648736&rev=648736&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-servlet-map.xml
Wed Apr 16 09:24:32 2008
@@ -15,19 +15,14 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-
-<!--
-  - $Id$
-  -->
+<!-- $Id$ -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:configurator="http://cocoon.apache.org/schema/configurator"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                            http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd">
 
-    <configurator:bean-map id="org.apache.cocoon.servletservice.spring.BlockServletMap"
-                           type="javax.servlet.Servlet"
-                           has-properties="mountPath"
-                           key-property="mountPath"/>
+    <configurator:bean-map id="org.apache.cocoon.servletservice.spring.BlockServletMap"
type="javax.servlet.Servlet"
+      has-properties="mountPath" key-property="mountPath" />
 
 </beans>

Copied: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-urlhandler-advice.xml
(from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-urlhandler-advice.xml?p2=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-urlhandler-advice.xml&p1=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml&r1=648159&r2=648736&rev=648736&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ssf-urlhandler-advice.xml
Wed Apr 16 09:24:32 2008
@@ -21,27 +21,16 @@
 <beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:aop="http://www.springframework.org/schema/aop"
-  xmlns:configurator="http://cocoon.apache.org/schema/configurator"
   xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
-    http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
 
-  <bean id="org.apache.cocoon.url.URLHandlerFactoryCollector" class="org.apache.cocoon.url.URLHandlerFactoryCollector">
-    <property name="urlHandlerFactories">
-      <configurator:bean-map type="java.net.URLStreamHandlerFactory" strip-prefix="true"
/>
-    </property>
-  </bean>
-
   <aop:config>
-    <aop:aspect id="installURL" ref="org.apache.cocoon.url.URLHandlerFactoryCollector">
+    <aop:aspect id="installURL" ref="org.apache.cocoon.jnet.URLHandlerFactoryCollector">
       <aop:pointcut id="servletServiceInvocation"
         expression="execution(* javax.servlet.Servlet.service(..)) and bean(*/embedded)"
/>
-      <aop:pointcut id="servletInitialization"
-        expression="execution(* javax.servlet.Servlet.init(..)) and bean(*/embedded)" />
 
       <aop:around pointcut-ref="servletServiceInvocation" method="installURLHandlers"
/>
-      <aop:around pointcut-ref="servletInitialization" method="installURLHandlers" />
     </aop:aspect>
   </aop:config>
 

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Apr 16 09:24:32 2008
@@ -0,0 +1,6 @@
+.externalToolBuilders
+.settings
+target
+.classpath
+.project
+maven-eclipse.xml

Modified: cocoon/trunk/subprojects/cocoon-block-deployment/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-block-deployment/pom.xml?rev=648736&r1=648735&r2=648736&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-block-deployment/pom.xml (original)
+++ cocoon/trunk/subprojects/cocoon-block-deployment/pom.xml Wed Apr 16 09:24:32 2008
@@ -33,9 +33,49 @@
   <artifactId>cocoon-block-deployment</artifactId>
   <version>1.0.0-SNAPSHOT</version>
   <name>Cocoon: Block Deployment</name>
-  <description>Deployment utiliities for Cocoon Blocks.</description>
+  <description>Deployment utilities for Cocoon Blocks.</description>
 
   <dependencies>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <exclusions>
+        <exclusion>
+          <artifactId>logkit</artifactId>
+          <groupId>logkit</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>avalon-framework</artifactId>
+          <groupId>avalon-framework</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
     <!-- Test dependencies -->
     <dependency>
       <groupId>junit</groupId>

Added: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java?rev=648736&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java
(added)
+++ cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java
Wed Apr 16 09:24:32 2008
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.blockdeployment;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Map;
+
+public class BlockContextURLConnection extends URLConnection {
+
+    private URL resolvedPath;
+    private final Map blockContexts;
+
+    protected BlockContextURLConnection(URL url, Map blockContexts) {
+        super(url);
+        this.blockContexts = blockContexts;
+        this.url = url;
+    }
+
+    public void connect() throws IOException {
+        this.getRealPath().openConnection().connect();
+    }
+
+    public InputStream getInputStream() throws IOException {
+        return getRealPath().openStream();
+    }
+
+    private URL getRealPath() {
+        if (this.resolvedPath == null) {
+            String location = this.url.toExternalForm();
+
+            // Remove the protocol and the first '/'
+            int pos = location.indexOf(":/");
+            String path = location.substring(pos + 2);
+
+            pos = path.indexOf('/');
+            if (pos != -1) {
+                // extract the block name and get the block context path
+                String blockName = path.substring(0, pos);
+                path = path.substring(pos + 1);
+                String blockContext = (String) this.blockContexts.get(blockName);
+
+                try {
+                    this.resolvedPath = new URL(new URL(blockContext), path);
+                } catch (MalformedURLException e) {
+                    throw new RuntimeException("Can create URL for '" + blockContext + path
+ "'.'");
+                }
+            } else {
+                throw new RuntimeException("The block name part of a block context uri must
end with a '/' in "
+                        + location);
+            }
+        }
+        return this.resolvedPath;
+    }
+}

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLConnection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java?rev=648736&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java
(added)
+++ cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java
Wed Apr 16 09:24:32 2008
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.blockdeployment;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.util.Map;
+
+
+public class BlockContextURLStreamHandler extends URLStreamHandler {
+
+    private final Map blockContexts;
+
+    public BlockContextURLStreamHandler(Map blockContexts) {
+        this.blockContexts = blockContexts;
+    }
+
+    protected URLConnection openConnection(URL url) throws IOException {
+        return new BlockContextURLConnection(url, this.blockContexts);
+    }
+
+}

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java?rev=648736&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java
(added)
+++ cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java
Wed Apr 16 09:24:32 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.blockdeployment;
+
+import java.net.URLStreamHandler;
+import java.net.URLStreamHandlerFactory;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.web.context.WebApplicationContext;
+
+public class BlockContextURLStreamHandlerFactory implements URLStreamHandlerFactory, ApplicationContextAware
{
+
+    private Map blockContexts;
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see java.net.URLStreamHandlerFactory#createURLStreamHandler(java.lang.String)
+     */
+    public URLStreamHandler createURLStreamHandler(String protocol) {
+        if ("blockcontext".equalsIgnoreCase(protocol)) {
+            return new BlockContextURLStreamHandler(this.blockContexts);
+        }
+
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
+     */
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
+        WebApplicationContext webApplicationContext = (WebApplicationContext) applicationContext;
+        ServletContext servletContext = webApplicationContext.getServletContext();
+        this.blockContexts = (Map) servletContext.getAttribute(BlockDeploymentServletContextListener.BLOCK_CONTEXT_MAP);
+    }
+}

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockContextURLStreamHandlerFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockDeploymentServletContextListener.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockDeploymentServletContextListener.java?rev=648736&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockDeploymentServletContextListener.java
(added)
+++ cocoon/trunk/subprojects/cocoon-block-deployment/src/main/java/org/apache/cocoon/blockdeployment/BlockDeploymentServletContextListener.java
Wed Apr 16 09:24:32 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.blockdeployment;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+
+
+public class BlockDeploymentServletContextListener implements ServletContextListener {
+
+    public static final String BLOCK_CONTEXT_MAP = BlockDeploymentServletContextListener.class.getName()
+ "/"
+            + "block-context-map";
+
+    public void contextInitialized(ServletContextEvent sce) {
+        try {
+            ServletContext servletContext = sce.getServletContext();
+
+            Map blocks = DeploymentUtil.deployBlockArtifacts(this.getWorkdir(servletContext).getAbsolutePath());
+            servletContext.setAttribute(BLOCK_CONTEXT_MAP, blocks);
+        } catch (IOException e) {
+            throw new RuntimeException("The available Cocoon blocks can't be deployed.",
e);
+        }
+    }
+
+    public void contextDestroyed(ServletContextEvent sce) {
+        sce.getServletContext().removeAttribute(BLOCK_CONTEXT_MAP);
+    }
+
+    private File getWorkdir(ServletContext servletContext) {
+        File workdir = (File) servletContext.getAttribute("javax.servlet.context.tempdir");
+        if (workdir == null) {
+            workdir = new File("cocoon-files");
+        }
+
+        return workdir;
+    }
+}

Added: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml?rev=648736&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml
(added)
+++ cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml
Wed Apr 16 09:24:32 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<!-- $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+  <bean name="org.apache.cocoon.blockdeployment.BlockContextURLStreamHandlerFactory"
+    class="org.apache.cocoon.blockdeployment.BlockContextURLStreamHandlerFactory" />
+
+</beans>

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/subprojects/cocoon-block-deployment/src/main/resources/META-INF/cocoon/spring/cocoon-blockdeployment-protocol.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cocoon/trunk/subprojects/cocoon-jnet/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-jnet/pom.xml?rev=648736&r1=648735&r2=648736&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-jnet/pom.xml (original)
+++ cocoon/trunk/subprojects/cocoon-jnet/pom.xml Wed Apr 16 09:24:32 2008
@@ -38,6 +38,37 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-spring-configurator</artifactId>
+      <scope>runtime</scope>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-aop</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>avalon-framework</groupId>
+          <artifactId>avalon-framework</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>logkit</groupId>
+          <artifactId>logkit</artifactId>
+        </exclusion>
+      </exclusions>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjrt</artifactId>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjweaver</artifactId>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
       <groupId>org.apache.excalibur.components</groupId>
       <artifactId>excalibur-sourceresolve</artifactId>
       <optional>true</optional>

Copied: cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java
(from r648159, cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java?p2=cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java&p1=cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java&r1=648159&r2=648736&rev=648736&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java
(original)
+++ cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java
Wed Apr 16 09:24:32 2008
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.cocoon.url;
+package org.apache.cocoon.jnet;
 
 import java.net.URLStreamHandlerFactory;
 import java.util.Collections;
@@ -24,7 +24,7 @@
 import java.util.Map;
 
 import org.apache.excalibur.sourceresolve.jnet.DynamicURLStreamHandlerFactory;
-import org.apache.excalibur.sourceresolve.jnet.Installer;
+import org.apache.excalibur.sourceresolve.jnet.URLStreamHandlerFactoryInstaller;
 import org.aspectj.lang.ProceedingJoinPoint;
 
 public class URLHandlerFactoryCollector {
@@ -36,7 +36,7 @@
     public Object installURLHandlers(ProceedingJoinPoint proceedingJoinPoint) throws Throwable
{
         try {
             if (!this.urlStreamHandlerInstalled) {
-                Installer.setURLStreamHandlerFactory(new DynamicURLStreamHandlerFactory());
+                URLStreamHandlerFactoryInstaller.setURLStreamHandlerFactory(new DynamicURLStreamHandlerFactory());
                 this.urlStreamHandlerInstalled = true;
             }
 

Added: cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml?rev=648736&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml
(added)
+++ cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml
Wed Apr 16 09:24:32 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<!-- $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:configurator="http://cocoon.apache.org/schema/configurator"
+  xsi:schemaLocation="
+    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+    http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd">
+
+  <bean id="org.apache.cocoon.jnet.URLHandlerFactoryCollector" class="org.apache.cocoon.jnet.URLHandlerFactoryCollector">
+    <property name="urlHandlerFactories">
+      <configurator:bean-map type="java.net.URLStreamHandlerFactory" strip-prefix="true"
/>
+    </property>
+  </bean>
+
+</beans>

Propchange: cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/subprojects/cocoon-jnet/src/main/resources/COB-INF/cocoon/spring/cocoon-jnet-collector.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message