portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: r353879 - in /portals/pluto/trunk: pluto-optional-services/src/main/java/org/apache/pluto/optional/db/common/EmbeddedDataSourceManager.java pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
Date Sun, 04 Dec 2005 18:25:56 GMT
Author: ddewolf
Date: Sun Dec  4 10:25:41 2005
New Revision: 353879

URL: http://svn.apache.org/viewcvs?rev=353879&view=rev
Log:
Allowing DB connection string and sys home to be configurable

Modified:
    portals/pluto/trunk/pluto-optional-services/src/main/java/org/apache/pluto/optional/db/common/EmbeddedDataSourceManager.java
    portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml

Modified: portals/pluto/trunk/pluto-optional-services/src/main/java/org/apache/pluto/optional/db/common/EmbeddedDataSourceManager.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/pluto-optional-services/src/main/java/org/apache/pluto/optional/db/common/EmbeddedDataSourceManager.java?rev=353879&r1=353878&r2=353879&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-optional-services/src/main/java/org/apache/pluto/optional/db/common/EmbeddedDataSourceManager.java
(original)
+++ portals/pluto/trunk/pluto-optional-services/src/main/java/org/apache/pluto/optional/db/common/EmbeddedDataSourceManager.java
Sun Dec  4 10:25:41 2005
@@ -43,6 +43,13 @@
     private static final Log LOG =
             LogFactory.getLog(EmbeddedDataSourceManager.class);
 
+    private static final String DEFAULT_SYS_DIR =
+        System.getProperty("user.home") + "/.pluto/portal-driver/data";
+
+    private static final String DEFAULT_CONNECTION_STRING =
+        "databaseName=PLUTO_PORTAL_DRIVER;name=pluto_portal_driver;password=apachep0rtals;create=true";
+
+
     private String connectionString;
 
 //    private String shutdown =  "shutdownDatabase=true";
@@ -51,19 +58,14 @@
     private EmbeddedDataSource embeddedDataSource;
 
     public EmbeddedDataSourceManager() {
-        connectionString =
-            "databaseName=PLUTO_PORTAL_DRIVER;name=pluto_portal_driver;password=apachep0rtals;create=true";
+        this(DEFAULT_SYS_DIR, DEFAULT_CONNECTION_STRING);
+    }
 
-        String dbhome = System.getProperty("user.home") + "/.pluto/portal-driver/data";
-        
-        System.setProperty(
-            "derby.system.home", dbhome);
-        if (LOG.isDebugEnabled()) {
-        	LOG.debug("Derby database home (derby.system.home)=" + dbhome);
-        }
+    public EmbeddedDataSourceManager(String connectionString) {
+        this(DEFAULT_SYS_DIR, connectionString);
     }
 
-    public EmbeddedDataSourceManager(String connectionString, String systemDirectory) {
+    public EmbeddedDataSourceManager(String systemDirectory, String connectionString) {
         this.connectionString = connectionString;
         System.setProperty("derby.system.home", systemDirectory);
         if (LOG.isDebugEnabled()) {

Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml?rev=353879&r1=353878&r2=353879&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
(original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
Sun Dec  4 10:25:41 2005
@@ -94,6 +94,7 @@
     <bean id="DataSourceManager"
           class="org.apache.pluto.optional.db.common.EmbeddedDataSourceManager"
           singleton="true">
+        <constructor-arg><value>databaseName=PLUTO_PORTAL_DRIVER;name=pluto_portal_driver;password=apachep0rtals;create=true</value></constructor-arg>
     </bean>
 
     <!-- Uncomment to utilize a JNDI bound DataSource instead of



Mime
View raw message