continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r450440 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-core/src/main/java/org/apache/maven/continuum/configuration/ continuum-model/ continuum-model/src/main/mdo/ continuum-store/src/mai...
Date Wed, 27 Sep 2006 13:54:47 GMT
Author: evenisse
Date: Wed Sep 27 06:54:43 2006
New Revision: 450440

URL: http://svn.apache.org/viewvc?view=rev&rev=450440
Log:
o Rename all database columns that used a reserver name (http://db.apache.org/derby/docs/10.1/ref/rrefkeywords29722.html)
o Continuum jdo factory use now a datasource
o Add a new jdofactory for users objects like the security part
o Move company informations to the user datasource

Added:
    maven/continuum/trunk/continuum-model/src/main/mdo/general.xml   (with props)
    maven/continuum/trunk/continuum-webapp/src/jetty-env.xml   (with props)
Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    maven/continuum/trunk/continuum-model/pom.xml
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
    maven/continuum/trunk/continuum-store/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-webapp/pom.xml
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Wed Sep 27 06:54:43 2006
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.general.CompanyInformation;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Profile;
@@ -224,6 +225,14 @@
         throws ContinuumStoreException;
 
     SystemConfiguration getSystemConfiguration()
+        throws ContinuumStoreException;
+
+    CompanyInformation addCompanyInformation( CompanyInformation companyInfo );
+
+    void updateCompanyInformation( CompanyInformation companyInfo )
+        throws ContinuumStoreException;
+
+    CompanyInformation getCompanyInformation()
         throws ContinuumStoreException;
 
     ContinuumUser addUser( ContinuumUser user );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Wed Sep 27 06:54:43 2006
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.general.CompanyInformation;
 import org.apache.maven.continuum.model.system.SystemConfiguration;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
@@ -50,6 +51,8 @@
 
     private SystemConfiguration systemConf;
 
+    private CompanyInformation companyInformation;
+
     private boolean loaded = false;
 
     // ----------------------------------------------------------------------
@@ -126,32 +129,32 @@
 
     public String getCompanyLogo()
     {
-        return systemConf.getCompanyLogoUrl();
+        return companyInformation.getCompanyLogoUrl();
     }
 
     public void setCompanyLogo( String companyLogoUrl )
     {
-        systemConf.setCompanyLogoUrl( companyLogoUrl );
+        companyInformation.setCompanyLogoUrl( companyLogoUrl );
     }
 
     public String getCompanyName()
     {
-        return systemConf.getCompanyName();
+        return companyInformation.getCompanyName();
     }
 
     public void setCompanyName( String companyName )
     {
-        systemConf.setCompanyName( companyName );
+        companyInformation.setCompanyName( companyName );
     }
 
     public String getCompanyUrl()
     {
-        return systemConf.getCompanyUrl();
+        return companyInformation.getCompanyUrl();
     }
 
     public void setCompanyUrl( String companyUrl )
     {
-        systemConf.setCompanyUrl( companyUrl );
+        companyInformation.setCompanyUrl( companyUrl );
     }
 
     public boolean isGuestAccountEnabled()
@@ -250,6 +253,15 @@
                 systemConf = store.addSystemConfiguration( systemConf );
             }
 
+            companyInformation = store.getCompanyInformation();
+
+            if ( companyInformation == null )
+            {
+                companyInformation = new CompanyInformation();
+
+                companyInformation = store.addCompanyInformation( companyInformation );
+            }
+
             loaded = true;
         }
         catch ( ContinuumStoreException e )
@@ -264,6 +276,7 @@
         try
         {
             store.updateSystemConfiguration( systemConf );
+            store.updateCompanyInformation( companyInformation );
         }
         catch ( ContinuumStoreException e )
         {

Modified: maven/continuum/trunk/continuum-model/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-model/pom.xml?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-model/pom.xml (original)
+++ maven/continuum/trunk/continuum-model/pom.xml Wed Sep 27 06:54:43 2006
@@ -15,19 +15,41 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-9</version>
+        <version>1.0-alpha-11-SNAPSHOT</version>
         <executions>
           <execution>
+            <id>modello-continuum</id>
             <goals>
               <goal>java</goal>
               <goal>jpox-jdo-mapping</goal>
             </goals>
+            <configuration>
+              <model>src/main/mdo/continuum.xml</model>
+            </configuration>
+          </execution>
+          <execution>
+            <id>modello-java-users</id>
+            <goals>
+              <goal>java</goal>
+            </goals>
+            <configuration>
+              <model>src/main/mdo/general.xml</model>
+            </configuration>
+          </execution>
+          <execution>
+            <id>jpox-jdo-mapping-users</id>
+            <goals>
+              <goal>jpox-jdo-mapping</goal>
+            </goals>
+            <configuration>
+              <model>src/main/mdo/general.xml</model>
+              <outputDirectory>${basedir}/target/classes/org/apache/maven/continuum/model/general</outputDirectory>
+            </configuration>
           </execution>
         </executions>
         <configuration>
           <version>1.0.0</version>
           <packageWithVersion>false</packageWithVersion>
-          <model>src/main/mdo/continuum.xml</model>
         </configuration>
       </plugin>
       <plugin>

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml Wed Sep 27 06:54:43 2006
@@ -248,7 +248,7 @@
           <type>String</type>
           <description>The mechanism used to deliver notifications.</description>
         </field>
-        <field>
+        <field jpox.column="notifierorigin">
           <name>from</name>
           <version>1.0.0+</version>
           <type>int</type>
@@ -478,7 +478,7 @@
           <version>1.0.0+</version>
           <type>String</type>
         </field>
-        <field stash.maxSize="8192">
+        <field stash.maxSize="8192" jpox.column="exceptionstring">
           <name>exception</name>
           <version>1.0.0+</version>
           <type>String</type>
@@ -705,7 +705,7 @@
           <version>1.0.0+</version>
           <type>String</type>
         </field>
-        <field stash.maxSize="8192">
+        <field stash.maxSize="8192" jpox.column="exceptionstring">
           <name>exception</name>
           <version>1.0.0+</version>
           <type>String</type>
@@ -943,21 +943,6 @@
           <type>String</type>
         </field>
         <field>
-          <name>companyName</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>companyLogoUrl</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>companyUrl</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
           <name>initialized</name>
           <version>1.0.0+</version>
           <type>boolean</type>
@@ -1034,7 +1019,7 @@
           <version>1.0.0+</version>
           <type>String</type>
         </field>
-        <field>
+        <field jpox.column="usergroup">
           <name>group</name>
           <version>1.0.0+</version>
           <association stash.part="true" jpox.dependent="false">

Added: maven/continuum/trunk/continuum-model/src/main/mdo/general.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-model/src/main/mdo/general.xml?view=auto&rev=450440
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/general.xml (added)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/general.xml Wed Sep 27 06:54:43 2006
@@ -0,0 +1,36 @@
+<model>
+  <id>general</id>
+  <name>General</name>
+  <description>General's object model.</description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.continuum.model.general</value>
+    </default>
+  </defaults>
+
+  <classes>
+    <class>
+      <name>CompanyInformation</name>
+      <packageName>org.apache.maven.continuum.model.general</packageName>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>companyName</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>companyLogoUrl</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>companyUrl</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</model>

Propchange: maven/continuum/trunk/continuum-model/src/main/mdo/general.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-model/src/main/mdo/general.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Wed Sep 27 06:54:43 2006
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.general.CompanyInformation;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Profile;
@@ -62,13 +63,20 @@
     /**
      * @plexus.requirement
      */
-    private JdoFactory jdoFactory;
+    private JdoFactory continuumJdoFactory;
+
+    /**
+     * @plexus.requirement
+     */
+    private JdoFactory usersJdoFactory;
 
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
 
-    private PersistenceManagerFactory pmf;
+    private PersistenceManagerFactory continuumPmf;
+
+    private PersistenceManagerFactory usersPmf;
 
     // ----------------------------------------------------------------------
     // Fetch Groups
@@ -95,7 +103,8 @@
     public void initialize()
         throws InitializationException
     {
-        pmf = jdoFactory.getPersistenceManagerFactory();
+        continuumPmf = continuumJdoFactory.getPersistenceManagerFactory();
+        usersPmf = usersJdoFactory.getPersistenceManagerFactory();
     }
 
     // ----------------------------------------------------------------------
@@ -656,9 +665,15 @@
     private void updateObject( Object object )
         throws ContinuumStoreException
     {
+        updateObject( getPersistenceManager(), object );
+    }
+
+    private void updateObject( PersistenceManager pmf, Object object )
+        throws ContinuumStoreException
+    {
         try
         {
-            PlexusJdoUtils.updateObject( getPersistenceManager(), object );
+            PlexusJdoUtils.updateObject( pmf, object );
         }
         catch ( PlexusStoreException e )
         {
@@ -1064,7 +1079,22 @@
 
     private List getAllObjectsDetached( Class clazz, String ordering, String fetchGroup )
     {
-        return PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), clazz, ordering,
fetchGroup );
+        return getAllObjectsDetached( getPersistenceManager(), clazz, ordering, fetchGroup
);
+    }
+
+    private List getAllObjectsDetached( PersistenceManager pmf, Class clazz )
+    {
+        return getAllObjectsDetached( pmf, clazz, null );
+    }
+
+    private List getAllObjectsDetached( PersistenceManager pmf, Class clazz, String fetchGroup
)
+    {
+        return getAllObjectsDetached( pmf, clazz, null, fetchGroup );
+    }
+
+    private List getAllObjectsDetached( PersistenceManager pmf, Class clazz, String ordering,
String fetchGroup )
+    {
+        return PlexusJdoUtils.getAllObjectsDetached( pmf, clazz, ordering, fetchGroup );
     }
 
     public ProjectGroup addProjectGroup( ProjectGroup group )
@@ -1074,7 +1104,12 @@
 
     private Object addObject( Object object )
     {
-        return PlexusJdoUtils.addObject( getPersistenceManager(), object );
+        return addObject( getPersistenceManager(), object );
+    }
+
+    private Object addObject( PersistenceManager pmf, Object object )
+    {
+        return PlexusJdoUtils.addObject( pmf, object );
     }
 
     public ProjectGroup getProjectGroupByGroupId( String groupId )
@@ -1120,7 +1155,6 @@
         throw new ContinuumObjectNotFoundException( "unable to find project group containing
project with id: " + projectId );
     }
 
-
     public SystemConfiguration addSystemConfiguration( SystemConfiguration systemConf )
     {
         return (SystemConfiguration) addObject( systemConf );
@@ -1152,6 +1186,37 @@
         }
     }
 
+    public CompanyInformation addCompanyInformation( CompanyInformation companyInfo )
+    {
+        return (CompanyInformation) addObject( getPersistenceManager( usersPmf ), companyInfo
);
+    }
+
+    public void updateCompanyInformation( CompanyInformation companyInfo )
+        throws ContinuumStoreException
+    {
+        updateObject( getPersistenceManager( usersPmf ), companyInfo );
+    }
+
+    public CompanyInformation getCompanyInformation()
+        throws ContinuumStoreException
+    {
+        List companyInfos = getAllObjectsDetached( getPersistenceManager( usersPmf ), CompanyInformation.class
);
+
+        if ( companyInfos == null || companyInfos.isEmpty() )
+        {
+            return null;
+        }
+        else if ( companyInfos.size() > 1 )
+        {
+            throw new ContinuumStoreException(
+                "Database is corrupted. There are more than one companyInformation object."
);
+        }
+        else
+        {
+            return (CompanyInformation) companyInfos.get( 0 );
+        }
+    }
+
     public ContinuumUser addUser( ContinuumUser user )
     {
         return (ContinuumUser) addObject( user );
@@ -1379,6 +1444,11 @@
 
     private PersistenceManager getPersistenceManager()
     {
+        return getPersistenceManager( continuumPmf );
+    }
+
+    private PersistenceManager getPersistenceManager( PersistenceManagerFactory pmf )
+    {
         PersistenceManager pm = pmf.getPersistenceManager();
 
         pm.getFetchPlan().setMaxFetchDepth( -1 );
@@ -1394,7 +1464,8 @@
 
     public void closeStore()
     {
-        closePersistenceManagerFactory( 1 );
+        closePersistenceManagerFactory( continuumPmf, 1 );
+        closePersistenceManagerFactory( usersPmf, 1 );
     }
 
     /**
@@ -1402,7 +1473,7 @@
      *
      * @param numTry The number of try. The maximum try is 5.
      */
-    private void closePersistenceManagerFactory( int numTry )
+    private void closePersistenceManagerFactory( PersistenceManagerFactory pmf, int numTry
)
     {
         if ( pmf != null )
         {
@@ -1429,7 +1500,7 @@
                             //nothing to do
                         }
 
-                        closePersistenceManagerFactory( numTry + 1 );
+                        closePersistenceManagerFactory( pmf, numTry + 1 );
                     }
                     else
                     {

Modified: maven/continuum/trunk/continuum-store/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-store/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-store/src/main/resources/META-INF/plexus/components.xml
Wed Sep 27 06:54:43 2006
@@ -7,6 +7,13 @@
       <requirements>
         <requirement>
           <role>org.codehaus.plexus.jdo.JdoFactory</role>
+          <role-hint>continuum</role-hint>
+          <field-name>continuumJdoFactory</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.jdo.JdoFactory</role>
+          <role-hint>users</role-hint>
+          <field-name>usersJdoFactory</field-name>
         </requirement>
       </requirements>
     </component>

Modified: maven/continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml
Wed Sep 27 06:54:43 2006
@@ -2,7 +2,61 @@
   <components>
     <component>
       <role>org.codehaus.plexus.jdo.JdoFactory</role>
+      <role-hint>continuum</role-hint>
       <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>
+      <configuration>
+        <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+      </configuration>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.jdo.JdoFactory</role>
+      <role-hint>users</role-hint>
+      <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>
+      <configuration>
+        <!-- Database Configuration -->
+        <driverName>org.hsqldb.jdbcDriver</driverName>
+        <url>jdbc:hsqldb:${plexus.home}/database</url>
+        <userName>sa</userName>
+        <password></password>
+        <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+
+        <otherProperties>
+          <!-- JPOX and JDO configuration -->
+          <property>
+            <name>org.jpox.autoCreateSchema</name>
+            <value>true</value>
+          </property>
+          <property>
+            <name>org.jpox.validateTables</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateColumns</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateConstraints</name>
+            <value>false</value>
+          </property>
+
+          <property>
+            <name>org.jpox.autoStartMechanism</name>
+            <value>SchemaTable</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanismMode</name>
+            <value>Ignored</value>
+          </property>
+          <property>
+            <name>org.jpox.transactionIsolation</name>
+            <value>READ_UNCOMMITTED</value>
+          </property>
+          <property>
+            <name>org.jpox.poid.transactionIsolation</name>
+            <value>READ_UNCOMMITTED</value>
+          </property>
+        </otherProperties>
+      </configuration>
     </component>
   </components>
 </component-set>

Modified: maven/continuum/trunk/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/pom.xml?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-webapp/pom.xml (original)
+++ maven/continuum/trunk/continuum-webapp/pom.xml Wed Sep 27 06:54:43 2006
@@ -109,6 +109,7 @@
         <configuration>
           <scanIntervalSeconds>10</scanIntervalSeconds>
           <contextPath>/</contextPath>
+          <jettyEnvXml>src/jetty-env.xml</jettyEnvXml>
           <connectors>
             <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
               <port>9090</port>

Added: maven/continuum/trunk/continuum-webapp/src/jetty-env.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/jetty-env.xml?view=auto&rev=450440
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/jetty-env.xml (added)
+++ maven/continuum/trunk/continuum-webapp/src/jetty-env.xml Wed Sep 27 06:54:43 2006
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+
+<Configure class="org.mortbay.jetty.webapp.WebAppContext">
+
+<New id="continuum" class="org.mortbay.jetty.plus.naming.Resource">
+  <Arg>jdbc/continuum</Arg>
+  <Arg>
+    <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+      <Set name="DatabaseName">target/continuum_database</Set>
+      <Set name="user">sa</Set>
+      <Set name="createDatabase">create</Set>
+    </New>
+  </Arg>
+</New>
+<New id="continuum_shutdown" class="org.mortbay.jetty.plus.naming.Resource">
+  <Arg>jdbc/continuum_shutdown</Arg>
+  <Arg>
+    <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+      <Set name="DatabaseName">target/continuum_database</Set>
+      <Set name="user">sa</Set>
+      <Set name="shutdownDatabase">shutdown</Set>
+    </New>
+  </Arg>
+</New>
+<New id="users" class="org.mortbay.jetty.plus.naming.Resource">
+  <Arg>jdbc/users</Arg>
+  <Arg>
+    <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+      <Set name="DatabaseName">target/users_database</Set>
+      <Set name="user">sa</Set>
+      <Set name="createDatabase">create</Set>
+    </New>
+  </Arg>
+</New>
+<New id="users_shutdown" class="org.mortbay.jetty.plus.naming.Resource">
+  <Arg>jdbc/users_shutdown</Arg>
+  <Arg>
+    <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+      <Set name="DatabaseName">target/users_database</Set>
+      <Set name="user">sa</Set>
+      <Set name="shutdownDatabase">shutdown</Set>
+    </New>
+  </Arg>
+</New>
+
+</Configure>
+

Propchange: maven/continuum/trunk/continuum-webapp/src/jetty-env.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/jetty-env.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=450440&r1=450439&r2=450440
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
Wed Sep 27 06:54:43 2006
@@ -243,17 +243,60 @@
     <!-- TODO share db configuration between components -->
     <component>
       <role>org.codehaus.plexus.jdo.JdoFactory</role>
-      <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>
+      <role-hint>continuum</role-hint>
+      <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
       <configuration>
-        <!-- Database Configuration -->
-        <driverName>${db.driverName}</driverName>
-        <url>${db.url}</url>
-        <userName>${db.userName}</userName>
-        <password>${db.password}</password>
+
+        <connectionFactoryName>java:comp/env/jdbc/continuum</connectionFactoryName>
+        <shutdownConnectionFactoryName>java:comp/env/jdbc/continuum_shutdown</shutdownConnectionFactoryName>
+
+        <!-- JPOX and JDO configuration -->
         <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+        <otherProperties>
+          <property>
+            <name>org.jpox.autoCreateSchema</name>
+            <value>true</value>
+          </property>
+          <property>
+            <name>org.jpox.validateTables</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateColumns</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateConstraints</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanism</name>
+            <value>None</value>
+          </property>
+          <property>
+            <name>org.jpox.transactionIsolation</name>
+            <value>READ_UNCOMMITTED</value>
+          </property>
+          <property>
+            <name>org.jpox.poid.transactionIsolation</name>
+            <value>READ_UNCOMMITTED</value>
+          </property>
+        </otherProperties>
+      </configuration>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.jdo.JdoFactory</role>
+      <role-hint>projectserver</role-hint>
+      <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
+      <configuration>
+
+        <connectionFactoryName>java:comp/env/jdbc/users</connectionFactoryName>
+        <shutdownConnectionFactoryName>java:comp/env/jdbc/users_shutdown</shutdownConnectionFactoryName>
 
+        <!-- JPOX and JDO configuration -->
+        <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
         <otherProperties>
-          <!-- JPOX and JDO configuration -->
           <property>
             <name>org.jpox.autoCreateSchema</name>
             <value>true</value>
@@ -269,6 +312,10 @@
           <property>
             <name>org.jpox.validateConstraints</name>
             <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanism</name>
+            <value>None</value>
           </property>
           <property>
             <name>org.jpox.transactionIsolation</name>



Mime
View raw message