Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[maven-release-plugin] copy for tag cocoon-spring-configurator-2.1.0

git-svn-id: https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration@761910 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 598e8881266a2e3fd3814b03742f527b64a85241 1 parent 1a0ef14
Reinhard Pötz reinhard authored

Showing 32 changed files with 3,919 additions and 0 deletions. Show diff stats Hide diff stats

  1. +201 0 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/LICENSE.txt
  2. +5 0 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/NOTICE.txt
  3. +146 0 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/pom.xml
  4. +107 0 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/src/changes/changes.xml
  5. +47 0 ...or/cocoon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/ResourceFilter.java
  6. +242 0 ...tor/cocoon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
  7. +123 0 ...ocoon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/WebAppContextUtils.java
  8. +226 0 ...ring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractElementParser.java
  9. +365 0 ....1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
  10. +247 0 ...figurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
  11. +335 0 ...ator/cocoon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java
  12. +59 0 ...pring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMapElementParser.java
  13. +61 0 ...r-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsBeanFactoryPostProcessor.java
  14. +75 0 ...configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java
  15. +119 0 ...figurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildXmlWebApplicationContext.java
  16. +48 0 ...nfigurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
  17. +51 0 ...or/cocoon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/Constants.java
  18. +138 0 ...ator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java
  19. +86 0 ...n-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/RunningModeHelper.java
  20. +69 0 ...-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/ServletContextFactoryBean.java
  21. +358 0 ...urator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
  22. +140 0 ...ring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
  23. +59 0 ...-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsProperties.java
  24. +69 0 ...oon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMap.java
  25. +56 0 ...nfigurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMapElementParser.java
  26. +77 0 ...-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/log4j/Log4JConfigurator.java
  27. +16 0 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/src/main/resources/META-INF/spring.handlers
  28. +19 0 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/src/main/resources/META-INF/spring.schemas
  29. +93 0 ...gurator-2.1.0/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd
  30. +71 0 ...figurator-2.1.0/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd
  31. +95 0 ...gurator-2.1.0/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.0.0.xsd
  32. +116 0 ...gurator-2.1.0/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd
201 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/LICENSE.txt
... ... @@ -0,0 +1,201 @@
  1 + Apache License
  2 + Version 2.0, January 2004
  3 + http://www.apache.org/licenses/
  4 +
  5 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  6 +
  7 + 1. Definitions.
  8 +
  9 + "License" shall mean the terms and conditions for use, reproduction,
  10 + and distribution as defined by Sections 1 through 9 of this document.
  11 +
  12 + "Licensor" shall mean the copyright owner or entity authorized by
  13 + the copyright owner that is granting the License.
  14 +
  15 + "Legal Entity" shall mean the union of the acting entity and all
  16 + other entities that control, are controlled by, or are under common
  17 + control with that entity. For the purposes of this definition,
  18 + "control" means (i) the power, direct or indirect, to cause the
  19 + direction or management of such entity, whether by contract or
  20 + otherwise, or (ii) ownership of fifty percent (50%) or more of the
  21 + outstanding shares, or (iii) beneficial ownership of such entity.
  22 +
  23 + "You" (or "Your") shall mean an individual or Legal Entity
  24 + exercising permissions granted by this License.
  25 +
  26 + "Source" form shall mean the preferred form for making modifications,
  27 + including but not limited to software source code, documentation
  28 + source, and configuration files.
  29 +
  30 + "Object" form shall mean any form resulting from mechanical
  31 + transformation or translation of a Source form, including but
  32 + not limited to compiled object code, generated documentation,
  33 + and conversions to other media types.
  34 +
  35 + "Work" shall mean the work of authorship, whether in Source or
  36 + Object form, made available under the License, as indicated by a
  37 + copyright notice that is included in or attached to the work
  38 + (an example is provided in the Appendix below).
  39 +
  40 + "Derivative Works" shall mean any work, whether in Source or Object
  41 + form, that is based on (or derived from) the Work and for which the
  42 + editorial revisions, annotations, elaborations, or other modifications
  43 + represent, as a whole, an original work of authorship. For the purposes
  44 + of this License, Derivative Works shall not include works that remain
  45 + separable from, or merely link (or bind by name) to the interfaces of,
  46 + the Work and Derivative Works thereof.
  47 +
  48 + "Contribution" shall mean any work of authorship, including
  49 + the original version of the Work and any modifications or additions
  50 + to that Work or Derivative Works thereof, that is intentionally
  51 + submitted to Licensor for inclusion in the Work by the copyright owner
  52 + or by an individual or Legal Entity authorized to submit on behalf of
  53 + the copyright owner. For the purposes of this definition, "submitted"
  54 + means any form of electronic, verbal, or written communication sent
  55 + to the Licensor or its representatives, including but not limited to
  56 + communication on electronic mailing lists, source code control systems,
  57 + and issue tracking systems that are managed by, or on behalf of, the
  58 + Licensor for the purpose of discussing and improving the Work, but
  59 + excluding communication that is conspicuously marked or otherwise
  60 + designated in writing by the copyright owner as "Not a Contribution."
  61 +
  62 + "Contributor" shall mean Licensor and any individual or Legal Entity
  63 + on behalf of whom a Contribution has been received by Licensor and
  64 + subsequently incorporated within the Work.
  65 +
  66 + 2. Grant of Copyright License. Subject to the terms and conditions of
  67 + this License, each Contributor hereby grants to You a perpetual,
  68 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  69 + copyright license to reproduce, prepare Derivative Works of,
  70 + publicly display, publicly perform, sublicense, and distribute the
  71 + Work and such Derivative Works in Source or Object form.
  72 +
  73 + 3. Grant of Patent License. Subject to the terms and conditions of
  74 + this License, each Contributor hereby grants to You a perpetual,
  75 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  76 + (except as stated in this section) patent license to make, have made,
  77 + use, offer to sell, sell, import, and otherwise transfer the Work,
  78 + where such license applies only to those patent claims licensable
  79 + by such Contributor that are necessarily infringed by their
  80 + Contribution(s) alone or by combination of their Contribution(s)
  81 + with the Work to which such Contribution(s) was submitted. If You
  82 + institute patent litigation against any entity (including a
  83 + cross-claim or counterclaim in a lawsuit) alleging that the Work
  84 + or a Contribution incorporated within the Work constitutes direct
  85 + or contributory patent infringement, then any patent licenses
  86 + granted to You under this License for that Work shall terminate
  87 + as of the date such litigation is filed.
  88 +
  89 + 4. Redistribution. You may reproduce and distribute copies of the
  90 + Work or Derivative Works thereof in any medium, with or without
  91 + modifications, and in Source or Object form, provided that You
  92 + meet the following conditions:
  93 +
  94 + (a) You must give any other recipients of the Work or
  95 + Derivative Works a copy of this License; and
  96 +
  97 + (b) You must cause any modified files to carry prominent notices
  98 + stating that You changed the files; and
  99 +
  100 + (c) You must retain, in the Source form of any Derivative Works
  101 + that You distribute, all copyright, patent, trademark, and
  102 + attribution notices from the Source form of the Work,
  103 + excluding those notices that do not pertain to any part of
  104 + the Derivative Works; and
  105 +
  106 + (d) If the Work includes a "NOTICE" text file as part of its
  107 + distribution, then any Derivative Works that You distribute must
  108 + include a readable copy of the attribution notices contained
  109 + within such NOTICE file, excluding those notices that do not
  110 + pertain to any part of the Derivative Works, in at least one
  111 + of the following places: within a NOTICE text file distributed
  112 + as part of the Derivative Works; within the Source form or
  113 + documentation, if provided along with the Derivative Works; or,
  114 + within a display generated by the Derivative Works, if and
  115 + wherever such third-party notices normally appear. The contents
  116 + of the NOTICE file are for informational purposes only and
  117 + do not modify the License. You may add Your own attribution
  118 + notices within Derivative Works that You distribute, alongside
  119 + or as an addendum to the NOTICE text from the Work, provided
  120 + that such additional attribution notices cannot be construed
  121 + as modifying the License.
  122 +
  123 + You may add Your own copyright statement to Your modifications and
  124 + may provide additional or different license terms and conditions
  125 + for use, reproduction, or distribution of Your modifications, or
  126 + for any such Derivative Works as a whole, provided Your use,
  127 + reproduction, and distribution of the Work otherwise complies with
  128 + the conditions stated in this License.
  129 +
  130 + 5. Submission of Contributions. Unless You explicitly state otherwise,
  131 + any Contribution intentionally submitted for inclusion in the Work
  132 + by You to the Licensor shall be under the terms and conditions of
  133 + this License, without any additional terms or conditions.
  134 + Notwithstanding the above, nothing herein shall supersede or modify
  135 + the terms of any separate license agreement you may have executed
  136 + with Licensor regarding such Contributions.
  137 +
  138 + 6. Trademarks. This License does not grant permission to use the trade
  139 + names, trademarks, service marks, or product names of the Licensor,
  140 + except as required for reasonable and customary use in describing the
  141 + origin of the Work and reproducing the content of the NOTICE file.
  142 +
  143 + 7. Disclaimer of Warranty. Unless required by applicable law or
  144 + agreed to in writing, Licensor provides the Work (and each
  145 + Contributor provides its Contributions) on an "AS IS" BASIS,
  146 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  147 + implied, including, without limitation, any warranties or conditions
  148 + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  149 + PARTICULAR PURPOSE. You are solely responsible for determining the
  150 + appropriateness of using or redistributing the Work and assume any
  151 + risks associated with Your exercise of permissions under this License.
  152 +
  153 + 8. Limitation of Liability. In no event and under no legal theory,
  154 + whether in tort (including negligence), contract, or otherwise,
  155 + unless required by applicable law (such as deliberate and grossly
  156 + negligent acts) or agreed to in writing, shall any Contributor be
  157 + liable to You for damages, including any direct, indirect, special,
  158 + incidental, or consequential damages of any character arising as a
  159 + result of this License or out of the use or inability to use the
  160 + Work (including but not limited to damages for loss of goodwill,
  161 + work stoppage, computer failure or malfunction, or any and all
  162 + other commercial damages or losses), even if such Contributor
  163 + has been advised of the possibility of such damages.
  164 +
  165 + 9. Accepting Warranty or Additional Liability. While redistributing
  166 + the Work or Derivative Works thereof, You may choose to offer,
  167 + and charge a fee for, acceptance of support, warranty, indemnity,
  168 + or other liability obligations and/or rights consistent with this
  169 + License. However, in accepting such obligations, You may act only
  170 + on Your own behalf and on Your sole responsibility, not on behalf
  171 + of any other Contributor, and only if You agree to indemnify,
  172 + defend, and hold each Contributor harmless for any liability
  173 + incurred by, or claims asserted against, such Contributor by reason
  174 + of your accepting any such warranty or additional liability.
  175 +
  176 + END OF TERMS AND CONDITIONS
  177 +
  178 + APPENDIX: How to apply the Apache License to your work.
  179 +
  180 + To apply the Apache License to your work, attach the following
  181 + boilerplate notice, with the fields enclosed by brackets "[]"
  182 + replaced with your own identifying information. (Don't include
  183 + the brackets!) The text should be enclosed in the appropriate
  184 + comment syntax for the file format. We also recommend that a
  185 + file or class name and description of purpose be included on the
  186 + same "printed page" as the copyright notice for easier
  187 + identification within third-party archives.
  188 +
  189 + Copyright [yyyy] [name of copyright owner]
  190 +
  191 + Licensed under the Apache License, Version 2.0 (the "License");
  192 + you may not use this file except in compliance with the License.
  193 + You may obtain a copy of the License at
  194 +
  195 + http://www.apache.org/licenses/LICENSE-2.0
  196 +
  197 + Unless required by applicable law or agreed to in writing, software
  198 + distributed under the License is distributed on an "AS IS" BASIS,
  199 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  200 + See the License for the specific language governing permissions and
  201 + limitations under the License.
5 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/NOTICE.txt
... ... @@ -0,0 +1,5 @@
  1 +Apache Cocoon
  2 +Copyright 1999-2008 The Apache Software Foundation.
  3 +
  4 +This product includes software developed at
  5 +The Apache Software Foundation (http://www.apache.org/).
146 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/pom.xml
... ... @@ -0,0 +1,146 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 + Licensed to the Apache Software Foundation (ASF) under one
  4 + or more contributor license agreements. See the NOTICE file
  5 + distributed with this work for additional information
  6 + regarding copyright ownership. The ASF licenses this file
  7 + to you under the Apache License, Version 2.0 (the
  8 + "License"); you may not use this file except in compliance
  9 + with the License. You may obtain a copy of the License at
  10 +
  11 + http://www.apache.org/licenses/LICENSE-2.0
  12 +
  13 + Unless required by applicable law or agreed to in writing,
  14 + software distributed under the License is distributed on an
  15 + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16 + KIND, either express or implied. See the License for the
  17 + specific language governing permissions and limitations
  18 + under the License.
  19 +-->
  20 +<!-- $Id$ -->
  21 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  22 +
  23 + <modelVersion>4.0.0</modelVersion>
  24 + <packaging>jar</packaging>
  25 +
  26 + <parent>
  27 + <artifactId>cocoon</artifactId>
  28 + <groupId>org.apache.cocoon</groupId>
  29 + <version>8</version>
  30 + <relativePath>../../../parent</relativePath>
  31 + </parent>
  32 + <artifactId>cocoon-spring-configurator</artifactId>
  33 + <version>2.1.0</version>
  34 + <name>Cocoon Spring Configurator</name>
  35 + <description>
  36 + The Cocoon Spring Configurator is an extension for the Spring framework.
  37 + It provides a standardized way of handling various configuration issues when using Spring.
  38 + The feature list includes automatic property handling and inclusion of configuration files.
  39 + </description>
  40 +
  41 + <distributionManagement>
  42 + <site>
  43 + <id>website</id>
  44 + <url>${docs.deploymentBaseUrl}/${docs.m.spring-configurator.relPath}/</url>
  45 + </site>
  46 + </distributionManagement>
  47 +
  48 + <properties>
  49 + <docs.name>Cocoon Spring Configurator</docs.name>
  50 + <docs.version>${docs.m.spring-configurator.version}</docs.version>
  51 + <docs.urlRelativizer>../../../../../</docs.urlRelativizer>
  52 + </properties>
  53 +
  54 + <build>
  55 + <plugins>
  56 + <plugin>
  57 + <artifactId>maven-release-plugin</artifactId>
  58 + <configuration>
  59 + <tagBase>https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/${project.artifactId}</tagBase>
  60 + </configuration>
  61 + </plugin>
  62 + </plugins>
  63 + </build>
  64 +
  65 + <dependencies>
  66 + <dependency>
  67 + <groupId>org.apache.cocoon</groupId>
  68 + <artifactId>cocoon-configuration-api</artifactId>
  69 + <version>1.0.2</version>
  70 + </dependency>
  71 + <dependency>
  72 + <groupId>commons-io</groupId>
  73 + <artifactId>commons-io</artifactId>
  74 + </dependency>
  75 + <dependency>
  76 + <groupId>commons-logging</groupId>
  77 + <artifactId>commons-logging</artifactId>
  78 + <exclusions>
  79 + <exclusion>
  80 + <artifactId>logkit</artifactId>
  81 + <groupId>logkit</groupId>
  82 + </exclusion>
  83 + <exclusion>
  84 + <artifactId>avalon-framework</artifactId>
  85 + <groupId>avalon-framework</groupId>
  86 + </exclusion>
  87 + </exclusions>
  88 + </dependency>
  89 + <dependency>
  90 + <groupId>log4j</groupId>
  91 + <artifactId>log4j</artifactId>
  92 + <optional>true</optional>
  93 + </dependency>
  94 + <dependency>
  95 + <groupId>javax.servlet</groupId>
  96 + <artifactId>servlet-api</artifactId>
  97 + <scope>provided</scope>
  98 + </dependency>
  99 + <dependency>
  100 + <groupId>org.springframework</groupId>
  101 + <artifactId>spring-core</artifactId>
  102 + </dependency>
  103 + <dependency>
  104 + <groupId>org.springframework</groupId>
  105 + <artifactId>spring-context</artifactId>
  106 + </dependency>
  107 + <dependency>
  108 + <groupId>org.springframework</groupId>
  109 + <artifactId>spring-beans</artifactId>
  110 + </dependency>
  111 + <dependency>
  112 + <groupId>org.springframework</groupId>
  113 + <artifactId>spring-aop</artifactId>
  114 + </dependency>
  115 + <dependency>
  116 + <groupId>org.springframework</groupId>
  117 + <artifactId>spring-web</artifactId>
  118 + </dependency>
  119 + </dependencies>
  120 +
  121 + <scm>
  122 + <connection>scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/cocoon-spring-configurator/cocoon-spring-configurator-2.1.0</connection>
  123 + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/cocoon-spring-configurator/cocoon-spring-configurator-2.1.0</developerConnection>
  124 + <url>https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/cocoon-spring-configurator/cocoon-spring-configurator-2.1.0</url>
  125 + </scm>
  126 +
  127 + <profiles>
  128 + <profile>
  129 + <id>daisy</id>
  130 + <build>
  131 + <plugins>
  132 + <plugin>
  133 + <groupId>org.daisycms</groupId>
  134 + <artifactId>daisy-maven-plugin</artifactId>
  135 + <configuration>
  136 + <navDocId>1305</navDocId>
  137 + <collection>cdocs-spring-configurator</collection>
  138 + <skipFirstNavigationDocumentLevel>false</skipFirstNavigationDocumentLevel>
  139 + </configuration>
  140 + </plugin>
  141 + </plugins>
  142 + </build>
  143 + </profile>
  144 + </profiles>
  145 +
  146 +</project>
107 cocoon-spring-configurator/cocoon-spring-configurator-2.1.0/src/changes/changes.xml
... ... @@ -0,0 +1,107 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 + Licensed to the Apache Software Foundation (ASF) under one
  4 + or more contributor license agreements. See the NOTICE file
  5 + distributed with this work for additional information
  6 + regarding copyright ownership. The ASF licenses this file
  7 + to you under the Apache License, Version 2.0 (the
  8 + "License"); you may not use this file except in compliance
  9 + with the License. You may obtain a copy of the License at
  10 +
  11 + http://www.apache.org/licenses/LICENSE-2.0
  12 +
  13 + Unless required by applicable law or agreed to in writing,
  14 + software distributed under the License is distributed on an
  15 + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16 + KIND, either express or implied. See the License for the
  17 + specific language governing permissions and limitations
  18 + under the License.
  19 +-->
  20 +
  21 +<!--
  22 + - @see http://maven.apache.org/plugins/maven-changes-plugin/usage.html
  23 + - @version $Id$
  24 + -->
  25 +<document>
  26 + <body>
  27 + <release version="2.1.0" date="2009-??-??" description="unreleased">
  28 + <action dev="reinhard" type="add">
  29 + Add a WildcardBeanMap that extends BeanMap but checks for a wildcard expression
  30 + instead of the bean type.
  31 + </action>
  32 + <action dev="reinhard" type="add">
  33 + Support the definition of a user properties file as servlet context init parameter
  34 + (org.apache.cocoon.settings).
  35 + </action>
  36 + </release>
  37 + <release version="2.0.0" date="2008-08-09" description="released">
  38 + <action dev="gkossakowski" type="update">
  39 + Java 5 as minimum requirement.
  40 + </action>
  41 + <action dev="reinhard" type="fix">
  42 + Remove Block-Deployment functionality into a separate module.
  43 + </action>
  44 + <action dev="gkossakowski" type="add">
  45 + Introduced resource filter feature as explained here: http://article.gmane.org/gmane.text.xml.cocoon.devel/78158
  46 + The resource filtering is used for *all* resources being processed by
  47 + Spring Configurator including beans definitions and property files.
  48 +
  49 + The resource filter itself is a simple class implementing one method of
  50 + ResourceFilter interface.
  51 + </action>
  52 + <action dev="lgawron" type="fix">
  53 + Fix configurator:bean-map throwing ClassCastException when
  54 + key-property="propertyName" did not resolve to a String property.
  55 + </action>
  56 + </release>
  57 +
  58 + <release version="1.0.2" date="2008-04-07" description="released">
  59 + <action dev="reinhard" type="fix" issue="COCOON-2172" due-to="Juan Jose Vazquez Delgado" due-to-email="jvazquez@apache.org">
  60 + Fix block deployment for Weblogic 9.2.
  61 + </action>
  62 + <action dev="vgritsenko" type="fix">
  63 + SettingsBeanFactoryPostProcessor creates work and cache directories only
  64 + after properties are loaded and settings object is populated, and
  65 + not before that.
  66 + </action>
  67 + </release>
  68 +
  69 + <release version="1.0.1" date="2007-09-20" description="released">
  70 + <action dev="giacomo" type="add">
  71 + Added ability to the bean-map handler to specify what properties a bean must have
  72 + to be considered as a candidate for the constructed Map as well as keying the Map
  73 + with a property value from the bean itself instead of its bean-id.
  74 + </action>
  75 + <action dev="cziegeler" type="fix">
  76 + SettingsBeanFactoryPostProcessor can be used outside of a servlet context.
  77 + </action>
  78 + </release>
  79 +
  80 + <release version="1.0.0" date="2007-02-22" description="released">
  81 + <action dev="reinhard" type="fix">
  82 + WebAppContextUtils stored a Spring parent application context in a static field. This
  83 + made it impossible to reload the context. The static field was removed and a request
  84 + for the parent context results in
  85 + WebApplicationContextUtils.getRequiredWebApplicationContext(ServletContext)
  86 + which returns the parent Spring application context stored in the servlet context.
  87 + </action>
  88 + <action dev="cziegeler" type="add">
  89 + Each property reference can have an optional default value, like
  90 + ${my.property.net:THE DEFAULT}. If no other definition for this
  91 + property is found, the default is used.
  92 + </action>
  93 + <action dev="cziegeler" type="add">
  94 + Add a bean map that collects all beans from the Spring context
  95 + conforming to a specified type.
  96 + </action>
  97 + <action dev="cziegeler" type="add">
  98 + Improved the DefaultBlockResourcesHolder to act like a PropertyPlaceholderConfigurer.
  99 + This allows access to the path of the deployed blocks in the configuration files
  100 + through properties like ${org.apache.cocoon.blocks.[BLOCK_NAME].resources}.
  101 + </action>
  102 + <action dev="cziegeler" type="add">
  103 + Initial creation.
  104 + </action>
  105 + </release>
  106 + </body>
  107 +</document>
47 ...cocoon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/ResourceFilter.java
... ... @@ -0,0 +1,47 @@
  1 +/*
  2 + * Licensed to the Apache Software Foundation (ASF) under one or more
  3 + * contributor license agreements. See the NOTICE file distributed with
  4 + * this work for additional information regarding copyright ownership.
  5 + * The ASF licenses this file to You under the Apache License, Version 2.0
  6 + * (the "License"); you may not use this file except in compliance with
  7 + * the License. You may obtain a copy of the License at
  8 + *
  9 + * http://www.apache.org/licenses/LICENSE-2.0
  10 + *
  11 + * Unless required by applicable law or agreed to in writing, software
  12 + * distributed under the License is distributed on an "AS IS" BASIS,
  13 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + * See the License for the specific language governing permissions and
  15 + * limitations under the License.
  16 + */
  17 +package org.apache.cocoon.spring.configurator;
  18 +
  19 +import java.util.Set;
  20 +
  21 +import org.springframework.core.io.Resource;
  22 +
  23 +/**
  24 + * <p>This is an interface for custom implementations of filtering of resources being
  25 + * processed by Spring Configurator.</p>
  26 + *
  27 + * <p>If you want to make some decisions on which resources you want to include at the runtime
  28 + * then you should implement this interface and configure it following way:</p>
  29 + * <pre>
  30 + * <configurator:settings>
  31 + * ..
  32 + * <configurator:filter class="org.package.SomeClass"/>
  33 + * </configurator:settings>
  34 + * </pre>
  35 + *
  36 + * <p>The implementations of this interface should be stateless</p>
  37 + *
  38 + */
  39 +public interface ResourceFilter {
  40 +
  41 + /**
  42 + * @param resources The set of {@link Resource Spring resources}
  43 + * @return
  44 + */
  45 + Set filter(Set resources);
  46 +
  47 +}
242 .../cocoon-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
... ... @@ -0,0 +1,242 @@
  1 +/*
  2 + * Licensed to the Apache Software Foundation (ASF) under one or more
  3 + * contributor license agreements. See the NOTICE file distributed with
  4 + * this work for additional information regarding copyright ownership.
  5 + * The ASF licenses this file to You under the Apache License, Version 2.0
  6 + * (the "License"); you may not use this file except in compliance with
  7 + * the License. You may obtain a copy of the License at
  8 + *
  9 + * http://www.apache.org/licenses/LICENSE-2.0
  10 + *
  11 + * Unless required by applicable law or agreed to in writing, software
  12 + * distributed under the License is distributed on an "AS IS" BASIS,
  13 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + * See the License for the specific language governing permissions and
  15 + * limitations under the License.
  16 + */
  17 +package org.apache.cocoon.spring.configurator;
  18 +
  19 +import java.io.File;
  20 +import java.io.IOException;
  21 +import java.io.InputStream;
  22 +import java.util.ArrayList;
  23 +import java.util.Arrays;
  24 +import java.util.Comparator;
  25 +import java.util.HashSet;
  26 +import java.util.Properties;
  27 +import java.util.Set;
  28 +
  29 +import org.apache.commons.logging.Log;
  30 +import org.springframework.core.io.Resource;
  31 +import org.springframework.core.io.ResourceLoader;
  32 +import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
  33 +import org.springframework.core.io.support.ResourcePatternResolver;
  34 +
  35 +/**
  36 + * Utility class for Spring resource handling.
  37 + *
  38 + * @since 1.0
  39 + * @version $Id$
  40 + */
  41 +public abstract class ResourceUtils {
  42 +
  43 + /**
  44 + * Get the uri of a resource. This method corrects the uri in the case of
  45 + * the file protocol on windows.
  46 + *
  47 + * @param resource The resource.
  48 + * @return The uri.
  49 + * @throws IOException
  50 + */
  51 + public static String getUri(Resource resource) throws IOException {
  52 + if (resource == null) {
  53 + return null;
  54 + }
  55 + return correctUri(resource.getURL().toExternalForm());
  56 + }
  57 +
  58 + protected static String correctUri(String uri) {
  59 + // if it is a file we have to recreate the url,
  60 + // otherwise we get problems under windows with some file
  61 + // references starting with "/DRIVELETTER" and some
  62 + // just with "DRIVELETTER"
  63 + if (uri.startsWith("file:")) {
  64 + final File f = new File(uri.substring(5));
  65 + return "file://" + f.getAbsolutePath();
  66 + }
  67 +
  68 + return uri;
  69 + }
  70 +
  71 + public static boolean isClasspathUri(String uri) {
  72 + return uri.startsWith(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX) ||
  73 + uri.startsWith(ResourceLoader.CLASSPATH_URL_PREFIX);
  74 + }
  75 +
  76 + /**
  77 + * Read all property files from the given directory and apply them to the
  78 + * supplied properties.
  79 + * @param propertiesPath The directory path.
  80 + * @param properties The properties object where all the read properties are applied to.
  81 + * @param resourceLoader The resource loader to load the property files.
  82 + * @param resourceFilter The resource filter used to filter read property files, if null no filtering is being applied.
  83 + * @param logger Optional logger for debugging.
  84 + */
  85 + public static void readProperties(String propertiesPath,
  86 + Properties properties,
  87 + ResourceLoader resourceLoader,
  88 + ResourceFilter resourceFilter,
  89 + Log logger) {
  90 + if (logger != null && logger.isDebugEnabled()) {
  91 + logger.debug("Reading properties from directory: " + propertiesPath);
  92 + }
  93 +
  94 + ResourcePatternResolver resolver;
  95 + if (resourceLoader instanceof ResourcePatternResolver) {
  96 + resolver = (ResourcePatternResolver) resourceLoader;
  97 + } else {
  98 + resolver = new PathMatchingResourcePatternResolver(resourceLoader);
  99 + }
  100 +
  101 + Resource[] resources = null;
  102 +
  103 + // check if directory exists
  104 + boolean load = true;
  105 + if (!ResourceUtils.isClasspathUri(propertiesPath)) {
  106 + final Resource resource = resolver.getResource(propertiesPath);
  107 + if (!resource.exists()) {
  108 + load = false;
  109 + }
  110 + }
  111 + if (load) {
  112 + try {
  113 + resources = resolver.getResources(propertiesPath + "/*.properties");
  114 + resources = filterResources(resources, resourceFilter);
  115 + if (logger != null && logger.isDebugEnabled())
  116 + logger.debug("Found " + resources.length + " matching resources in " +
  117 + propertiesPath + "/*.properties");
  118 + } catch (IOException ignore) {
  119 + if (logger != null && logger.isDebugEnabled()) {
  120 + logger.debug("Unable to read properties from directory '" +
  121 + propertiesPath + "' - Continuing initialization.", ignore);
  122 + }
  123 + }
  124 + }
  125 +
  126 + if (resources != null) {
  127 + // we process the resources in alphabetical order, so we put
  128 + // them first into a list, sort them and then read the properties.
  129 + Arrays.sort(resources, getResourceComparator());
  130 +
  131 + // now process
  132 + for (int i = 0; i < resources.length; i++) {
  133 + final Resource src = resources[i];
  134 + try {
  135 + if (logger != null && logger.isDebugEnabled()) {
  136 + logger.debug("Reading settings from '" + src.getURL() + "'.");
  137 + }
  138 + final InputStream propsIS = src.getInputStream();
  139 + properties.load(propsIS);
  140 + propsIS.close();
  141 + } catch (IOException ignore) {
  142 + if (logger != null && logger.isDebugEnabled()) {
  143 + logger.info("Unable to read properties from file '" + src.getDescription() +
  144 + "' - Continuing initialization.", ignore);
  145 + }
  146 + }
  147 + }
  148 + } else {
  149 + if (logger != null && logger.isDebugEnabled()) {
  150 + logger.debug("Directory '" + propertiesPath + "' does not exist - Continuing initialization.");
  151 + }
  152 + }
  153 + }
  154 +
  155 + /**
  156 + * Return a resource comparator.
  157 + * This comparator compares the file name of two resources.
  158 + * In addition all resources contained in a directory named
  159 + * WEB-INF/classes/cocoon are sorted (in alphabetical) order
  160 + * after all other files.
  161 + *
  162 + * @return A new comparator for resources.
  163 + */
  164 + public static Comparator getResourceComparator() {
  165 + return new ResourceComparator();
  166 + }
  167 +
  168 + /**
  169 + * Class implementing a simple resource comparator as described
  170 + * here: {@link ResourceUtils#getResourceComparator}.
  171 + */
  172 + protected final static class ResourceComparator implements Comparator {
  173 +
  174 + protected static final String WEB_INF_CLASSES_META_INF_COCOON = "/WEB-INF/classes/META-INF/cocoon/";
  175 +
  176 + /**
  177 + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
  178 + */
  179 + public int compare(Object o1, Object o2) {
  180 + if (!(o1 instanceof Resource) || !(o2 instanceof Resource)) {
  181 + return 0;
  182 + }
  183 +
  184 + try {
  185 + String name1 = ((Resource) o1).getURL().toExternalForm();
  186 + String name2 = ((Resource) o2).getURL().toExternalForm();
  187 + // replace '\' with '/'
  188 + name1 = name1.replace('\\', '/');
  189 + name2 = name2.replace('\\', '/');
  190 +
  191 + boolean webInfClasses1 = name1.indexOf(ResourceComparator.WEB_INF_CLASSES_META_INF_COCOON) != -1;
  192 + boolean webInfClasses2 = name2.indexOf(ResourceComparator.WEB_INF_CLASSES_META_INF_COCOON) != -1;
  193 + if (!webInfClasses1 && webInfClasses2) {
  194 + return -1;
  195 + }
  196 + if (webInfClasses1 && !webInfClasses2) {
  197 + return +1;
  198 + }
  199 + } catch (IOException io) {
  200 + // ignore
  201 + }
  202 +
  203 + // default behaviour:
  204 + return ((Resource) o1).getFilename().compareTo(((Resource) o2).getFilename());
  205 + }
  206 + }
  207 +
  208 + /**
  209 + * Return the properties added by Maven.
  210 + *
  211 + * @param groupId The group identifier of the artifact.
  212 + * @param artifactId The artifact identifier.
  213 + * @return Returns a properties object or null if the properties can't be found/read.
  214 + */
  215 + public static Properties getPOMProperties(String groupId, String artifactId) {
  216 + final String resourceName = "META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties";
  217 + try {
  218 + final Properties p = new Properties();
  219 + final InputStream resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceName);
  220 + if (resourceAsStream == null)
  221 + return null;
  222 + p.load(resourceAsStream);
  223 + return p;
  224 + } catch (IOException ignore) {
  225 + return null;
  226 + }
  227 + }
  228 +
  229 + /**
  230 + * @param resources The array of resources need to be filtered
  231 + * @param filter The instance of the filter itself
  232 + * @return the array of resources that has been filtered
  233 + */
  234 + public static Resource[] filterResources(Resource[] resources, ResourceFilter filter) {
  235 + if (filter == null)
  236 + return resources;
  237 +
  238 + Set resourcesSet = new HashSet(Arrays.asList(resources));
  239 + Set filteredResources = filter.filter(resourcesSet);
  240 + return (Resource[])(new ArrayList(filteredResources)).toArray(new Resource[0]);
  241 + }
  242 +}
123 ...on-spring-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/WebAppContextUtils.java
... ... @@ -0,0 +1,123 @@
  1 +/*
  2 + * Licensed to the Apache Software Foundation (ASF) under one or more
  3 + * contributor license agreements. See the NOTICE file distributed with
  4 + * this work for additional information regarding copyright ownership.
  5 + * The ASF licenses this file to You under the Apache License, Version 2.0
  6 + * (the "License"); you may not use this file except in compliance with
  7 + * the License. You may obtain a copy of the License at
  8 + *
  9 + * http://www.apache.org/licenses/LICENSE-2.0
  10 + *
  11 + * Unless required by applicable law or agreed to in writing, software
  12 + * distributed under the License is distributed on an "AS IS" BASIS,
  13 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + * See the License for the specific language governing permissions and
  15 + * limitations under the License.
  16 + */
  17 +package org.apache.cocoon.spring.configurator;
  18 +
  19 +import org.springframework.web.context.WebApplicationContext;
  20 +import org.springframework.web.context.request.RequestAttributes;
  21 +import org.springframework.web.context.request.RequestContextHolder;
  22 +import org.springframework.web.context.support.WebApplicationContextUtils;
  23 +
  24 +import org.apache.cocoon.spring.configurator.impl.ServletContextFactoryBean;
  25 +
  26 +/**
  27 + * Utility class to manage hierarchical application contexts.
  28 + *
  29 + * @version $Id$
  30 + * @since 1.0
  31 + */
  32 +public abstract class WebAppContextUtils {
  33 +
  34 + /** The name of the request attribute containing the current bean factory. */
  35 + public static final String CONTAINER_REQUEST_ATTRIBUTE = WebAppContextUtils.class.getName();
  36 +
  37 + /**
  38 + * Get the current web application context.
  39 + *
  40 + * @throws IllegalStateException if no WebApplicationContext could not be found
  41 + * @return The current web application context.
  42 + */
  43 + public static WebApplicationContext getCurrentWebApplicationContext() {
  44 + final RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
  45 + return getCurrentWebApplicationContext(attributes);
  46 + }
  47 +
  48 + /**
  49 + * Return the current web application context or if the attributes are null, the parent context.
  50 + *
  51 + * @param attributes The request attributes.
  52 + * @throws IllegalStateException if no WebApplicationContext could not be found
  53 + * @return The web application context.
  54 + */
  55 + protected static WebApplicationContext getCurrentWebApplicationContext(RequestAttributes attributes) {
  56 + if (attributes != null) {
  57 + Object obj = attributes.getAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
  58 + if (obj != null) {
  59 + return (WebApplicationContext) obj;
  60 + }
  61 + }
  62 +
  63 + // return the root context
  64 + return WebApplicationContextUtils.getRequiredWebApplicationContext(ServletContextFactoryBean.getServletContext());
  65 + }
  66 +
  67 + /**
  68 + * Notify about entering this context.
  69 + *
  70 + * @param webAppContext The current web application context.
  71 + * @return A handle which should be passed to {@link #leavingContext(WebApplicationContext, Object)}.
  72 + */
  73 + public static Object enteringContext(WebApplicationContext webAppContext) {
  74 + // get request attributes
  75 + final RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
  76 +
  77 + // save current class loader and web application context
  78 + final ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
  79 + final WebApplicationContext oldContext = (WebApplicationContext) attributes.getAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
  80 +
  81 + // set new class loader and context
  82 + attributes.setAttribute(CONTAINER_REQUEST_ATTRIBUTE, webAppContext, RequestAttributes.SCOPE_REQUEST);
  83 + Thread.currentThread().setContextClassLoader(webAppContext.getClassLoader());
  84 +
  85 + return new ContextInfo(oldContext, oldClassLoader);
  86 + }
  87 +
  88 + /**
  89 + * Notify about leaving this context.
  90 + * @param webAppContext The current web application context.
  91 + * @param handle The returned handle from {@link #enteringContext(WebApplicationContext)}.
  92 + */
  93 + public static void leavingContext(WebApplicationContext webAppContext, Object handle) {
  94 + if (!(handle instanceof ContextInfo)) {
  95 + throw new IllegalArgumentException("Handle must be an instance of ContextInfo and not " + handle);
  96 + }
  97 + final ContextInfo info = (ContextInfo) handle;
  98 +
  99 + // get request attributes
  100 + final RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
  101 +
  102 + // restore class loader and previous web application context
  103 + Thread.currentThread().setContextClassLoader(info.classLoader);
  104 + if (info.webAppContext == null) {
  105 + attributes.removeAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
  106 + } else {
  107 + attributes.setAttribute(CONTAINER_REQUEST_ATTRIBUTE, info.webAppContext, RequestAttributes.SCOPE_REQUEST);
  108 + }
  109 + }
  110 +
  111 + /**
  112 + * Private bean keeping track of the class loader and web application context.
  113 + */
  114 + protected static final class ContextInfo {
  115 + public final ClassLoader classLoader;
  116 + public final WebApplicationContext webAppContext;
  117 +
  118 + public ContextInfo(WebApplicationContext w, ClassLoader c) {
  119 + this.classLoader = c;
  120 + this.webAppContext = w;
  121 + }
  122 + }
  123 +}
226 ...g-configurator-2.1.0/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractElementParser.java
... ... @@ -0,0 +1,226 @@
  1 +/*
  2 + * Licensed to the Apache Software Foundation (ASF) under one or more
  3 + * contributor license agreements. See the NOTICE file distributed with
  4 + * this work for additional information regarding copyright ownership.
  5 + * The ASF licenses this file to You under the Apache License, Version 2.0
  6 + * (the "License"); you may not use this file except in compliance with
  7 + * the License. You may obtain a copy of the License at
  8 + *
  9 + * http://www.apache.org/licenses/LICENSE-2.0
  10 + *
  11 + * Unless required by applicable law or agreed to in writing, software
  12 + * distributed under the License is distributed on an "AS IS" BASIS,
  13 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + * See the License for the specific language governing permissions and
  15 + * limitations under the License.
  16 + */
  17 +package org.apache.cocoon.spring.configurator.impl;
  18 +
  19 +import java.util.ArrayList;
  20 +import java.util.Arrays;
  21 +import java.util.List;
  22 +
  23 +import org.apache.commons.logging.Log;
  24 +import org.apache.commons.logging.LogFactory;
  25 +import org.springframework.beans.factory.config.BeanDefinition;
  26 +import org.springframework.beans.factory.config.BeanDefinitionHolder;
  27 +import org.springframework.beans.factory.config.RuntimeBeanReference;
  28 +import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
  29 +import org.springframework.beans.factory.support.BeanDefinitionRegistry;
  30 +import org.springframework.beans.factory.support.RootBeanDefinition;
  31 +import org.springframework.beans.factory.xml.BeanDefinitionParser;
  32 +import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
  33 +import org.springframework.util.StringUtils;
  34 +
  35 +import org.apache.cocoon.configuration.Settings;
  36 +