cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r488202 [10/19] - in /incubator/cayenne/main/trunk/assembly/cayenne-generic: ./ src/doc/ src/doc/confluence/ src/doc/confluence/Documentation/ src/doc/confluence/Documentation/JPA Guide/ src/doc/confluence/Documentation/JPA Guide/JPA Agent/...
Date Mon, 18 Dec 2006 10:24:42 GMT
Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataViews in Action/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataViews%20in%20Action/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataViews in Action/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataViews in Action/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,119 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - DataViews in Action</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">DataViews in Action</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataViews/Swing Applications/index.html">Swing Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataView Concepts/index.html">DataView Concepts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html">DVModeler GUI Tool</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataViews in Action/index.html">DataViews in Action</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<p>Here we illustrate the discussion of DataViews with configuration samples and code snippets. Cayenne project DTD file supports references to data view configuration files. This information is loaded into the Cayenne Configuration instance along with the DataDomain, DataNode, and DataMap entries. Since the DataView functionality is optional and would not be very useful in some deployment scenarios (server-side applications) the DataView configiuration itself is not loaded at the time of initialization. Neither DataView instances are created by the configuration process. A DataView can be created in a Swing application with the code similar to the following:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">//Assume, <span class="code-keyword">this</span> is your Cayenne Configuration instance.
+</span>Configuration cayenneConfiguration = ...;
+
+<span class="code-comment">//You will need to setup a Cayenne EntityResolver in your DataView
+</span><span class="code-comment">//For example you can retrieve it from the DataContext in use
+</span><span class="code-comment">//with dataContext.getEntityResolver();
+</span><span class="code-comment">//or construct your own composite one, spanning several Data Domains.
+</span>EntityResolver entityResolver = ...;
+
+<span class="code-comment">//Create <span class="code-keyword">new</span> DataView instance, and set its entityResolver
+</span><span class="code-comment">//*before* loading the actual configuration
+</span>DataView dataView = <span class="code-keyword">new</span> DataView();
+dataView.setEntityResolver(entityResolver);
+
+<span class="code-comment">//Load the configuration
+</span>cayenneConfiguration.loadDataView(dataView);
+
+<span class="code-comment">//Here we go. Our Data View is ready to be used in the application
+</span><span class="code-comment">//This way you can create several of them, completely separated <span class="code-keyword">if</span> needed.</span></pre>
+</div></div>     
+
+<p>It is worth mentioning one instance of DataView serves to incorporate several Data View configurations saved in different files. Therefore it defines single namespace and easily resolves inter-configuration references among the ObjEntityViews</p>
+
+<p>Next, let us see how a Swing table model and JTable can be configured with our Data View to display and edit a list of data objects.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataView dataView = ...;
+
+JTable featureTable = ...;
+ObjEntityView featureView = dataView.getObjEntityView(<span class="code-quote">"ProductFeatureView"</span>);
+
+<span class="code-comment">// This is a descendant of javax.swing.table.AbstractTableModel
+</span>DOTableModel tableModel = <span class="code-keyword">new</span> DOTableModel();
+tableModel.setView(featureView);
+
+<span class="code-comment">// Retrieve a list of data objects (with SelectQuery, say)
+</span><span class="code-comment">// and initialize the model with it
+</span>DataObjectList featureDataObjects = ...;
+tableModel.setDataObjects(matrixEntries);
+
+featureTable.setModel(tableModel);
+
+<span class="code-comment">// set the apropriate TableCellRenderers and Editors
+</span><span class="code-keyword">new</span> CellRenderers().installRenderers(featureTable);
+<span class="code-keyword">new</span> CellEditors().installEditors(featureTable);</pre>
+</div></div>  
+
+<p>In fact, there is many more cool things you could do with DataViews to build your Cayenne enabled Swing rich client faster and cleaner, and separate the GUI related stuff from your domain logic defining the clear declarative rules telling the framework how to interprete, render, and edit the ObjEntities and DataObjects your application relies upon. </p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataViews in Action/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/Swing Applications/dataview-usecases.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/Swing%20Applications/dataview-usecases.gif?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/Swing Applications/dataview-usecases.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/Swing Applications/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/Swing%20Applications/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/Swing Applications/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/Swing Applications/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,77 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Swing Applications</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Swing Applications</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataViews/Swing Applications/index.html">Swing Applications</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataView Concepts/index.html">DataView Concepts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html">DVModeler GUI Tool</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataViews in Action/index.html">DataViews in Action</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<p>Those who have experience of Swing GUI development knows how much time it takes to work out all the minutest details of formatting, in-place input validation, handling the interactive data modification, enforcing naming, order, and formatting consistensy, etc. Whenever the domain or requirements change (e.g. new attributes are added to an ObjEntity, formats or captions of data are modified, or relationships change their meaning) developers are faced with the necessity to go through the number of Swing data models, panels, various helpers fishing out the bits of code to be corrected.</p>
+
+<p>Another problem is the need for quick and easy prototyping of data aware GUIs. Those who, at one time or another, worked with Borland VCL for C++ or Delphi or DataExpress/dbSwing for Java and similar frameworks can recall how painless it was to create a rough prototype of the GUI working with the relational database and bind it to the actual data. That was possible due to the layer of easily configured data aware classes and components. And once the working prototype had been ready, refinining it used to be a very simple task.</p>
+
+<p>Cayenne DataViews solve these problems. Data Views act as a bridge between the domain defined in terms of Cayenne DataObjects and a presentation layer built with Swing. Potentially they can be used in the Web environment as well, but Swing integration is the main direction. Conceptually, Data Views are close to the application facades described, for instance, by <span class="nobr"><a href="http://www.martinfowler.com/apsupp/appfacades.pdf" title="Visit page outside Confluence" rel="nofollow">Martin Fowler<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>. The following figure shows the area where Data Views can be applied.<br/>
+<img src="dataview-usecases.gif" align="absmiddle" border="0" /></p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Validation</b><br />The validation rules mentioned in the Use Cases are meant to be "lightweght", i.e. it is generally agreed the validation related code to enforce the business rules should be located in the domain area but, still, there are various checks one could prefer to perform right in the presentation layer like inclusion in a predefined range of values, correct input format, sometimes, even preliminary credit card number validity check with the well known Luhn algorithm, the other kinds of sanity checks. Presently the validation is on the list of the features to be added.</td></tr></table></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/Swing Applications/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,77 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - DataViews</title>
+    <style type="text/css">@import "../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">DataViews</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../Documentation/User Guide/DataViews/index.html">DataViews</a><ul>
+<li><a href="../../../Documentation/User Guide/DataViews/Swing Applications/index.html">Swing Applications</a></li>
+<li><a href="../../../Documentation/User Guide/DataViews/DataView Concepts/index.html">DataView Concepts</a></li>
+<li><a href="../../../Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html">DVModeler GUI Tool</a></li>
+<li><a href="../../../Documentation/User Guide/DataViews/DataViews in Action/index.html">DataViews in Action</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<table cellpadding='5' width='85%' cellspacing='8px' class='warningMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../images/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>In the future versions of Cayenne DataViews will be split in a standalone package. Unless we find volunteers, this package won't be supported very well.</td></tr></table>
+
+<p>Cayenne takes care of managing persistence layer for all types of applications - web, rich client, command line, etc. With DataViews Cayenne extends into the area of integrating such persistent layer with Swing GUI.</p>
+
+<p>DataViews define various presentation parameters of the DataObjects in an XML format. Just like DataMaps are edited using CayenneModeler, DataViews are edited with <a href="../../../Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html" title="DVModeler GUI Tool">DVModeler GUI tool</a>. Runtime DataView classes are a part of the main Cayenne JAR file.</p>
+
+<p>For manual editing of the DataViews, DataView DTD is included in the distribution. It is pretty small and the names are self-explanatory once you become familiar with the Data View structure described in this chapter.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">JDOM Note</b><br />DataViews use JDOM, so in addition to the jar files required by a regular Cayenne application, DataViews-based application must have access to JDOM jars. JDOM can be downloaded from <span class="nobr"><a href="http://www.jdom.org/" title="Visit page outside Confluence" rel="nofollow">http://www.jdom.org/<sup><img class="rendericon" src="../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>.</td></tr></table>
+</div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Configuring Logging/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/Configuring%20Logging/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Configuring Logging/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Configuring Logging/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,135 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Configuring Logging</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Configuring Logging</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a><ul>
+<li><a href="../../../../Documentation/User Guide/Deployment/Standalone Applications/index.html">Standalone Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Web Applications/index.html">Web Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Customizing Configuration/index.html">Customizing Configuration</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html">DBCPDataSourceFactory</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Using JNDI/index.html">Using JNDI</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Deployment with Ant/index.html">Deployment with Ant</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Configuring Logging/index.html">Configuring Logging</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>Cayenne logging is based on Log4J package from Jakarta Apache Project. This is the most powerful and flexible logging framework available in Java. Log4J configuration is normally done using a property file. Later in this chapter we explain how Cayenne loads configuration files and how to customize this process. Format of the entries in this file is described in the Log4j documentation. Here is a sample configuration file contents:</p>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre># General Log4J stuff
+log4j.rootLogger=WARN, A1
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=cayenne %-5p [%t %d{MM-dd HH:mm:ss}] %c{1}: %m%n
+
+# indiv. packages configuration - turning on the packages that we care about
+#log4j.logger.org.apache.cayenne = INFO
+
+# This is the logger that controls SQL output
+# Setting the level to INFO or DEBUG will turn the logs on
+log4j.logger.org.apache.cayenne.access.QueryLogger = INFO
+</pre>
+</div></div>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Users of Other Logging Frameworks</b><br />If your application uses another package for its own logging purposes (like JDK 1.4 java.util.logging, or commons-logging from Jakarta), Cayenne Log4J-based logging will not interfere with your other logging configurations.</td></tr></table>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Log4J Users</b><br />If your application already uses Log4J, Cayenne will simply use your existing configuration.</td></tr></table>
+
+<h3><a name="ConfiguringLogging-EssentialLoggers"></a>Essential Loggers</h3>
+<p>SQL Tracing. Very important logging feature of Cayenne is tracing the execution of SQL statements. If configured appropriately, Cayenne will log opened connections, executed queries, and DDL statements. This is extremely important in understanding what is going on in the application, tracing bugs, etc. Logger that is responsible for SQL logging is "org.apache.cayenne.access.QueryLogger". Its default logging level is INFO, so the following lines in the configuration file will turn it on or off:</p>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre># Turn SQL tracing on
+log4j.logger.org.apache.cayenne.access.QueryLogger = INFO
+
+# Turn SQL tracing off, e.g. to increase performance
+log4j.logger.org.apache.cayenne.access.QueryLogger = WARN
+</pre>
+</div></div>
+
+<p>When SQL tracing is turned off, it is possible to log the execution of only certain queries or commits by manually increasing the logging level of just a specific query above the level configured for the QueryLogger. This is a very convenient feature for debugging the code, since it reduces the level of noise in the logs, focusing attention on the queries that are important. This API is discussed in the FAQ.</p>
+
+<p>Tracing Configuration Loading. Cayenne XML files may contain errors, or maybe missing or inaccessible by the application; there maybe lots of other reasons why Cayenne fails to startup, from missing JDBC drivers to misspelled database URLs. To trace configuration loading process, you will need to turn on the following loggers:</p>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre>log4j.logger.org.apache.cayenne.conf = DEBUG
+log4j.logger.org.apache.cayenne.util = DEBUG
+</pre>
+</div></div>
+
+<h3><a name="ConfiguringLogging-DefaultConfiguration"></a>Default Configuration</h3>
+<p>Default behaviour of Cayenne is to look for a file called cayenne-log.properties, first in the directory $HOME/.cayenne/, then in the CLASSPATH (i.e. a file called .cayenne/cayenne-log.properties at the root of one of the locations accessible by the ClassLoader). $HOME is a system specific home directory of a user running the application. If you don't know what it is, try printing it from Java like this: System.out.println(System.getProperty("user.home")).</p>
+
+<p>If you don't explicitly create this file, Cayenne will use the one included in cayenne.jar (and therefore guaranteed to be in the CLASSPATH). This means - no special logging configuration is required, Cayenne will just work out of the box.</p>
+
+<h3><a name="ConfiguringLogging-CustomConfigurationFile"></a>Custom Configuration File</h3>
+<p>If you are not satisfied with the default location or default file name of the logging configuration, you can supply your own:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// Obtain the URL of the custom configuration file
+</span>java.net.URL url = ....;
+
+<span class="code-comment">// configure cayenne logging
+</span><span class="code-comment">// note that URL can be <span class="code-keyword">null</span>, resulting in <span class="code-keyword">default</span> settings
+</span>org.apache.cayenne.conf.Configuration.configureCommonLogging(url);</pre>
+</div></div>
+<p>It is important to execute this code before any calls to Cayenne are made in the application, or otherwise it will have no effect on logging.</p>
+
+<h3><a name="ConfiguringLogging-ConfiguringLog4JoutsideofCayenne"></a>Configuring Log4J outside of Cayenne</h3>
+
+<p>Finally, if your application already uses Log4J and implements its own logic to configure logging, it would be undesirable for Cayenne to use its default behavior and override any application settings. Also it is convenient to use a single logging configuration file per application. Cayenne detects if Log4J has already been started and will stop any attempts to configure logging. This means that Log4J services must be configured prior to any calls to Cayenne. </p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Configuring Logging/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Customizing Configuration/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/Customizing%20Configuration/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Customizing Configuration/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Customizing Configuration/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,122 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Customizing Configuration</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Customizing Configuration</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a><ul>
+<li><a href="../../../../Documentation/User Guide/Deployment/Standalone Applications/index.html">Standalone Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Web Applications/index.html">Web Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Customizing Configuration/index.html">Customizing Configuration</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html">DBCPDataSourceFactory</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Using JNDI/index.html">Using JNDI</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Deployment with Ant/index.html">Deployment with Ant</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Configuring Logging/index.html">Configuring Logging</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>A user can create her own subclass of Configuration and use it instead of the classes provided by Cayenne. Custom subclasses are usually created to load configuration files from non-standard locations, to automatically configure Cayenne during certain events that happen in deployment containers, etc. Cayenne provides a few implementations of Configuration discussed later in this chapter.</p>
+
+<p>To ensure that Cayenne uses the correct Configuration class, it must be initialized properly before any calls to Configuration are made:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.conf.Configuration
+...
+<span class="code-object">Class</span> myConfigSubclass = my.<span class="code-keyword">package</span>.ConfigSubclass.class;
+Configuration.initializeSharedConfiguration(myConfigSubclass);</pre>
+</div></div>
+<p>After this code is executed, any subsequent calls to <tt>Configuration.getSharedConfiguration()</tt> will return an instance of the custom class instead of <tt>DefaultConfiguration</tt>.</p>
+
+<p>Another useful feature is the customization of the resource lookup strategy implemented by the existing classes. Currently, both <tt>DefaultConfiguration</tt> and <tt>FileConfiguration</tt> offer the possibility to add additional paths which will be searched for resources.</p>
+
+<h3><a name="CustomizingConfiguration-DefaultConfiguration"></a>DefaultConfiguration</h3>
+
+<p><tt>DefaultConfiguration</tt> uses the application's class path for locating configuration files; this works for both "expanded" class paths and JAR files. "Out of the box" only resources on the top level of the class path are found; very often it is convenient to have a subdirectory ('package') with configuration files. There are two ways to make Configuration find these files:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.conf.DefaultConfiguration;
+...
+DefaultConfiguration conf = <span class="code-keyword">new</span> DefaultConfiguration();			
+conf.addClassPath(<span class="code-quote">"my/<span class="code-keyword">package</span>/conf"</span>);
+Configuration.initializeSharedConfiguration(conf);</pre>
+</div></div>
+<p>Alternatively you can place an empty subclass of DefaultConfiguration into your package and use that class directly:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> my.<span class="code-keyword">package</span>.conf.MyPackageConfiguration;
+...
+Configuration.initializeSharedConfiguration(<span class="code-keyword">new</span> MyPackageConfiguration());</pre>
+</div></div>
+
+<h3><a name="CustomizingConfiguration-FileConfiguration"></a>FileConfiguration</h3>
+
+<p><tt>FileConfiguration</tt> uses the regular file system to load its files, and works very silimar to <tt>DefaultConfiguration</tt>:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.conf.FileConfiguration;
+...
+<span class="code-object">String</span> fileName = <span class="code-quote">"/some/path/to/my-cayenne.xml"</span>;
+FileConfiguration conf = <span class="code-keyword">new</span> FileConfiguration(<span class="code-keyword">new</span> File(fileName));
+Configuration.initializeSharedConfiguration(conf);</pre>
+</div></div>
+<p>The fileName argument can be absolute or relative to the application's working directory, and is checked for accessibility. A more flexible lookup can be done by using the name without any path and adding search paths:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.conf.FileConfiguration;
+...
+FileConfiguration conf = <span class="code-keyword">new</span> FileConfiguration(<span class="code-quote">"my-cayenne.xml"</span>);
+conf.addFilesystemPath(<span class="code-quote">"a/relative/path"</span>);
+conf.addFilesystemPath(<span class="code-quote">"/another/absolute/path"</span>);
+conf.addFilesystemPath(<span class="code-keyword">new</span> File(<span class="code-quote">"/some/path/that/must/exist/"</span>));
+Configuration.initializeSharedConfiguration(conf);</pre>
+</div></div>
+<p>The difference between the String and File arguments is that the latter are checked for existence. Both variants can be absolute or relative, and are evaluated in the order in which they are added to the Configuration.</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Customizing Configuration/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/dbcp-step1.jpg
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/DBCPDataSourceFactory/dbcp-step1.jpg?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/dbcp-step1.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/dbcp-step2.jpg
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/DBCPDataSourceFactory/dbcp-step2.jpg?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/dbcp-step2.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/DBCPDataSourceFactory/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,254 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - DBCPDataSourceFactory</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">DBCPDataSourceFactory</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a><ul>
+<li><a href="../../../../Documentation/User Guide/Deployment/Standalone Applications/index.html">Standalone Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Web Applications/index.html">Web Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Customizing Configuration/index.html">Customizing Configuration</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html">DBCPDataSourceFactory</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Using JNDI/index.html">Using JNDI</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Deployment with Ant/index.html">Deployment with Ant</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Configuring Logging/index.html">Configuring Logging</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>As an alternative to a simple and easy-to-use DataSource bundled with Cayenne, it is possible to configure a more feature-rich DataSource based on Apache Jakarta <span class="nobr"><a href="http://jakarta.apache.org/commons/dbcp" title="Visit page outside Confluence" rel="nofollow">commons-dbcp<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>. To enable commons-dbcp pool, select <tt>DBCPDataSourceFactory</tt> in the Modeler for a DataNode:</p>
+
+<p><img src="dbcp-step1.jpg" align="absmiddle" border="0" /></p>
+
+<p>Configuration is done in a properties file that has to be edited in a text editor outside CayenneModeler. The name of this file is specified in the Modeler (with path relative to cayenne.xml location):</p>
+
+<p><img src="dbcp-step2.jpg" align="absmiddle" border="0" /></p>
+
+<p>Here is an example of such properties file contents:</p>
+
+<div class="code"><div class="codeHeader"><b>sample-dbcp.properties</b></div><div class="codeContent">
+<pre class="code-java">cayenne.dbcp.driverClassName=com.mysql.jdbc.Driver
+cayenne.dbcp.url=jdbc:mysql:<span class="code-comment">//localhost/cayenne
+</span>cayenne.dbcp.username=john
+cayenne.dbcp.password=secret
+cayenne.dbcp.maxActive=20
+cayenne.dbcp.minIdle=5
+cayenne.dbcp.maxIdle=8
+cayenne.dbcp.maxWait=10000</pre>
+</div></div>
+
+<h2><a name="DBCPDataSourceFactory-SupportedProperties"></a>Supported Properties</h2>
+
+<p>Below is a full list of supported properties, that fall into three categories - DataSource properties, connection pool properties and prepared statement pool properties. Only DataSource properties are required.</p>
+
+<h3><a name="DBCPDataSourceFactory-DataSourceProperties"></a>DataSource Properties</h3>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Property</th>
+<th class='confluenceTh'>Description</th>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.driverClassName</td>
+<td class='confluenceTd'>JDBC driver class</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.url</td>
+<td class='confluenceTd'>Database JDBC URL</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.username</td>
+<td class='confluenceTd'>Database login user name</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.password</td>
+<td class='confluenceTd'>Database login password</td>
+</tr>
+</tbody></table>
+
+<h3><a name="DBCPDataSourceFactory-ConnectionPoolProperties"></a>Connection Pool Properties</h3>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Property</th>
+<th class='confluenceTh'>Description</th>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.maxActive</td>
+<td class='confluenceTd'>Maximum number of active connections in the pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.minIdle</td>
+<td class='confluenceTd'>Minimum number of idle connections to keep in the pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.maxIdle</td>
+<td class='confluenceTd'>Maximum number of idle connections to keep in the pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.maxWait</td>
+<td class='confluenceTd'>A maximum time in milliseconds a caller should wait for a connection to be returned from the pool. -1 for indefinite.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.validationQuery</td>
+<td class='confluenceTd'>A SQL query used to validate a connection, before returning it to the user. Must return at least one row. E.g. <tt>"select 1 from dual"</tt></td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.testOnBorrow</td>
+<td class='confluenceTd'>A boolean specifying whether connection should be validated before being returned <b>from</b> the pool to the caller.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.testOnReturn</td>
+<td class='confluenceTd'>A boolean specifying whether connection should be validated before being returned back <b>to</b> the pool.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.testWhileIdle</td>
+<td class='confluenceTd'>A boolean specifying whether connection should be validated while it is idle.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.timeBetweenEvictionRunsMillis</td>
+<td class='confluenceTd'>A number of milliseconds an eviction thread should sleep between the runs.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.numTestsPerEvictionRun</td>
+<td class='confluenceTd'>A number of objects that an idle objects evictor should inspect on each run</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.minEvictableIdleTimeMillis</td>
+<td class='confluenceTd'>Minimum time an object should sit in the pool, before it can be considered for eviction.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.whenExhaustedAction</td>
+<td class='confluenceTd'>Specifies a pool behavior when the pool is exhausted and more connections are requested. Possible values are strings that follow the constant names defined in <tt>org.apache.commons.pool.impl.GenericObjectPool}: {{WHEN_EXHAUSTED_BLOCK</tt>, <tt>WHEN_EXHAUSTED_GROW</tt>, <tt>WHEN_EXHAUSTED_FAIL</tt>. If ommitted, <tt>WHEN_EXHAUSTED_BLOCK</tt> is assumed.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>caynne.dbcp.defaultAutoCommit</td>
+<td class='confluenceTd'>Auto-commit policy for connections returned from the pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.defaultReadOnly</td>
+<td class='confluenceTd'>Read-only policy for connections returned from the pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.defaultTransactionIsolation</td>
+<td class='confluenceTd'>Specifies transaction isolation for connections returned from the pool. Possible values are strings that follow the constant names defined in the <tt>java.sql.Connection</tt> interface: <tt>TRANSACTION_NONE</tt>, <tt>TRANSACTION_READ_COMMITTED</tt>, <tt>TRANSACTION_READ_UNCOMMITTED</tt>, <tt>TRANSACTION_REPEATABLE_READ</tt>, <tt>TRANSACTION_SERIALIZABLE</tt></td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.accessToUnderlyingConnectionAllowed</td>
+<td class='confluenceTd'>If set to true the application will be able to get access to the actual connection object which is normally wrapped by a poolable connections</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.defaultCatalog</td>
+<td class='confluenceTd'>Default catalog of connections created by the pool</td>
+</tr>
+</tbody></table>
+
+<h3><a name="DBCPDataSourceFactory-PreparedStatementPoolProperties"></a>PreparedStatement Pool Properties</h3>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Property</th>
+<th class='confluenceTh'>Description</th>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.poolPreparedStatements</td>
+<td class='confluenceTd'>Specifies whether PreparedStatements should be pooled</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.maxActive</td>
+<td class='confluenceTd'>Specifies the maximum number of PreparedStatements that can be borrowed from the pool at one time</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.maxIdle</td>
+<td class='confluenceTd'>Maximum number of idle PreparedStatements in the pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.maxTotal</td>
+<td class='confluenceTd'>Maximum number of PreparedStatements that can exist in the pool at one time</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.maxWait</td>
+<td class='confluenceTd'>A maximum time in milliseconds a caller should wait for a PreparedStatement to be returned from the pool. -1 for indefinite.</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.minEvictableIdleTimeMillis</td>
+<td class='confluenceTd'>Number of milliseconds a PreparedStatement can sit idle in the pool before it is elegible for eviction</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.numTestsPerEvictionRun</td>
+<td class='confluenceTd'>Number of idle PreparedStatements that should be examined per eviction run</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.testOnBorrow</td>
+<td class='confluenceTd'>Specifies whether a PreparedStatement should be validated before being borrowed from this pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.testOnReturn</td>
+<td class='confluenceTd'>Specifies whether a PreparedStatement should be validated before being returne to this pool</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.testWhileIdle</td>
+<td class='confluenceTd'>Specifies whether PreparedStatements should be validated in the idle eviction thread</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cayenne.dbcp.ps.timeBetweenEvictionRunsMillis</td>
+<td class='confluenceTd'>Specifies the time between the runs of the eviction thread</td>
+</tr>
+<tr>
+<td class='confluenceTd'> cayenne.dbcp.ps.whenExhaustedAction</td>
+<td class='confluenceTd'>Specifies a pool behavior when the pool is exhausted and more PreparedStatements are requested. Possible values are strings that follow the constant names defined in <tt>org.apache.commons.pool.impl.GenericObjectPool}: {{WHEN_EXHAUSTED_BLOCK</tt>, <tt>WHEN_EXHAUSTED_GROW</tt>, <tt>WHEN_EXHAUSTED_FAIL</tt>. If ommitted, <tt>WHEN_EXHAUSTED_BLOCK</tt> is assumed.</td>
+</tr>
+</tbody></table></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Deployment with Ant/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/Deployment%20with%20Ant/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Deployment with Ant/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Deployment with Ant/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,81 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Deployment with Ant</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Deployment with Ant</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a><ul>
+<li><a href="../../../../Documentation/User Guide/Deployment/Standalone Applications/index.html">Standalone Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Web Applications/index.html">Web Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Customizing Configuration/index.html">Customizing Configuration</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html">DBCPDataSourceFactory</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Using JNDI/index.html">Using JNDI</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Deployment with Ant/index.html">Deployment with Ant</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Configuring Logging/index.html">Configuring Logging</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<p>There is a number of cases when it is highly desirable to automate changing of Cayenne configuration files, including cayenne.xml and driver information files:</p>
+
+<ul>
+	<li>Changing connection information when porting an application from one environment to another: Deployment environment uses different information for the database connections from what was used in development.</li>
+	<li>Deployment of Cayenne libraries: Third party Cayenne libraries may contain DataMaps and business classes, but they normally do not have cayenne.xml file, since ultimate deployment configuration is unknown when the library is created.</li>
+</ul>
+
+
+<p>Cayenne provides an Ant task called cdeploy that takes care of such things. More information on cdeploy is available <a href="../../../../Documentation/User Guide/Ant Tasks/cdeploy/index.html" title="cdeploy">here</a>.</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Deployment with Ant/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Standalone Applications/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/Standalone%20Applications/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Standalone Applications/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Standalone Applications/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,103 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Standalone Applications</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Standalone Applications</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a><ul>
+<li><a href="../../../../Documentation/User Guide/Deployment/Standalone Applications/index.html">Standalone Applications</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Web Applications/index.html">Web Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Customizing Configuration/index.html">Customizing Configuration</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html">DBCPDataSourceFactory</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Using JNDI/index.html">Using JNDI</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Deployment with Ant/index.html">Deployment with Ant</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Configuring Logging/index.html">Configuring Logging</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><h3><a name="StandaloneApplications-SharedConfigurationSingleton"></a>Shared Configuration Singleton</h3>
+
+<p>In a standalone Java application, DefaultConfiguration is used to locate and load configuration files. This approach does not require any additional setup. Shared configuration instance can simply be obtained by calling <tt>getSharedConfiguration()</tt>:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.conf.Configuration;
+...           
+Configuration conf = Configuration.getSharedConfiguration();</pre>
+</div></div>
+
+<p>DefaultConfiguration will expect cayenne.xml file to be located in the CLASSPATH. The same is true for DataMaps referenced in cayenne.xml. Their location is resolved relative to CLASSPATH as well. To make these files available to Cayenne, you can simply include them in the root of your application jar file (read <a href="../../../../Documentation/User Guide/Deployment/Customizing Configuration/index.html" title="Customizing Configuration">Customizing Configuration</a> on how to change that).</p>
+
+<p>The location of the data source files referenced in cayenne.xml is interpreted by the factory that was assigned to each datasource in cayenne.xml. Default factory is DriverDataSourceFactory. It will rely on its parent configuration to find the data source file (i.e. locating data source files will be no different from the DataMap files). Depending on the application needs, programmers may implement custom factories that collect database information interactively by showing a login dialog, etc.</p>
+
+<h3><a name="StandaloneApplications-SharedConfigurationandDataContext"></a>Shared Configuration and DataContext</h3>
+
+<p>In a setup that relies on shared Configuration a DataContext can be created by calling <tt>DataContext.createDataContext()</tt> static method that internally uses shared configuration:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.access.DataContext;
+...
+DataContext context = DataContext.createDataContext();</pre>
+</div></div>
+
+<p>Later a DataContext can be passed around in the code explicitly, or it can be bound to an execution thread, making it accessible to all code being run within this thread (e.g. this can be a Swing event thread):</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.access.DataContext;
+...
+DataContext context = DataContext.createDataContext();
+DataContext.bindThreadDataContext(context);</pre>
+</div></div></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Standalone Applications/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/Using%20JNDI/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,164 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Using JNDI</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Using JNDI</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a><ul>
+<li><a href="../../../../Documentation/User Guide/Deployment/Standalone Applications/index.html">Standalone Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Web Applications/index.html">Web Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Customizing Configuration/index.html">Customizing Configuration</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/DBCPDataSourceFactory/index.html">DBCPDataSourceFactory</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Using JNDI/index.html">Using JNDI</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Deployment with Ant/index.html">Deployment with Ant</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/Configuring Logging/index.html">Configuring Logging</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<p>Cayenne can be setup to obtain a DataSource via JNDI, instead of using its own connection pool. To do that Cayenne DataNodes must be configured to use <tt>JNDIDataSourceFactory</tt>. This can be done in the modeler as shown on the pictures below.</p>
+
+<p>1. Select JNDIDataSourceFactory:<br/>
+<img src="jndi-step1.jpg" align="absmiddle" border="0" /></p>
+
+
+<p>2. Enter DataSource JNDI Name:<br/>
+<img src="jndi-step2.jpg" align="absmiddle" border="0" /></p>
+
+
+<h3><a name="UsingJNDI-DevelopmentwithJNDIDataNodes"></a>Development with JNDI DataNodes</h3>
+
+<p>To be able to connect to the database from CayenneModeler when JNDIDataSourceFactory is specified (and thus no explicit connection information is associated with the DataNode), you may configure a "local DataSource" (see a corresponding <a href="../../../../Documentation/Modeler Guide/Preferences Panel/Local DataSources/index.html" title="Local DataSources">Modeler Guide chapter</a>).</p>
+
+<p>Cayenne also supports container-less runtime operation of the JNDI node. It works like this:</p>
+
+<ul>
+	<li>JNDIDataSourceFactory attempts to locate a DataSource via a default JNDI provider.</li>
+	<li>If the DataSource is not found, JNDIDataSourceFactory attempts to read local user preferences database, looking for a local DataSource matching the JNDI name.</li>
+	<li>If such DataSource is found, it is used in the application as if it was obtained via JNDI.</li>
+</ul>
+
+
+<p>This way Modeler preferences database works as a substitute of a JNDI provider, saving extra configuration steps in development mode, when an application may be run from the IDE. Requirements to use this feature:</p>
+
+<ul>
+	<li>The name of the local DataSource in the Modeler preferences must match the JNDI name of the DataNode.</li>
+	<li><tt>cayenne-modeler.jar</tt> and <tt>hsqldb-x.x.x.jar</tt> must be in the application runtime CLASSPATH.</li>
+</ul>
+
+
+
+<h3><a name="UsingJNDI-DeploymentinContainer"></a>Deployment in Container</h3>
+
+<p>Depending on how the DataSource is mapped in the container, you may optionally need to add a "resource-ref" entry to the <tt>web.xml</tt> file:</p>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre>&lt;resource-ref&gt;
+   &lt;res-ref-name&gt;jdbc/myds&lt;/res-ref-name&gt;
+   &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
+   &lt;res-auth&gt;Container&lt;/res-auth&gt;
+&lt;/resource-ref&gt;</pre>
+</div></div>
+
+<p>Below are sample DataSource configurations for Tomcat 5.5 and 5.0. The XML should be pasted into <tt>$CATALINA_HOME/conf/server.xml</tt> file between the <tt>&lt;Host&gt;...&lt;/Host&gt;</tt> tags. Of course the application name and database parameters should be replaced with the correct values for the target environment. </p>
+
+
+
+<h4><a name="UsingJNDI-Tomcat5.5Configuration"></a>Tomcat 5.5 Configuration</h4>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre>&lt;Context path="/myapp" docBase="myapp"&gt;
+  &lt;Resource name="jdbc/myds" auth="Container"
+          type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
+          url="jdbc:oracle:thin:@127.0.0.1:1521:dbname"
+          username="userName" password="secret" maxActive="5" maxIdle="2"/&gt;
+&lt;/Context&gt;</pre>
+</div></div>
+
+<h4><a name="UsingJNDI-Tomcat5.0Configuration"></a>Tomcat 5.0 Configuration</h4>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre>&lt;Context path="/myapp" docBase="myapp"&gt;
+   &lt;Resource name="jdbc/myds" auth="Container" type="javax.sql.DataSource"/&gt;
+   &lt;ResourceParams name="jdbc/myds"&gt;
+      &lt;parameter&gt;
+         &lt;name&gt;driverClassName&lt;/name&gt;
+         &lt;value&gt;oracle.jdbc.driver.OracleDriver&lt;/value&gt;
+      &lt;/parameter&gt;
+      &lt;parameter&gt;
+         &lt;name&gt;url&lt;/name&gt;
+         &lt;value&gt;jdbc:oracle:thin:@127.0.0.1:1521:dbname&lt;/value&gt;
+      &lt;/parameter&gt;
+      &lt;parameter&gt;
+         &lt;name&gt;username&lt;/name&gt;
+         &lt;value&gt;***&lt;/value&gt;
+      &lt;/parameter&gt;
+      &lt;parameter&gt;
+         &lt;name&gt;password&lt;/name&gt;
+         &lt;value&gt;****&lt;/value&gt;
+      &lt;/parameter&gt;
+      &lt;parameter&gt;
+         &lt;name&gt;maxActive&lt;/name&gt;
+         &lt;value&gt;20&lt;/value&gt;
+      &lt;/parameter&gt;
+      &lt;parameter&gt;
+         &lt;name&gt;maxIdle&lt;/name&gt;
+         &lt;value&gt;10&lt;/value&gt;
+      &lt;/parameter&gt;
+   &lt;/ResourceParams&gt;
+&lt;/Context&gt;</pre>
+</div></div></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/jndi-step1.jpg
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/Using%20JNDI/jndi-step1.jpg?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/jndi-step1.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/jndi-step2.jpg
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/Deployment/Using%20JNDI/jndi-step2.jpg?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/Deployment/Using JNDI/jndi-step2.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message