A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/1162.html

Document ID: 1162
Branch: main
Language: default
Name: Configuration (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 7/14/06 12:55:30 PM
Updated by: Carsten Ziegeler

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 9122 bytes (previous version: 7527 bytes)
Content diff:
(9 equal lines skipped)
    refer to from within the configuration files (and sitemaps).</p>
    
    <p>You can define as many property files and define your own properties as 
you
--- want. Store them in the WEB-INF/properties directory and Cocoon will read 
all of
--- them on startup in alphabetical order. If two files provide values for the 
same
--- property, the last definition wins. Please note that any changes you make 
to the
--- property files will not be reflected during runtime. The changes will take
--- effect, the next time you startup the Cocoon web application.</p>
+++ want. Store them in the "WEB-INF/cocoon/properties" directory and Cocoon 
will
+++ read all of them on startup in alphabetical order. If two files provide 
values
+++ for the same property, the last definition wins. Please note that any 
changes
+++ you make to the property files will not be reflected during runtime. The 
changes
+++ will take effect, the next time you startup the Cocoon web application (or
+++ restart the servlet context).</p>
    
--- <p>You can then refer to the values of a property by using the common
--- ${PROPERTY_NAME} syntax in your configuration file or sitemap.</p>
+++ <p>You can refer to the values of a property by using the common
+++ ${PROPERTY_NAME} syntax in your configuration file or sitemap (this includes
+++ spring configuration files loaded by Cocoon as well).</p>
    
    <h2>Running modes</h2>
    
    <p>Cocoon extends the property based configuration mechanism by "running
--- modes". You define a running mode when you start Cocoon (default is "dev"). 
The
+++ modes". You define a running mode when you start Cocoon (default is 
"prod"). The
    name of the running mode is used to read additional property files on 
startup.
--- Cocoon reads first all property files from "WEB-INF/properties" and then 
from
--- "WEB-INF/properties/${RUNNING_MODE}".</p>
+++ Cocoon reads first all property files from "WEB-INF/cocoon/properties" and 
after
+++ that from "WEB-INF/cocoon/properties/${RUNNING_MODE}".</p>
    
    <p>For example if you have different database connections during 
development and
    in production, just put a properties file containing the connection 
information
--- for development in the "WEB-INF/properties/dev" directory and put another
--- property file with the production settings in "WEB-INF/properties/prod". (Of
--- course think about security issues regarding this information - you might 
not
--- want that a developer knows the database configuration of the production
+++ for development in the "WEB-INF/cocoon/properties/dev" directory and put 
another
+++ property file with the production settings in 
"WEB-INF/cocoon/properties/prod".
+++ (Of course think about security issues regarding this information - you 
might
+++ not want that a developer knows the database configuration of the production
    machine).</p>
    
    <p>You can easily set the running mode by setting the system property
    "org.apache.cocoon.mode" on startup of Cocoon, for example:<br/>
--- "-Dorg.apache.cocoon.mode=prod".</p>
+++ "-Dorg.apache.cocoon.mode=dev".</p>
    
    <p>Note, that "dev" and "prod" are not predefined modes, they are just 
names.
    This means you can use any name you want, e.g. you can create a "myenv"
(37 equal lines skipped)
    
    <p>If you want to store all your properties in a different storage than the 
file
    system, for example in a database, you can implement your own provider
--- mechanism. Add a bean implementing the PropertiesProvider interface to the 
root
+++ mechanism. Add a bean implementing the PropertyProvider interface to the 
root
    application context of Spring and Cocoon will get all properties from this
    provider after it has read the properties from the properties files.</p>
    
+++ <h2>User defined Properties</h2>
+++ 
+++ <p>If the user who has started the web application has a 
"settings.properties"
+++ file stored in the ".cocoon" directory in his home directory, these 
properties
+++ will be read and applied as well.</p>
+++ 
+++ <h2>Additional Property File</h2>
+++ 
+++ <p>After all property files have been read, the value of the property
+++ "org.apache.cocoon.settings" is evaluated. If this property is set, the 
property
+++ file defined by this value is read and applied as well. The property could 
have
+++ been set by any previously read property file or by a system property.</p>
+++ 
+++ <h2>Summarizing Property Loading on Startup</h2>
+++ 
+++ <p>The whole property mechanism is performed before the Cocoon component
+++ container is setup and consists of the following seven steps:</p>
+++ 
+++ <ol>
+++ <li>WEB-INF/cocoon/properties/*.properties</li>
+++ <li>WEB-INF/cocoon/properties/[RUNNING_MODE]/*.properties</li>
+++ <li>Custom PropertyProvider defined in the Spring root application 
context</li>
+++ <li>Properties set by the servlet environment</li>
+++ <li>[USER_HOME]/.cocoon/settings.properties</li>
+++ <li>Additional property file specified by "org.apache.cocoon.settings" 
property
+++ </li>
+++ <li>System properties</li>
+++ </ol>
+++ 
+++ <p>The different property files and providers are queried in this order and 
the
+++ files in a directory are processed in alphabetical order. The properties are
+++ merged into one big set of properties. If there is more than one definition 
for
+++ a property the last definition wins.</p>
+++ 
    <h1>Logging</h1>
    
    <p>Cocoon uses <a href="http://logging.apache.org/log4j";>Log4J</a> by 
default
(81 equal lines skipped)


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes