You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by cr...@apache.org on 2008/09/11 05:45:52 UTC
svn commit: r694101 [2/3] - in /forrest/trunk: etc/cocoon_upgrade/ lib/core/
lib/endorsed/ main/java/org/apache/forrest/locationmap/lm/
main/java/org/apache/forrest/util/ main/targets/ main/var/
main/webapp/WEB-INF/ main/webapp/WEB-INF/properties/ main...
Modified: forrest/trunk/main/webapp/WEB-INF/cocoon.xconf
URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/WEB-INF/cocoon.xconf?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/main/webapp/WEB-INF/cocoon.xconf (original)
+++ forrest/trunk/main/webapp/WEB-INF/cocoon.xconf Wed Sep 10 20:45:49 2008
@@ -15,18 +15,1055 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!-- CVS $Id: cocoon.xconf 123675 2004-12-29 20:39:50Z sylvain $ -->
-<cocoon version="2.2">
+<cocoon version="2.1">
<!--+
- | This is the main Apache Cocoon configuration file.
- | It contains includes for the core components and for
- | each of the blocks that are to be loaded.
- |
- | You can add your own components here or include some
- | additional external files.
+ | This file defines the Cocoon core components.
+-->
- <include src="context://WEB-INF/xconf/forrest-core.xconf"/>
+ <!-- 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"/>
+
+<!--+
+ | This is the Apache Cocoon configuration file. This is the place
+ | where you configure the components that Cocoon uses internally (stuff
+ | like the cache) or handles to the pipeline components
+ | (stuff like XML parsers or XSLT processors).
+ +-->
+
+<!-- =========================== Sitemap =============================== -->
+
+ <!--+
+ | New implementation of the sitemap. It is interpreted, so load times
+ | are super-fast, and request processing is slightly faster than with
+ | the compiled engine thanks to the HotSpot VM.
+ |
+ | Reloading of the sitemap:
+ | The check-reload attribute determines if the sitemap is to be
+ | reloaded on change.
+ | Set to "no", the sitemap is generated once at startup.
+ | Set to "yes", the sitemap is regenerated if it changes.
+ |
+ | For development environment, set the check-reload to yes.
+ | For production environment, it is advisable to set check-reload to no.
+ +-->
+ <sitemap check-reload="yes" file="context://sitemap.xmap" logger="sitemap"/>
+ <!-- config="resource://org/apache/cocoon/components/treeprocessor/treeprocessor-builtins.xml" -->
+ <!-- ========================= Sitemap Flowscript ========================== -->
+
+ <!--+
+ | The <flow-interpreters> element is used to describe the flowscript
+ | engines usedd by the current instance.
+ |
+ | The attributes recognized by the <flow-interpreters> element are:
+ |
+ | default (string value):
+ |
+ | the default interpreted language assumed for <map:script>
+ | elements which do not specify a "language" attribute. If not
+ | present, the first language that's described within the
+ | <flow-interpreters> element is assumed to be the default
+ | language.
+ |
+ | Within <flow-interpreters> only <component-instance> elements are
+ | recognized. The attributes recognized by this element are "name"
+ | and "class". "name" specifies the name of a scripting language,
+ | and "class" defines the Java class that implements it. See
+ | org.apache.cocoon.components.flow.Interpreter for the Cocoon
+ | interface with an scripting language interpreter.
+ |
+ | A <component-instance> element contains as subelements the
+ | following elements:
+ |
+ | reload-scripts (boolean value, default false):
+ | whether to check if the scripts source files are modified.
+ | Checking for modification is an expensive operation, so leave
+ | it disabled in a production environment. If not present it is
+ | assumed to be "false" (if no property is overriding this). When
+ | "true" *all* script files are
+ | checked for modification on each function invocation done using
+ | <map:call function="...">, but not more frequent than the value
+ | of "check-time" (see below).
+ | The default for this function is determined by the value of the
+ | reloading property 'org.apache.cocoon.reloading.flow'.
+ |
+ | check-time (long value, default 1000):
+ | time in miliseconds between the checks for the last modification
+ | date of script files.
+ |
+ | debugger (boolean value, default false):
+ | whether support for the JavaScript debugger should be enabled in
+ | the control flow.
+ +-->
+ <flow-interpreters default="javascript" logger="flow">
+ <!-- FOM (Flow Object Model) -->
+ <component-instance class="org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter" exported="false" name="javascript">
+ <load-on-startup>resource://org/apache/cocoon/components/flow/javascript/fom/fom_system.js</load-on-startup>
+ <!--
+ <reload-scripts>${javascript.reload-scripts}</reload-scripts>
+ <check-time>${javascript.check-time}</check-time>
+ -->
+ <!-- <debugger>enabled</debugger> --> <!-- JavaScript Debugger support -->
+ </component-instance>
+ </flow-interpreters>
+
+ <!--+
+ | Configuration for the continuations manager.
+ |
+ | This section specifies the default time-to-live of continuations
+ | in miliseconds using the "time-to-live" attribute of
+ | the <continuations-manager> element.
+ |
+ | The <expirations-check> element specifies different policies for
+ | expiring continuations. Currently only the "periodic" type is
+ | supported.
+ |
+ | If you need higher security you can bind your continuations
+ | to session. This way only the session that initially created
+ | the continuation can later resume it. Also if session gets
+ | invalidated all continuations are invalidated as well.
+ | Enable this feature for web applications by setting
+ | 'session-bound-continuations' to true.
+ +-->
+ <continuations-manager continuation-sharing-bug-compatible="false" logger="flow.manager" session-bound-continuations="false" time-to-live="${continuations-manager.time-to-live}">
+ <expirations-check type="periodic">
+ <offset>${continuations-manager.expirations-check.offset}</offset>
+ <period>${continuations-manager.expirations-check.period}</period>
+ </expirations-check>
+ </continuations-manager>
+
+<!-- =================== Sitemap Input/Output Modules ====================== -->
+
+ <!--+
+ | InputModules are a replacement to reading values directly
+ | e.g. from request parameters. By using this abstraction and
+ | indirection, other components can be more generic and changes
+ | to the application logic are easier.
+ |
+ | A number of components already use InputModules: the sitemap processor,
+ | flow, some matchers, the linkrewriting transformer, database actions
+ | and more.
+ |
+ | For example the sitemap processor allows to obtain a value
+ | named "foo" from an the InputModule for request parameters by
+ | writing {request-param:foo} wherever a sitemap variable is
+ | allowed.
+ |
+ | Some InputModules need the help of other InputModules to
+ | obtain values and only apply a function to the obtained value
+ | or change the name of the attribute. These modules usually
+ | carry "Meta" in their name. An example is the ChainMetaModule
+ | which tries several other modules in turn until a non-null
+ | value is obtained or all modules are tied.
+ |
+ | For details and optional configuration parameters refer to the
+ | accompanying javadocs.
+ +-->
+ <input-modules>
+ <component-instance class="org.apache.cocoon.components.modules.input.GlobalInputModule" logger="core.modules.input" name="global"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.RequestModule" logger="core.modules.input" name="request"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.BaseLinkModule" logger="core.modules.input" name="baselink"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.SessionModule" logger="core.modules.input" name="session"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.RequestParameterModule" logger="core.modules.input" name="request-param"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.RawRequestParameterModule" logger="core.modules.input" name="raw-request-param"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.RequestAttributeModule" logger="core.modules.input" name="request-attr"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.HeaderAttributeModule" logger="core.modules.input" name="request-header"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.SessionAttributeModule" logger="core.modules.input" name="session-attr"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.SystemPropertyModule" logger="core.modules.input" name="system-property"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.StringConstantModule" logger="core.modules.input" name="constant"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.RandomNumberModule" logger="core.modules.input" name="random"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.DigestMetaModule" logger="core.modules.input" name="digest"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.DateInputModule" logger="core.modules.input" name="date">
+ <!-- <format>EEE, d MMM yyyy HH:mm:ss Z</format> -->
+ <!--Eg: Mon, 28 Oct 2002 03:08:49 +1100 -->
+ </component-instance>
+ <component-instance class="org.apache.cocoon.components.modules.input.NullInputModule" logger="core.modules.input" name="nullinput"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.RealPathModule" logger="core.modules.input" name="realpath"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.XMLMetaModule" logger="core.modules.input" name="xmlmeta"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.MapMetaModule" logger="core.modules.input" name="mapmeta"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.DateMetaInputModule" logger="core.modules.input" name="datemeta"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.JXPathMetaModule" logger="core.modules.input" name="jxpath"/>
+ <component-instance class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule" logger="core.modules.input" name="simplemap"/>
+
+ <component-instance class="org.apache.cocoon.components.modules.input.ChainMetaModule" logger="core.modules.input" name="forrest">
+ <input-module name="request-param"/>
+ <input-module name="request-attr"/>
+ <input-module name="session-attr"/>
+ <input-module name="properties"/>
+ </component-instance>
+
+ <component-instance class="org.apache.forrest.conf.ForrestConfModule" name="properties">
+ <values>
+ <forrest.skin>@project.skin@</forrest.skin>
+ <forrest.menu-scheme>@project.menu-scheme@</forrest.menu-scheme>
+ <forrest.bugtracking-url>@project.bugtracking-url@</forrest.bugtracking-url>
+ <forrest.issues-rss-url>@project.issues-rss-url@</forrest.issues-rss-url>
+ <forrest.i18n>@project.i18n@</forrest.i18n>
+ <forrest.home>@forrest.home@/</forrest.home>
+ <forrest.context>@context.home@</forrest.context>
+ <forrest.skins-dir>@context.home@/skins/</forrest.skins-dir>
+ <forrest.stylesheets>@context.home@/resources/stylesheets</forrest.stylesheets>
+ <forrest.plugins-src>@forrest.home@/plugins</forrest.plugins-src>
+ <forrest.whiteboard-plugins-src>@forrest.home@/whiteboard/plugins</forrest.whiteboard-plugins-src>
+ <forrest.plugins>@forrest.home@/build/plugins</forrest.plugins>
+ <forrest.locationmap>@context.home@/locationmap.xml</forrest.locationmap>
+ <home>@project.home@</home>
+ <staging-dir>@project.build-dir@/@project.site@</staging-dir>
+ <skin>@project.skin@</skin>
+ <sitemap>@project.home@/@project.sitemap@</sitemap>
+ <status>@project.home@/@project.status@</status>
+ <skinconf>@project.home@/@project.skinconf@</skinconf>
+ <doc>@project.home@/@project.content-dir@/</doc>
+ <content>@project.home@/@project.raw-content-dir@/</content>
+ <conf>@project.home@/@project.conf-dir@/</conf>
+ <content.xdocs>@project.home@/@project.xdocs-dir@/</content.xdocs>
+ <translations>@project.home@/@project.translations-dir@</translations>
+ <resources>@project.home@/@project.resources-dir@/</resources>
+ <resources.stylesheets>@project.home@/@project.stylesheets-dir@/</resources.stylesheets>
+ <resources.images>@project.home@/@project.images-dir@/</resources.images>
+ <skins-dir>@project.home@/@project.skins-dir@/</skins-dir>
+ <temp-dir>@project.temp-dir@</temp-dir>
+ </values>
+ </component-instance>
+
+ <component-instance
+ class="org.apache.cocoon.components.modules.input.XMLFileModule"
+ logger="core.modules.xml" name="skinconf"/>
+
+ <component-instance
+ class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule"
+ logger="core.modules.mapper" name="conf">
+ <input-module name="skinconf">
+ <file src="cocoon://skinconf.xml" reloadable="true" />
+ </input-module>
+ <prefix>/skinconfig/</prefix>
+ </component-instance>
+
+ <!-- For the site: scheme -->
+ <component-instance
+ class="org.apache.cocoon.components.modules.input.XMLFileModule"
+ logger="core.modules.mapper.link" name="linkmap">
+ </component-instance>
+
+ <!-- Links to URIs within the site -->
+ <component-instance
+ class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule"
+ logger="core.modules.mapper.link" name="site"/>
+
+ <!-- Links to external URIs, as distinct from 'site' URIs -->
+ <component-instance
+ class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule"
+ logger="core.modules.mapper.link" name="ext"/>
+
+ <!-- LocationMap is used to map one URL to another, allowing content to be stored anywhere -->
+ <component-instance
+ class="org.apache.forrest.locationmap.LocationMapModule"
+ logger="core.modules.mapper.lm" name="lm">
+ <file src="cocoon://locationmap.xml"/>
+ <cacheable>true</cacheable>
+ <cache-lifespan>100000</cache-lifespan>
+ </component-instance>
+
+</input-modules>
+
+
+
+<!-- ================================= XML ================================ -->
+
+ <!--+
+ | Entity resolution catalogs
+ |
+ | The following parameters are the system-wide configuration for Forrest.
+ |
+ | There are various ways to do local project-based configuration.
+ | See the Apache Forrest documentation:
+ | http://forrest.apache.org/docs/your-project.html
+ | http://forrest.apache.org/docs/validation.html
+ |
+ | Parameters:
+ |
+ | catalog:
+ | The default catalog for DTDs etc. that are shipped with Forrest.
+ |
+ | <parameter name="catalog" value="resources/schema/catalog.xcat"/>
+ |
+ | However, it is desirable to leave this default catalog config
+ | and declare your own local catalogs, which are loaded in addition to
+ | the system catalog.
+ |
+ | local-catalog:
+ | The full filesystem pathname to a single local catalog file.
+ | This catalog could also include nextCatalog instructions.
+ |
+ | <parameter name="local-catalog" value="/usr/local/sgml/mycatalog"/>
+ |
+ | verbosity:
+ | The level of messages for status/debug (messages go to standard output)
+ | The following messages are provided ...
+ | 0 = none
+ | 1 = ? (... not sure yet)
+ | 2 = 1+, Loading catalog, Resolved public, Resolved system
+ | 3 = 2+, Catalog does not exist, resolvePublic, resolveSystem
+ | 10 = 3+, List all catalog entries when loading a catalog
+ | (Cocoon also logs the "Resolved public" messages.)
+ +-->
+ <entity-resolver logger="core.resolver">
+ <parameter name="catalog" value="resources/schema/catalog.xcat"/>
+ <parameter name="verbosity" value="${org.apache.xml.resolver.verbosity}"/>
+ </entity-resolver>
+
+ <!--+
+ | XML Parser
+ |
+ | Apache Cocoon requires a JAXP 1.1 parser. The default parser is
+ | org.apache.excalibur.xml.impl.JaxpParser.
+ | Note: If you have problems because your servlet environment uses its
+ | own parser not conforming to JAXP 1.1 try using the alternative
+ | XercesParser instead of the JaxpParser. To activate the XercesParser,
+ | change the class attribute to
+ | class="org.apache.excalibur.xml.impl.XercesParser"
+ | You will also need to add a system property to your JVM,
+ | probably on the startup of your servlet engine like this:
+ | -Dorg.apache.excalibur.xml.sax.SAXParser=org.apache.excalibur.xml.impl.XercesParser
+ |
+ | Configuration parameters for the JaxpParser (not the XercesParser!):
+ | - validate (boolean, default = false): should the parser validate
+ | parsed documents?
+ | Note: XML validation is only being used for the documentation build.
+ | (If you are going to use it elsewhere, then do so with caution.)
+ | You really should have validated all of your XML documents already,
+ | according to their proper DTD or schema. Do not expect Cocoon
+ | to do it.
+ | - namespace-prefixes (boolean, default = false) : do we want
+ | namespaces declarations also as 'xmlns:' attributes?
+ | Note : setting this to true confuses some XSL processors
+ | (e.g. Saxon).
+ | - stop-on-warning (boolean, default = true) : should the parser
+ | stop parsing if a warning occurs ?
+ | - stop-on-recoverable-error (boolean, default = true) : should the
+ | parser stop parsing if a recoverable error occurs ?
+ | - reuse-parsers (boolean, default = true) : do we want to reuse
+ | parsers or create a new parser for each parse ?
+ | Note : even if this parameter is true, parsers are not recycled
+ | in case of parsing errors : some parsers (e.g. Xerces) do not like
+ | to be reused after failure.
+ | - sax-parser-factory (string, optional) : the name of the
+ | SAXParserFactory implementation class to be used instead of using
+ | the standard JAXP mechanism (SAXParserFactory.newInstance()). This
+ | allows to choose unambiguously the JAXP implementation to be used
+ | when several of them are available in the classpath.
+ | - document-builder-factory (string, optional) : the name of the
+ | DocumentBuilderFactory implementation to be used (similar to
+ | sax-parser-factory for DOM).
+ | - drop-dtd-comments : should comment() events from DTD's be dropped?
+ | Note: Since this implementation does not support the DeclHandler
+ | interface anyway, it is quite useless to only have the comments
+ | from DTD. And the comment events from the internal DTD subset
+ | would appear in the serialized output again.
+ +-->
+ <xml-parser class="org.apache.excalibur.xml.impl.JaxpParser" logger="core.xml-parser" pool-max="${xml-parser.pool-max}">
+ <parameter name="validate" value="false"/>
+ <parameter name="namespace-prefixes" value="false"/>
+ <parameter name="stop-on-warning" value="true"/>
+ <parameter name="stop-on-recoverable-error" value="true"/>
+ <parameter name="reuse-parsers" value="false"/>
+ <!--parameter name="sax-parser-factory" value="???"/-->
+ <!--parameter name="document-builder-factory" value="???"/-->
+ <!-- drop-dtd-comments: causes all comment events originating from DTD
+ comments to be dropped right after parsing -->
+ <parameter name="drop-dtd-comments" value="true"/>
+ </xml-parser>
+
+
+ <!--+
+ | XSLT Processor
+ |
+ | 'incremental-processing' (only works with Xalan) allows the XSLT
+ | processor to start the output of the transformation as soon as possible.
+ | if set to false, the transforer waits until the end of the
+ | transformation to deliver the output.
+ | WARNING: * if you enable incremental-processing, you should be aware of
+ | the following bug:
+ | http://issues.apache.org/bugzilla/show_bug.cgi?id=13186
+ | * incremental-processing creates an additional, non-pooled thread.
+ | * using incremental-processing does not save memory, the input
+ | tree will still be build completely.
+ | * incremental processing is a 'static' thing in Xalan: if you
+ | enable it on one xslt-processor, enable it on all.
+ +-->
+ <xslt-processor logger="core.xslt-processor">
+ <parameter name="use-store" value="true"/>
+ <parameter name="incremental-processing" value="false"/>
+ </xslt-processor>
+
+ <!--+
+ | XSLT Processor using xsltc from Xalan
+ | For Interpreted Xalan use:
+ | <transformer-factory>org.apache.xalan.processor.TransformerFactoryImpl</transformer-factory>
+ +-->
+ <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/xsltc">
+ <parameter name="use-store" value="false"/>
+ <parameter name="transformer-factory" value="org.apache.xalan.xsltc.trax.TransformerFactoryImpl"/>
+ </component>
+
+ <!--+
+ | Xalan XSLT Processor
+ +-->
+ <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/xalan">
+ <parameter name="use-store" value="false"/>
+ <parameter name="incremental-processing" value="false"/>
+ <parameter name="transformer-factory" value="org.apache.xalan.processor.TransformerFactoryImpl"/>
+ </component>
+
+ <!--+
+ | Saxon XSLT Processor
+ | For old (6.5.2) Saxon use:
+ | <parameter name="transformer-factory" value="com.icl.saxon.TransformerFactoryImpl"/>
+ | For new (7+) Saxon use:
+ | <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/>
+ +-->
+ <component logger="core.xslt-processor"
+ role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon"
+ class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl">
+ <parameter name="use-store" value="false"/>
+ <parameter name="incremental-processing" value="false"/>
+ <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/>
+ </component>
+
+ <!--+
+ | Xpath Processor (Based on Xalan)
+ +-->
+ <xpath-processor class="org.apache.excalibur.xml.xpath.XPathProcessorImpl" logger="core.xpath-processor"/>
+
+ <!--+
+ | The XMLizers converts different mime-types to XML
+ +-->
+ <xmlizer>
+ <parser mime-type="text/xml" role="org.apache.excalibur.xml.sax.SAXParser"/>
+ <!--..... Start configuration from 'tidy' -->
+
+
+ <parser mime-type="text/html" role="org.apache.excalibur.xml.sax.SAXParser/HTML"/>
+
+<!--..... End configuration from 'tidy' -->
+</xmlizer>
+
+<!-- ============================ Object Stores =========================== -->
+
+ <!--+
+ | Transient Store: holds objects that don't have to survive shutdown
+ |
+ | Common configuration parameters:
+ | maxobjects: Indicates how many objects will be held in the cache.
+ | When the number of maxobjects has been reached. The last object
+ | in the cache will be thrown out.
+ +-->
+ <transient-store logger="core.store.transient">
+ <parameter name="maxobjects" value="${transient-store.maxobjects}"/>
+ </transient-store>
+
+ <!--+
+ | Store: generic store. The default implementation is an in-memory store
+ | backed by a disk store (based on EHCache). This forms a two-stage
+ | cache composed of a fast in-memory MRU front-end and a persistent
+ | back-end which stores the less-used objects.
+ |
+ | Common configuration parameters:
+ | maxobjects: Indicates how many objects will be held in the cache.
+ | When the number of maxobjects has been reached. The last object
+ | in the cache will be thrown out.
+ +-->
+ <store logger="core.store">
+ <parameter name="maxobjects" value="${store.maxobjects}"/>
+ <parameter name="use-cache-directory" value="true"/>
+ </store>
+
+ <!--+
+ | Store Janitor: the store garbage collector and memory usage controller.
+ |
+ | WARNING: Be careful with the heapsize and freememory parameters.
+ | Wrong values can cause high cpu usage.
+ |
+ | Example configuration:
+ | Jvm settings:
+ | -Xmx200000000
+ | store-janitor settings:
+ | <parameter name="freememory" value="5000000"/>
+ | <parameter name="heapsize" value="196000000"/>
+ |
+ | It is recommended to have heapsize equal to -Xmx, especially on Sun's
+ | JVM which are unable to shrink its heap once it grows above minimum.
+ | Freememory should be greater than amount of memory necessary for normal
+ | application operation.
+ | BUT: The heap size of the memory of the JVM is a little bit less than
+ | the value you specify for -Xmx, so you have to set the heapsize
+ | for the store janitor to a value which is lower (2% less seems
+ | to be a working value).
+ +-->
+ <store-janitor logger="core.store.janitor">
+ <!--+
+ | How much free memory shall be available in the jvm?
+ | If not specified, defaults to 1Mb.
+ +-->
+ <parameter name="freememory" value="${store-janitor.freememory}"/>
+ <!--+
+ | How much memory at max jvm can consume?
+ | The default max heapsize for Sun's JVM is (almost) 64Mb,
+ | can be increased by specifying -Xmx command line parameter.
+ | If not specified, defaults to 66600000 bytes.
+ +-->
+ <parameter name="heapsize" value="${store-janitor.heapsize}"/>
+ <!--+
+ | How often shall the cleanup thread check memory?
+ | If not specified, defaults to 10 seconds.
+ +-->
+ <parameter name="cleanupthreadinterval" value="${store-janitor.cleanup-thread-interval}"/>
+ <!--+
+ | Experimental adaptive algorithm for cleanup interval
+ <parameter name="adaptivethreadinterval" value="true"/>
+ +-->
+ <!--+
+ | What percent of the store elements shall be dropped on low memory?
+ | If not specified, defaults to 10%
+ +-->
+ <parameter name="percent_to_free" value="${store-janitor.percent-to-free}"/>
+ <!--+
+ | Shall garbage collector be invoked on low memory?
+ | If not specified, defaults to false.
+ +-->
+ <parameter name="invokegc" value="false"/>
+ <!--+
+ | Algorithm describing how to clean caches in low memory situations.
+ | round-robin: The registered caches are cycled through,
+ | and each time there is a low memory situation one
+ | of the registered caches has objects freed from it.
+ | all-stores: All registered stores have objects removed from
+ | them each time there is a low memory situation.
+ | If not specified, defaults to 'round-robin'.
+ +-->
+ <parameter name="freeingalgorithm" value="round-robin"/>
+ <!--+
+ | Name of the thread pool to use.
+ | If not specified, defaults to 'daemon'.
+ +-->
+ <parameter name="thread-pool" value="daemon"/>
+
+ <!--+
+ | What should be the priority of the cleanup thread?
+ | This parameter is used only by older implementation of the janitor.
+ | New implementation uses centrally configured thread pool (see
+ | thread-pools element below).
+ <parameter name="threadpriority" value="5"/>
+ +-->
+ </store-janitor>
+
+<!-- ========================= Protocol Handlers =========================== -->
+
+ <!--+
+ | Source Factories
+ |
+ | Each source factory adds a special uri schemes to the system.
+ +-->
+ <source-factories>
+ <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource"/>
+ <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
+ <component-instance class="org.apache.cocoon.components.source.impl.SitemapSourceFactory" name="cocoon"/>
+
+ <!--+
+ | The "file:" source protocol is modifiable (can be written to) and
+ | traversable (directory structures can be crawled).
+ +-->
+ <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file"/>
+ <component-instance class="org.apache.cocoon.components.source.impl.ZipSourceFactory" name="zip"/>
+ <component-instance class="org.apache.forrest.locationmap.source.impl.LocationmapSourceFactory" name="lm"/>
+
+ <!--+
+ | The "*" protocol handles all uri schemes that are not explicitely
+ | specified. This includes all JDK standard protocols.
+ +-->
+ <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+ </source-factories>
+
+<!-- ================ Internationalization Catalogs =================== -->
+
+ <!--+
+ | I18n Bundle Factory
+ |
+ | BundleFactory loads Bundles with i18n resources for the given locale.
+ | Bundles are loaded from the 'catalogue_location'. Bundle base name is
+ | 'catalogue_name' value.
+ | If 'cache-at-startup' is true then BundleFactory preloads bundles.
+ +-->
+ <i18n-bundles logger="core.i18n-bundles">
+ <catalogue-name>messages</catalogue-name>
+ <catalogue-location>i18n/translations</catalogue-location>
+ <cache-at-startup>true</cache-at-startup>
+ </i18n-bundles>
+
+<!-- ====================== System Components =========================== -->
+
+ <!--+
+ | The core classloader implementation
+ +-->
+ <classloader class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl" logger="core.classloader"/>
+
+ <!--+
+ | XML compiler/decompiler
+ |
+ | These components are used to process SAX events and produce a binary
+ | representation that is much more compact and efficient for
+ | subsequent parsing. These are used by the cache system to save
+ | the intermediate results of the pipeline stages reducing the overhead
+ | of xml parsing/serialization.
+ +-->
+ <xml-serializer class="org.apache.cocoon.components.sax.XMLByteStreamCompiler" logger="core.xml.serializer" pool-max="${xml-serializer.pool-max}"/>
+ <xml-deserializer class="org.apache.cocoon.components.sax.XMLByteStreamInterpreter" logger="core.xml.deserializer" pool-max="${xml-deserializer.pool-max}"/>
+
+ <!--+
+ | The Cache Manager is a component that can be used to cache content.
+ | It is currently used by the cinclude transformer
+ +-->
+ <component class="org.apache.cocoon.transformation.helpers.DefaultIncludeCacheManager" role="org.apache.cocoon.transformation.helpers.IncludeCacheManager">
+ <!-- Set the preemptive-loader-url to a pipeline inside Cocoon that
+ contains the preemptive loader action. The URL must be absolute!
+ <parameter name="preemptive-loader-url"
+ value="http://localhost:8080/cocoon/samples/cinclude/loader"/>
+ -->
+ </component>
+
+ <!--+
+ | Runnable manager
+ |
+ | This component manages commands (Runnables) executed in background using
+ | preconfigured pools of worker threads
+ +-->
+ <runnable-manager logger="core.runnable">
+ <!--+
+ | This is the default configuration of the runnable-manager. More
+ | indepth information can be found at
+ | http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/PooledExecutor.html
+ | The following elements can be used:
+ |
+ | thread-factory: specifies the fully qualified class name of an
+ | org.apache.cocoon.components.thread.ThreadFactory
+ | implementation. It is responsible to create Thread
+ | classes.
+ | thread-pools: container element for thread-pool elements.
+ | name: required name of the pool.
+ | priority: optional priority all threads of the pool will
+ | have (the ThreadFactory will be set to this
+ | priority).The possible values are:
+ | MIN: corresponds to Thread#MIN_PRIORITY
+ | NORM: corresponds to Thread#NORM_PRIORITY (default)
+ | MAX: corresponds to Thread#MAX_PRIORITY
+ | daemon: whether newly created Threads should run in
+ | daemon mode or not. Default to false.
+ | queue-size: optional size of a queue to hold Runnables if the
+ | pool is full. Possible values are:
+ | less than 0: unbounded (default)
+ | equal to 0: no queue at all
+ | greater than 0: size of the queue
+ | max-pool-size: optional maximum number of threads in the pool.
+ | Defaults to 5.
+ | NOTE: if a queue is specified (queue-sie != 0)
+ | this value will be ignored.
+ | min-pool-size: optional minimum number of threads in the pool.
+ | Defaults to 5.
+ | NOTE: if a queue has been specified (queue-sie != 0)
+ | this value will be used as the maximum of
+ | thread running concurrently.
+ | keep-alive-time-ms: The time in ms an idle thread should keep alive
+ | before it might get garbage collected. This
+ | defaults to 60000 ms.
+ | block-policy; The policy to be used if all resources (thread in
+ | the pool and slots in the queue) are exhausted.
+ | Possible values are:
+ | ABORT: Throw a RuntimeException
+ | DISCARD: Throw away the current request
+ | and return.
+ | DISCARDOLDEST: Throw away the oldest request
+ | and return.
+ | RUN (default): The thread making the execute
+ | request runs the task itself.
+ | This policy helps guard against
+ | lockup.
+ | WAIT: Wait until a thread becomes
+ | available. This policy should, in
+ | general, not be used if the
+ | minimum number of threads is zero,
+ | in which case a thread may never
+ | become available.
+ | shutdown-graceful: Terminate thread pool after processing all
+ | Runnables currently in queue. Any Runnable entered
+ | after this point will be discarded. A shut down
+ | pool cannot be restarted. This also means that a
+ | pool will need keep-alive-time-ms to terminate.
+ | The default value not to shutdown graceful.
+ | shutdown-wait-time-ms: The time in ms to wait before issuing an
+ | immediate shutdown after a graceful shutdown
+ | has been requested.
+ +-->
+ <thread-factory>org.apache.cocoon.components.thread.DefaultThreadFactory</thread-factory>
+ <thread-pools>
+ <!--+
+ | This is the default thread pool. It's use fits best for short
+ | running background tasks.
+ +-->
+ <thread-pool>
+ <name>default</name>
+ <priority>NORM</priority>
+ <daemon>false</daemon>
+ <queue-size>-1</queue-size>
+ <max-pool-size>5</max-pool-size>
+ <min-pool-size>5</min-pool-size>
+ <keep-alive-time-ms>60000</keep-alive-time-ms>
+ <block-policy>ABORT</block-policy>
+ <shutdown-graceful>false</shutdown-graceful>
+ <shutdown-wait-time-ms>-1</shutdown-wait-time-ms>
+ </thread-pool>
+ <!--+
+ | This thread pool should be used for daemons (permanently running
+ | threads).
+ +-->
+ <thread-pool>
+ <name>daemon</name>
+ <priority>NORM</priority>
+ <daemon>true</daemon>
+ <queue-size>0</queue-size>
+ <max-pool-size>-1</max-pool-size>
+ <min-pool-size>1</min-pool-size>
+ <keep-alive-time-ms>60000</keep-alive-time-ms>
+ <block-policy>ABORT</block-policy>
+ <shutdown-graceful>false</shutdown-graceful>
+ <shutdown-wait-time-ms>-1</shutdown-wait-time-ms>
+ </thread-pool>
+ </thread-pools>
+ </runnable-manager>
+
+<!-- ================ XSP (eXtensible Server Pages) ===================== -->
+
+ <!--+
+ | Logicsheets
+ |
+ | This section defines the XSP logicsheets. A logicsheet is a special
+ | XSLT stylesheet used to translate user-defined dynamic markup into
+ | equivalent XSP markup that embeds directives for a given markup
+ | language.
+ |
+ | Logicsheets are the XSP equivalent of taglibs. For info about
+ | the tags included in the default taglibs, please, refer to the
+ | documentation.
+ +-->
+ <markup-languages>
+ <xsp-language logger="core.markup.xsp" name="xsp">
+ <parameter name="prefix" value="xsp"/>
+ <parameter name="uri" value="http://apache.org/xsp"/>
+ <!--+
+ | These two flags determine whether XSP expression interpolation
+ | shall take place in attribute values and text nodes, respectively.
+ | The syntax {#expr} has been chosen that a clash with existing
+ | XSPs and logicsheets is unlikely. The possibility to switch these
+ | features off is here only for safety.
+ +-->
+ <parameter name="attr-interpolation" value="true"/>
+ <parameter name="text-interpolation" value="true"/>
+
+ <!--+
+ | Properties for the java language
+ +-->
+ <target-language name="java">
+ <!-- Defines the XSP Core logicsheet for the Java language -->
+ <parameter name="core-logicsheet" value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
+
+ <!-- The Request logicsheet: access request parameters -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-request"/>
+ <parameter name="uri" value="http://apache.org/xsp/request/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The Response logicsheet: access response parameters -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-response"/>
+ <parameter name="uri" value="http://apache.org/xsp/response/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/response.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The Session logicsheet: manages and access the session -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-session"/>
+ <parameter name="uri" value="http://apache.org/xsp/session/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/session.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The Cookie logicsheet: manages and access cookies -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-cookie"/>
+ <parameter name="uri" value="http://apache.org/xsp/cookie/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/cookie.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The Log logicsheet: access the cocoon logs from an xsp page -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="log"/>
+ <parameter name="uri" value="http://apache.org/xsp/log/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/log.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The Utility logicsheet -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="util"/>
+ <parameter name="uri" value="http://apache.org/xsp/util/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/util.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The xsp-formval taglib serves as interface to retrieve
+ validation results from a request attribute -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-formval"/>
+ <parameter name="uri" value="http://apache.org/xsp/form-validator/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/form-validator.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The sel taglib allows to put multiple pages / view into
+ one xsp. While in general it is good style to put
+ different views into different xsp because they're more
+ easily maintained, this is a useful feature with
+ e.g. with long forms that are broken into parts -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="sel"/>
+ <parameter name="uri" value="http://apache.org/xsp/sel/1.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/sel.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The Action logicsheet -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="action"/>
+ <parameter name="uri" value="http://apache.org/cocoon/action/1.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/action.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The capture taglib is for capturing parts of the XSP-generated
+ XML as XML fragments or DOM nodes -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="capture"/>
+ <parameter name="uri" value="http://apache.org/cocoon/capture/1.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/capture.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The XScript logicsheet -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xscript"/>
+ <parameter name="uri" value="http://apache.org/xsp/xscript/1.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/xscript.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The SOAP logicsheet -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="soap"/>
+ <parameter name="uri" value="http://apache.org/xsp/soap/3.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/soap.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The JPath logicsheet -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="jpath"/>
+ <parameter name="uri" value="http://apache.org/xsp/jpath/1.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/jpath.xsl"/>
+ </builtin-logicsheet>
+
+ <!-- The input logicsheet allows easy access to InputModules -->
+ <builtin-logicsheet>
+ <parameter name="prefix" value="input"/>
+ <parameter name="uri" value="http://apache.org/cocoon/xsp/input/1.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/input.xsl"/>
+ </builtin-logicsheet>
+ </target-language>
+
+ <!--+
+ | Properties for the javascript language
+ +-->
+ <target-language name="js">
+ <parameter name="core-logicsheet" value="resource://org/apache/cocoon/components/language/markup/xsp/javascript/xsp.xsl"/>
+
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-request"/>
+ <parameter name="uri" value="http://apache.org/xsp/request/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/javascript/request.xsl"/>
+ </builtin-logicsheet>
+
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-response"/>
+ <parameter name="uri" value="http://apache.org/xsp/response/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/javascript/response.xsl"/>
+ </builtin-logicsheet>
+
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-session"/>
+ <parameter name="uri" value="http://apache.org/xsp/session/2.0"/>
+ <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/javascript/session.xsl"/>
+ </builtin-logicsheet>
+ </target-language>
+ </xsp-language>
+ </markup-languages>
+
+ <!--+
+ | Program Generator
+ |
+ | The ProgamGenerator builds programs from a XML document written in a
+ | MarkupLanguage.
+ |
+ | auto-reload: whether the system should check if the source was
+ | modified and reload of consequence.
+ | root-package: the java package to use for the generated classes
+ | preload: whether the system should preload the necessary components
+ +-->
+ <program-generator logger="core.program-generator">
+ <parameter name="auto-reload" value="true"/>
+ <parameter name="root-package" value="org.apache.cocoon.www"/>
+ <parameter name="preload" value="true"/>
+ </program-generator>
+
+ <!--+
+ | Programming Languages for the XSP pages
+ +-->
+ <programming-languages>
+ <java-language logger="core.language.java" name="java">
+
+ <!--+ Specifies which formatter to use to format source code.
+ | This parameter is optional.
+ | At the moment there is no implementation of a code formatter available.
+ +-->
+ <!--parameter name="code-formatter" value="org.apache.cocoon.components.language.programming.java.NullFormatter"/-->
+
+ <!-- A singleton-like implementation of a ClassLoader -->
+ <parameter name="class-loader" value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
+
+ <!--+
+ | Specifies which Java compiler to use. Possible variants are:
+ |
+ | - EclipseJavaCompiler: the Eclipse JDT java compiler
+ | - Javac: the java compiler that comes with JDK
+ | - Jikes: the Jikes java compiler
+ | - Pizza: the Pizza java compiler (deprecated. Support will be removed in 2.2)
+ |
+ | NOTE: the Eclipse JDT is the only java compiler that is capable
+ | of imports classes thru the context classloader. All other
+ | compilers import classes from the JVM classpath and might
+ | normally result in ClassNotFound problems at compilation
+ | time. It is *HIGHLY* suggested that you use this compiler
+ | or you might experience problems in some servlet containers.
+ +-->
+ <parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.EclipseJavaCompiler"/>
+ <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Javac"/-->
+ <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Jikes"/-->
+ <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Pizza"/--> <!-- deprecated-->
+
+ <!--+
+ | Specifies the java code source version used to compile the XSP code.
+ |
+ | Posible values:
+ | 1.3 = Java version 1.3
+ | 1.4 = Java version 1.4
+ | 1.5 = Java version 1.5
+ | auto = The version of the JVM where cocoon is running. (Default value).
+ |
+ | NOTE: The parameter is optional to keep backward compatibility.
+ | The parameter works with Sun Javac compiler and the Eclipse compiler.
+ | The pizza compiler does not support java 1.5.
+ +-->
+ <!-- <parameter name="compiler-compliance-level" value="auto"/> -->
+ </java-language>
+
+ <!-- Interpreted JavaScript language -->
+ <js-language logger="core.language.js" name="js"/>
+ </programming-languages>
+
+ <!-- Xscript -->
+ <xscript logger="core.xscript">
+ <parameter name="xscript:copy-of" value="resource://org/apache/cocoon/components/xscript/xslt/copy-of.xsl"/>
+ <parameter name="xscript:value-of" value="resource://org/apache/cocoon/components/xscript/xslt/value-of.xsl"/>
+ </xscript>
+
+<!-- ========== Components used for Lucene-based searching ========== -->
+
+ <include src="resource://org/apache/cocoon/components/search/lucene.roles"/>
+
+ <!-- Search:
+ These are the components that handle the search.
+
+ Cocoon indexer write into an index.
+ Cocoon searcher reads form an index, returning matched hits.
+ Cocoon crawler crawls all links starting from a given base URI.
+ Lucene xml indexer build a lucene document from XML content.
+ -->
+ <cocoon-indexer logger="core.search.indexer"/>
+ <cocoon-searcher logger="core.search.searcher"/>
+ <cocoon-crawler logger="core.search.crawler"/>
+ <lucene-xml-indexer logger="core.search.lucene"/>
+
+<!-- ========== Components used for profiling ========== -->
+
+ <include src="resource://org/apache/cocoon/components/profiler/profiler.roles"/>
+
+ <!--+
+ | Profiler:
+ | The profiler facilitates the gathering of statistics about timings of
+ | different steps of pipelines.
+ +-->
+ <profiler results="20"/><!-- default is 10 -->
+
+<!-- ========== Components used for debugging ========== -->
+<!--+
+ | Send sitemap execution messages to the debug log category.
+ | Warning: It is very verbose. Off by default.
+ +-->
+<!--
+<component role="org.apache.cocoon.sitemap.SitemapExecutor"
+ class="org.apache.cocoon.profiler.debugging.SimpleSitemapExecutor"
+ logger="debug"/>
+-->
+
+<!-- ========== Components used for template ========== -->
+
+ <include src="resource://org/apache/cocoon/components/expression/expression.roles"/>
+ <include src="resource://org/apache/cocoon/components/accessor/accessor.roles"/>
+
+ <expression-factory/>
+ <expression-compilers>
+ <component-instance class="org.apache.cocoon.components.expression.jxpath.JXPathCompiler" name="default"/>
+ <component-instance class="org.apache.cocoon.components.expression.jexl.JexlCompiler" name="jexl"/>
+ <component-instance class="org.apache.cocoon.components.expression.jxpath.JXPathCompiler" name="jxpath"/>
+ <component-instance class="org.apache.cocoon.components.expression.javascript.JavaScriptCompiler" name="js"/>
+ </expression-compilers>
+ <string-template-parsers>
+ <component-instance class="org.apache.cocoon.template.expression.JXTGStringTemplateParser" name="jxtg"/>
+ <component-instance class="org.apache.cocoon.template.expression.DefaultStringTemplateParser" name="default"/>
+ </string-template-parsers>
+
+ <component class="org.apache.cocoon.template.script.DefaultScriptManager" role="org.apache.cocoon.template.script.ScriptManager"/>
+ <component class="org.apache.cocoon.template.script.DefaultInstructionFactory" role="org.apache.cocoon.template.script.InstructionFactory"/>
+ <component class="org.apache.cocoon.template.expression.JXTGStringTemplateParser" role="org.apache.cocoon.template.expression.StringTemplateParser"/>
+
+<!-- ========== Components used for xml validation ========== -->
+ <include src="resource://org/apache/cocoon/components/validation/validation.roles"/>
+ <!--+
+ | The shared Validator instance in Cocoon.
+ |
+ | This defaults to an instance of a "CachedValidator". To disable schema
+ | caching add the following attribute to the <validator ... /> element:
+ |
+ | class="org.apache.cocoon.components.validation.impl.DefaultValidator"
+ +-->
+ <validator logger="core.validation">
+ <schema-parser class="org.apache.cocoon.components.validation.jing.JingSchemaParser" name="jing"/>
+ <schema-parser class="org.apache.cocoon.components.validation.jaxp.JaxpSchemaParser" name="jaxp">
+ <factory-class>org.apache.xerces.jaxp.validation.XMLSchemaFactory</factory-class>
+ </schema-parser>
+ </validator>
+
</cocoon>
Modified: forrest/trunk/main/webapp/WEB-INF/properties/core.properties
URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/WEB-INF/properties/core.properties?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/main/webapp/WEB-INF/properties/core.properties (original)
+++ forrest/trunk/main/webapp/WEB-INF/properties/core.properties Wed Sep 10 20:45:49 2008
@@ -13,11 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# This file contains the default settings for Cocoon.
-# You should NOT change this file directly. Create your own properties
-# file and put it in the sub directories for the mode you are running
-# Cocoon in.
-
# This parameter points to the main configuration file for Cocoon.
org.apache.cocoon.configuration=/WEB-INF/cocoon.xconf
@@ -31,3 +26,20 @@
# ERROR: prints all level of log messages except DEBUG, INFO and WARN ones.
# FATAL_ERROR: prints only log messages of this level
org.apache.cocoon.logging.bootstrap.loglevel=WARN
+
+javascript.reload-scripts = true
+javascript.check-time = 4000
+continuations-manager.time-to-live = 3600000
+continuations-manager.expirations-check.offset = 180000
+continuations-manager.expirations-check.period = 180000
+xml-parser.pool-max = 32
+transient-store.maxobjects = 1000
+store.maxobjects = 1000
+store-janitor.freememory = 2048000
+store-janitor.heapsize = 66600000
+store-janitor.cleanup-thread-interval = 10
+store-janitor.percent-to-free = 10
+xml-serializer.pool-max = 32
+xml-deserializer.pool-max = 32
+
+org.apache.xml.resolver.verbosity=0
Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java (original)
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java Wed Sep 10 20:45:49 2008
@@ -32,6 +32,7 @@
import javax.xml.transform.dom.DOMSource;
import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.excalibur.source.SourceResolver;
import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
import org.apache.forrest.dispatcher.transformation.DispatcherTransformer;
import org.w3c.dom.Document;
@@ -107,7 +108,6 @@
protected DispatcherHelper dispatcherHelper;
- protected ServiceManager manager;
private HashMap parameterHelper;
@@ -117,6 +117,8 @@
private Object defaultVariables;
+ private SourceResolver resolver;
+
/**
* The ContractBean contains all fields to work with contracts. It is a
* helper bean.
@@ -131,11 +133,11 @@
* @param defaultProperties
* @throws ParserConfigurationException
*/
- public ContractBeanDOMImpl(ServiceManager manager, HashMap parameterHelper,Document defaultProperties, URIResolver uriResolver)
+ public ContractBeanDOMImpl(SourceResolver resolver, HashMap parameterHelper,Document defaultProperties, URIResolver uriResolver)
throws ParserConfigurationException {
m_uriResolver=uriResolver;
- this.manager = manager;
- dispatcherHelper = new DispatcherHelper(manager);
+ this.resolver = resolver;
+ dispatcherHelper = new DispatcherHelper(resolver);
this.parameterHelper = parameterHelper;
this.defaultVariables=defaultProperties;
}
@@ -167,7 +169,7 @@
* @see org.apache.forrest.dispatcher.ContractBeanInterface#initialize()
*/
public void initialize() throws ParserConfigurationException {
- dispatcherHelper = new DispatcherHelper(this.manager);
+ dispatcherHelper = new DispatcherHelper(resolver);
}
/*
Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/DispatcherHelper.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/DispatcherHelper.java?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/DispatcherHelper.java (original)
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/DispatcherHelper.java Wed Sep 10 20:45:49 2008
@@ -27,10 +27,10 @@
import javax.xml.transform.TransformerFactory;
import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
import org.apache.cocoon.xml.XMLUtils;
import org.apache.cocoon.xml.dom.DOMBuilder;
import org.apache.excalibur.source.SourceNotFoundException;
+import org.apache.excalibur.source.SourceResolver;
import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -53,7 +53,7 @@
private NamespaceHelper namespaceHelper;
- private ServiceManager manager;
+ private SourceResolver resolver;
/**
* Create a DOM representation of this dispatcher.
@@ -72,7 +72,7 @@
*/
public Document getDocument(String uri) throws Exception {
Document doc = org.apache.forrest.dispatcher.util.SourceUtil.readDOM(
- uri, this.manager);
+ uri, this.resolver);
if (doc != null) {
this.namespaceHelper = new NamespaceHelper(
DISPATCHER_NAMESPACE_URI, DISPATCHER_PREFIX, doc);
@@ -184,9 +184,9 @@
}
- public DispatcherHelper(ServiceManager manager)
+ public DispatcherHelper(SourceResolver resolver)
throws ParserConfigurationException {
- this.manager = manager;
+ this.resolver = resolver;
this.namespaceHelper = new NamespaceHelper(DISPATCHER_NAMESPACE_URI,
DISPATCHER_PREFIX, "foo");
}
Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java (original)
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java Wed Sep 10 20:45:49 2008
@@ -30,6 +30,7 @@
import org.apache.cocoon.environment.Redirector;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceResolver;
+import org.apache.forrest.dispatcher.DispatcherException;
/**
* Calculates which location to return for a given directory.
@@ -118,17 +119,13 @@
} else {
return null;
}
- } catch (MalformedURLException e) {
- getLogger().warn(
- "Selector URL '" + uri + "' is not a valid Source URL");
- return null;
- } catch (IOException e) {
+ } catch (DispatcherException e) {
getLogger().warn(
"Error reading from source '" + uri + "': "
+ e.getMessage());
return null;
} finally {
- resolver.release(src);
+ release(src);
}
}
@@ -156,14 +153,13 @@
* is overriding this view. This override can be used for directories
* (default.fv) and/or files (*.fv). That means that the root view is the
* default view as long no other view can be found in the requested child.
- * @throws IOException
- * @throws MalformedURLException
+ * @throws DispatcherException
*
*/
- private void computeResponseURI(String uri, Source src)
- throws MalformedURLException, IOException {
- src = resolver.resolveURI(uri);
- if (src.exists()) {
+ private void computeResponseURI(String uri, Source src) throws DispatcherException{
+ try {
+ src = resolver.resolveURI(uri);
+ if (src.exists()) {
this.map.put("uri", uri);
} else {
if (this.getRest().lastIndexOf("/") > -1) {
@@ -182,8 +178,23 @@
}
}
}
+ } catch (MalformedURLException e) {
+ throw new DispatcherException(e);
+ } catch (IOException e) {
+ throw new DispatcherException(e);
+ }finally{
+ release(src);
+ }
+
+ }
+ /**
+ * @see org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source)
+ */
+ public void release(Source source) {
+ if(source!=null){
+ resolver.release(source);
+ }
}
-
public void prepare(Parameters parameters, String src) {
this.setRequest(parameters.getParameter("request", src));
this.setProjectFallback(parameters.getParameter("projectFallback",
Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java (original)
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java Wed Sep 10 20:45:49 2008
@@ -50,6 +50,7 @@
import org.apache.cocoon.environment.Redirector;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceResolver;
+import org.apache.forrest.dispatcher.DispatcherException;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
@@ -107,31 +108,23 @@
} else {
return null;
}
- } catch (MalformedURLException e) {
- getLogger().warn(
- "Selector URL '" + uri + "' is not a valid Source URL");
- return null;
- } catch (IOException e) {
- getLogger().warn(
- "Error reading from source '" + uri + "': "
- + e.getMessage());
- return null;
- } catch (Exception e) {
+ } catch (Exception e) {
getLogger().warn(
"Error reading from source '" + uri + "': "
+ e.getMessage());
return null;
}finally {
- resolver.release(src);
+ release(src);
}
}
private void computeResponseURI(String uri, Source src)
- throws Exception {
- src = resolver.resolveURI(uri);
- if (src.exists()) {
+ throws DispatcherException {
+ try {
+ src = resolver.resolveURI(uri);
+ if (src.exists()) {
Document rawData = org.apache.forrest.dispatcher.util.SourceUtil.readDOM(
- uri, this.manager);
+ uri, resolver);
NodeList type = rawData.getElementsByTagNameNS(getResourceTypeElementNS(),getResourceTypeElement());
String typeString = type.item(0).getFirstChild().getNodeValue();
Source typeSource = resolver.resolveURI(resourceTypeBase+typeString);
@@ -139,8 +132,21 @@
this.map.put("uri", typeSource.getURI());
}
}
+ } catch (Exception e) {
+ throw new DispatcherException(e);
+ }finally{
+ release(src);
+ }
+
}
-
+ /**
+ * @see org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source)
+ */
+ public void release(Source source) {
+ if(source!=null){
+ resolver.release(source);
+ }
+ }
public void prepare(Parameters parameters, String src) {
this.setRequest(parameters.getParameter("request", src));
this.setMetaExtension(parameters.getParameter("metaExtension",
Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java (original)
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java Wed Sep 10 20:45:49 2008
@@ -23,6 +23,7 @@
import java.util.Iterator;
import java.util.Map;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.URIResolver;
@@ -44,12 +45,15 @@
import org.apache.cocoon.xml.dom.DOMUtil;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceException;
+import org.apache.excalibur.source.SourceNotFoundException;
import org.apache.excalibur.source.SourceValidity;
+import org.apache.excalibur.source.impl.validity.AggregatedValidity;
import org.apache.excalibur.xml.xpath.XPathProcessor;
import org.apache.forrest.dispatcher.ContractBean;
import org.apache.forrest.dispatcher.ContractBeanDOMImpl;
import org.apache.forrest.dispatcher.DispatcherException;
import org.apache.forrest.dispatcher.DispatcherHelper;
+import org.apache.forrest.dispatcher.lenya.xml.DocumentHelper;
import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -189,7 +193,7 @@
private HashMap parameterHelper;
- private SourceResolver m_resolver;
+ private org.apache.excalibur.source.SourceResolver m_resolver;
private String requestId;
@@ -242,17 +246,28 @@
// You can either request URL?dispatcher.caching=off
// or add this property to forrest.properties.xml
// to force a SourceValidity.INVALID
- if (null != validityFile & !(validityOverride.equals(CACHING_OFF))) {
+ if (null != validityFile && !(validityOverride.equals(CACHING_OFF))) {
+ Source resolveSource=null;
try {
- this.validity = m_resolver.resolveURI(validityFile).getValidity();
+ resolveSource= m_resolver.resolveURI(validityFile);
+ this.validity = resolveSource.getValidity();
} catch (Exception e) {
getLogger().error(e.getMessage());
+ }finally{
+ release(resolveSource);
}
} else
this.validity = null;
return this.validity;
}
-
+/**
+ * @see org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source)
+ */
+ public void release(Source source) {
+ if(source!=null){
+ m_resolver.release(source);
+ }
+ }
public void setManager(ServiceManager manager) throws ServiceException {
super.service(manager);
this.manager = manager;
@@ -329,7 +344,7 @@
if (null == m_resolver)
try {
- m_resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
+ m_resolver = (org.apache.excalibur.source.SourceResolver) manager.lookup(SourceResolver.ROLE);
} catch (ServiceException e) {
throw new ProcessingException(e);
}
@@ -348,7 +363,7 @@
throws SAXException {
// Process start element event
// Are we inside of properties? If so we need to record the elements.
- if (this.insideProperties & this.includeNodes) {
+ if (this.insideProperties && this.includeNodes) {
try {
this.builder.startElement(uri, name, raw, attr);
} catch (SAXException e) {
@@ -369,19 +384,19 @@
}
if (STRUCTURER_ELEMENT.equals(name))
structurerProcessingStart(attr);
- else if (DISPATCHER_HOOK_ELEMENT.equals(name) & this.includeNodes)
+ else if (DISPATCHER_HOOK_ELEMENT.equals(name) && this.includeNodes)
hookProcessingStart(name, raw, attr);
- else if (ContractBean.CONTRACT_ELEMENT.equals(name) & this.includeNodes)
+ else if (ContractBean.CONTRACT_ELEMENT.equals(name) && this.includeNodes)
contractProcessingStart(attr);
- else if (ContractBean.PROPERTY_ELEMENT.equals(name) & this.includeNodes) {
+ else if (ContractBean.PROPERTY_ELEMENT.equals(name) && this.includeNodes) {
this.insideProperties = true;
propertyProcessingStart(uri, name, raw, attr);
}
} else {
- if (!this.insideProperties & this.includeNodes & this.insideStructurer
- & this.allowMarkup)
+ if (!this.insideProperties && this.includeNodes && this.insideStructurer
+ && this.allowMarkup)
super.startElement(uri, name, raw, attr);
- if (!this.insideProperties & this.includeNodes & !this.insideStructurer)
+ if (!this.insideProperties && this.includeNodes && !this.insideStructurer)
super.startElement(uri, name, raw, attr);
}
}
@@ -471,18 +486,18 @@
} else if (DispatcherHelper.DISPATCHER_NAMESPACE_URI.equals(uri)) {
if (STRUCTURER_ELEMENT.equals(name))
structurerProcessingEnd(raw);
- else if (ContractBean.CONTRACT_ELEMENT.equals(name) & this.includeNodes)
+ else if (ContractBean.CONTRACT_ELEMENT.equals(name) && this.includeNodes)
contractProcessingEnd();
- else if (DISPATCHER_HOOK_ELEMENT.equals(name) & this.includeNodes)
+ else if (DISPATCHER_HOOK_ELEMENT.equals(name) && this.includeNodes)
if (path.lastIndexOf("/") > -1)
path = path.substring(0, path.lastIndexOf("/"));
else
path = null;
} else {
- if (!this.insideProperties & this.includeNodes & this.insideStructurer
- & this.allowMarkup)
+ if (!this.insideProperties && this.includeNodes && this.insideStructurer
+ && this.allowMarkup)
super.endElement(uri, name, raw);
- if (!this.insideProperties & this.includeNodes & !this.insideStructurer)
+ if (!this.insideProperties && this.includeNodes && !this.insideStructurer)
super.endElement(uri, name, raw);
}
}
@@ -503,10 +518,10 @@
currentFormat = value;
}
if (localName.equals(STRUCTURER_HOOK_XPATH_ATTRIBUTE)) {
- if ("/".equals(String.valueOf(value.charAt(0))) & value.length() != 1) {
+ if ("/".equals(String.valueOf(value.charAt(0))) && value.length() != 1) {
path = "result" + value;
} else if ("/".equals(String.valueOf(value.charAt(0)))
- & value.length() == 1) {
+ && value.length() == 1) {
path = "result";
} else {
path = "result/" + value;
@@ -517,7 +532,7 @@
localRecycle();
try {
if (null == this.dispatcherHelper)
- this.dispatcherHelper = new DispatcherHelper(manager);
+ this.dispatcherHelper = new DispatcherHelper(m_resolver);
if (null == this.processor)
this.processor = (XPathProcessor) this.manager
.lookup(XPathProcessor.ROLE);
@@ -530,7 +545,7 @@
String propertyURI = "cocoon://" + requestId + ".props";
try {
this.defaultProperties = org.apache.forrest.dispatcher.util.SourceUtil
- .readDOM(propertyURI, this.manager);
+ .readDOM(propertyURI, m_resolver);
} catch (Exception e1) {
String error = "dispatcherError:\n" + "Could not get the properties for "
+ propertyURI + "\n DispatcherStack: " + e1;
@@ -640,7 +655,7 @@
private void contractProcessingStart(Attributes attr) throws SAXException {
try {
if (contract == null)
- contract = new ContractBeanDOMImpl(this.manager, parameterHelper,
+ contract = new ContractBeanDOMImpl(m_resolver, parameterHelper,
defaultProperties, (URIResolver) this);
} catch (Exception e) {
String error = DispatcherException.ERROR_500 + "\n"
@@ -658,9 +673,11 @@
contract.setContractName(value);
String contractUri = ContractBean.CONTRACT_RESOLVE_PREFIX + "."
+ currentFormat + "." + value;
+ Source contractSource = null;
try {
+ contractSource = m_resolver.resolveURI(contractUri);
Document doc = org.apache.forrest.dispatcher.util.SourceUtil.readDOM(
- contractUri, this.manager);
+ contractUri, m_resolver);
contract.setContractImpl(doc, contractUri);
// contract.setContractImpl(contractUri);
} catch (Exception e) {
@@ -673,6 +690,8 @@
+ contractUri + "\".\n\n" + "dispatcherErrorStack:\n" + e;
getLogger().error(error);
throw new SAXException(error);
+ }finally{
+ release(contractSource);
}
if (getLogger().isDebugEnabled()) {
getLogger().debug(
@@ -682,10 +701,11 @@
} else if (ContractBean.CONTRACT_NUGGET_ATTRIBUTE.equals(localName)) {
// contract is a nugget-contract
contract.setNugget(true);
+ Source contractRawSource =null;
try {
-
+ contractRawSource = m_resolver.resolveURI(value);
Document doc = org.apache.forrest.dispatcher.util.SourceUtil.readDOM(
- value, this.manager);
+ value, m_resolver);
contract.setContractRawData(doc);
// contract.setNuggetUri(value);
} catch (Exception e) {
@@ -698,6 +718,8 @@
+ value + "\".\n\n" + "dispatcherErrorStack:\n " + e;
getLogger().error(error);
throw new SAXException(error);
+ } finally{
+ release(contractRawSource);
}
if (getLogger().isDebugEnabled()) {
getLogger().debug(
@@ -886,26 +908,26 @@
}
public void characters(char c[], int start, int len) throws SAXException {
- if (this.insideProperties & this.includeNodes)
+ if (this.insideProperties && this.includeNodes)
this.builder.characters(c, start, len);
- else if (!this.insideProperties & this.includeNodes
- & !this.insideStructurer)
+ else if (!this.insideProperties && this.includeNodes
+ && !this.insideStructurer)
super.contentHandler.characters(c, start, len);
}
public void startCDATA() throws SAXException {
- if (this.insideProperties & this.includeNodes)
+ if (this.insideProperties && this.includeNodes)
this.builder.startCDATA();
- else if (!this.insideProperties & this.includeNodes
- & !this.insideStructurer)
+ else if (!this.insideProperties && this.includeNodes
+ && !this.insideStructurer)
super.lexicalHandler.startCDATA();
}
public void endCDATA() throws SAXException {
- if (this.insideProperties & this.includeNodes)
+ if (this.insideProperties && this.includeNodes)
this.builder.endCDATA();
- else if (!this.insideProperties & this.includeNodes
- & !this.insideStructurer)
+ else if (!this.insideProperties && this.includeNodes
+ && !this.insideStructurer)
super.lexicalHandler.endCDATA();
}
@@ -913,7 +935,7 @@
public void startPrefixMapping(String prefix, String uri) throws SAXException {
super.startPrefixMapping(prefix, uri);
- if (this.insideProperties & this.includeNodes) {
+ if (this.insideProperties && this.includeNodes) {
this.builder.startPrefixMapping(prefix, uri);
} else {
storePrefixMapping(prefix, uri);
@@ -1019,7 +1041,7 @@
return null;
} finally {
- m_resolver.release(xslSource);
+ release(xslSource);
}
}
Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/util/SourceUtil.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/util/SourceUtil.java?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/util/SourceUtil.java (original)
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/util/SourceUtil.java Wed Sep 10 20:45:49 2008
@@ -21,10 +21,9 @@
import javax.xml.parsers.ParserConfigurationException;
import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.cocoon.environment.SourceResolver;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceNotFoundException;
+import org.apache.excalibur.source.SourceResolver;
import org.apache.forrest.dispatcher.lenya.xml.DocumentHelper;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@@ -41,27 +40,20 @@
* @throws SAXException if an error occurs.
* @throws IOException if an error occurs.
*/
- public static Document readDOM(String sourceUri, ServiceManager manager)
+ public static Document readDOM(String sourceUri, SourceResolver resolver)
throws ServiceException, SourceNotFoundException, ParserConfigurationException,
SAXException, IOException {
- SourceResolver resolver = null;
Source source = null;
Document document = null;
try {
-
- resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
source = resolver.resolveURI(sourceUri);
-
if (source.exists()) {
document = DocumentHelper.readDocument(source.getInputStream());
}
} finally {
- if (resolver != null) {
if (source != null) {
resolver.release(source);
}
- manager.release(resolver);
- }
}
return document;
}
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap Wed Sep 10 20:45:49 2008
@@ -48,7 +48,7 @@
<map:generator name="directory"
src="org.apache.cocoon.generation.DirectoryGenerator" />
<map:generator name="jx" logger="sitemap.generator.jx"
- src="org.apache.cocoon.generation.JXTemplateGenerator"
+ src="org.apache.cocoon.template.JXTemplateGenerator"
label="content,data" pool-max="16" />
<map:generator name="text"
src="org.apache.cocoon.generation.TextGenerator">
@@ -57,7 +57,7 @@
</map:generators>
<map:transformers default="xslt">
<map:transformer logger="sitemap.transformer.jx" name="jx" pool-max="16"
- src="org.apache.cocoon.transformation.JXTemplateTransformer" />
+ src="org.apache.cocoon.template.JXTemplateTransformer" />
<map:transformer logger="sitemap.transformer.jpath" name="jpath"
src="org.apache.cocoon.transformation.JPathTransformer" />
<map:transformer name="dispatcher"
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml Wed Sep 10 20:45:49 2008
@@ -184,15 +184,15 @@
<location
src="{properties:resources}/structurer/url/{1}{properties:dispatcher.theme-ext}"
/>
- <act type="sourcetype"
+ <!--<act type="sourcetype"
src="{properties:content.xdocs}{1}.xml">
-<!-- Sourcetype based
- http://forrest.apache.org/docs/cap.html-->
+ Sourcetype based
+ http://forrest.apache.org/docs/cap.html
<location
src="lm://dispatcher.structurer.resourceType.{sourcetype}"
/>
</act>
- <act type="resourceTypeAction">
+ --><!--<act type="resourceTypeAction">
<parameter value="{../1}{1}" name="request"/>
<parameter value="{properties:content.xdocs}"
name="projectDir"/>
@@ -203,10 +203,10 @@
<parameter
value="http://apache.org/cocoon/lenya/page-envelope/1.0"
name="resourceTypeElementNS"/>
-<!-- Meta data based -->
+ Meta data based
<location src="{uri}" />
</act>
- <act type="RecursiveDirectoryTraversalAction">
+ --><act type="RecursiveDirectoryTraversalAction">
<parameter value="{../1}{1}" name="request"/>
<parameter value="{properties:dispatcher.theme}" name="projectFallback"/>
<parameter value="{properties:dispatcher.theme-ext}"
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java?rev=694101&r1=694100&r2=694101&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java Wed Sep 10 20:45:49 2008
@@ -32,6 +32,7 @@
import javax.xml.transform.dom.DOMSource;
import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.excalibur.source.SourceResolver;
import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
import org.apache.forrest.dispatcher.transformation.DispatcherTransformer;
import org.w3c.dom.Document;
@@ -107,7 +108,6 @@
protected DispatcherHelper dispatcherHelper;
- protected ServiceManager manager;
private HashMap parameterHelper;
@@ -117,6 +117,8 @@
private Object defaultVariables;
+ private SourceResolver resolver;
+
/**
* The ContractBean contains all fields to work with contracts. It is a
* helper bean.
@@ -131,11 +133,11 @@
* @param defaultProperties
* @throws ParserConfigurationException
*/
- public ContractBeanDOMImpl(ServiceManager manager, HashMap parameterHelper,Document defaultProperties, URIResolver uriResolver)
+ public ContractBeanDOMImpl(SourceResolver resolver, HashMap parameterHelper,Document defaultProperties, URIResolver uriResolver)
throws ParserConfigurationException {
m_uriResolver=uriResolver;
- this.manager = manager;
- dispatcherHelper = new DispatcherHelper(manager);
+ this.resolver = resolver;
+ dispatcherHelper = new DispatcherHelper(resolver);
this.parameterHelper = parameterHelper;
this.defaultVariables=defaultProperties;
}
@@ -167,7 +169,7 @@
* @see org.apache.forrest.dispatcher.ContractBeanInterface#initialize()
*/
public void initialize() throws ParserConfigurationException {
- dispatcherHelper = new DispatcherHelper(this.manager);
+ dispatcherHelper = new DispatcherHelper(resolver);
}
/*