You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/10/30 15:45:30 UTC

svn commit: r469153 - in /cocoon/trunk: core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ core/cocoon-core/src/main/resources/META-INF/legacy/ core/cocoon-core/src/main/resources/org/apache/cocoon/ core/cocoon-core/src/main...

Author: cziegeler
Date: Mon Oct 30 06:45:27 2006
New Revision: 469153

URL: http://svn.apache.org/viewvc?view=rev&rev=469153
Log:
Make cocoon.xconf optional

Added:
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf   (with props)
Removed:
    cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/legacy/cocoon.xconf
Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/avalon/avalon.xsd
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/applicationContext.xml
    cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml
    cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonElementParser.java?view=diff&rev=469153&r1=469152&r2=469153
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonElementParser.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonElementParser.java Mon Oct 30 06:45:27 2006
@@ -64,9 +64,9 @@
      */
     public BeanDefinition parse(Element element, ParserContext parserContext) {
         final ResourceLoader resourceLoader = parserContext.getReaderContext().getReader().getResourceLoader();
-        // read avalon style configuration
-        // the schema ensures that location is never null
-        final String location = element.getAttribute("location");
+        // read avalon style configuration - it's optional for this element.
+        // the schema for the sitemap element ensures that location is never null.
+        final String location = this.getAttributeValue(element, "location", "resource://org/apache/cocoon/cocoon.xconf");
         try {
             final ConfigurationInfo info = this.readConfiguration(location, resourceLoader);
     

Added: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf?view=auto&rev=469153
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf (added)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf Mon Oct 30 06:45:27 2006
@@ -0,0 +1,44 @@
+<?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.
+-->
+<!--+ 
+    | This is the default cocoon.xconf which is used if no one configuration file is used. 
+    | $Id$
+    +-->
+<cocoon version="2.2">
+
+  <!--+
+      | Include the core roles definitions. This is for the sake of clarity,
+      | as they are implicitely loaded at startup, but we may want to remove
+      | this implicit behaviour in the future now that we have the include
+      | mechanism. 
+      +-->
+  <include src="resource://org/apache/cocoon/cocoon.roles"/>
+
+  <!--+
+      | Include all configuration files ending with ".xconf" 
+      | from the xconf directory.
+      +-->
+  <include dir="context://WEB-INF/cocoon/xconf" pattern="*.xconf"/>
+
+  <!--+
+      | Include all configuration files ending with ".xmap" 
+      | from the sitemap-additions directory.
+      +-->
+  <include dir="context://WEB-INF/cocoon/sitemap-additions" pattern="*.xmap"/>
+  
+</cocoon>

Propchange: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/avalon/avalon.xsd
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/avalon/avalon.xsd?view=diff&rev=469153&r1=469152&r2=469153
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/avalon/avalon.xsd (original)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/avalon/avalon.xsd Mon Oct 30 06:45:27 2006
@@ -23,12 +23,12 @@
     <xsd:element name="sitemap" type="tns:sitemapType"/>
 
     <xsd:complexType name="avalonType">
-    	<xsd:attribute name="location" type="xsd:string"></xsd:attribute>
-    	<xsd:attribute name="loggingConfiguration" type="xsd:string" use="optional"></xsd:attribute>
+    	<xsd:attribute name="location" type="xsd:string" use="optional"/>
+    	<xsd:attribute name="loggingConfiguration" type="xsd:string" use="optional"/>
     </xsd:complexType>
 
     <xsd:complexType name="sitemapType">
-        <xsd:attribute name="location" type="xsd:string"></xsd:attribute>
-    	<xsd:attribute name="uriPrefix" type="xsd:string"></xsd:attribute>
+        <xsd:attribute name="location" type="xsd:string"/>
+    	<xsd:attribute name="uriPrefix" type="xsd:string"/>
     </xsd:complexType>
 </xsd:schema>

Modified: cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/applicationContext.xml?view=diff&rev=469153&r1=469152&r2=469153
==============================================================================
--- cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/applicationContext.xml Mon Oct 30 06:45:27 2006
@@ -33,8 +33,9 @@
        If you want to use a different logger than the default log4j logger,
        add a bean conforming to the Avalon Logger interface to this definition
        and leave out the loggingConfiguration attribute.
+       If you have an own cocoon.xconf specify the location attribute,
+       like location="/WEB-INF/cocoon/cocoon.xconf".
    -->
-  <avalon:avalon location="/WEB-INF/cocoon/cocoon.xconf"
-                 loggingConfiguration="/WEB-INF/cocoon/log4j.xconf"/>
+  <avalon:avalon loggingConfiguration="/WEB-INF/cocoon/log4j.xconf"/>
 
 </beans>

Modified: cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml?view=diff&rev=469153&r1=469152&r2=469153
==============================================================================
--- cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml Mon Oct 30 06:45:27 2006
@@ -33,8 +33,9 @@
        If you want to use a different logger than the default log4j logger,
        add a bean conforming to the Avalon Logger interface to this definition
        and leave out the loggingConfiguration attribute.
+       If you have an own cocoon.xconf specify the location attribute,
+       like location="/WEB-INF/cocoon/cocoon.xconf".
    -->
-  <avalon:avalon location="/WEB-INF/cocoon/cocoon.xconf"
-                 loggingConfiguration="/WEB-INF/cocoon/log4j.xconf"/>
+  <avalon:avalon loggingConfiguration="/WEB-INF/cocoon/log4j.xconf"/>
 
 </beans>

Modified: cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java?view=diff&rev=469153&r1=469152&r2=469153
==============================================================================
--- cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java (original)
+++ cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java Mon Oct 30 06:45:27 2006
@@ -74,7 +74,6 @@
             try {
                 this.logger.info("Deploying " + id);
                 RuleBasedZipExtractor zipExtractor = new RuleBasedZipExtractor(basedir, logger);
-                zipExtractor.addRule("META-INF/legacy/cocoon.xconf", new SingleFileDeployer("WEB-INF/cocoon"));
                 zipExtractor.addRule("META-INF/legacy/xconf/**", new SingleFileDeployer("WEB-INF/cocoon/xconf"));
                 zipExtractor.addRule("META-INF/legacy/sitemap-additions/**", new SingleFileDeployer(
                         "WEB-INF/cocoon/sitemap-additions"));