]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5761 Fixed problems that emerged after the merge, including the naming of...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 14 Dec 2012 23:15:20 +0000 (15:15 -0800)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 14 Dec 2012 23:15:20 +0000 (15:15 -0800)
3rdparty/nuxeo/nuxeo-server/5.5-HF07/config/lifesci_domain-repo-config.xml [moved from 3rdparty/nuxeo/nuxeo-server/5.5-HF07/config/lifesci-domain-repo-config.xml with 98% similarity]
services/common/src/main/cspace/config/services/tenants/lifesci/tenant-bindings.delta.xml
services/common/src/main/java/org/collectionspace/services/common/ServiceMain.java
src/main/resources/db/postgresql/init_nuxeo_db.sql

similarity index 98%
rename from 3rdparty/nuxeo/nuxeo-server/5.5-HF07/config/lifesci-domain-repo-config.xml
rename to 3rdparty/nuxeo/nuxeo-server/5.5-HF07/config/lifesci_domain-repo-config.xml
index 279075a40f1f2e0e195c7dbbff10673533cb1a85..d8cf0821013d3761212dc772e28b76f91f071ed7 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0"?>
-<component name="config:lifesci-domain-repository">
+<component name="config:lifesci_domain-repository">
        <extension target="org.nuxeo.ecm.core.repository.RepositoryService"
                point="repository">
-               <repository name="lifesci-domain"
+               <repository name="lifesci_domain"
                        factory="org.nuxeo.ecm.core.storage.sql.ra.PoolingRepositoryFactory">
-                       <repository name="lifesci-domain">
+                       <repository name="lifesci_domain">
                        <clustering enabled="false" delay="1000" />
                        <binaryStore path="" />
                                <!-- The transactional datasource for Nuxeo -->
                                <xa-datasource>@XA_DATASOURCE@</xa-datasource>                          
-                               <property name="URL">jdbc:postgresql://localhost:5432/lifesci-domain</property>
+                               <property name="URL">jdbc:postgresql://localhost:5432/lifesci_domain</property>
                                <property name="ServerName">@DB_SERVER_HOSTNAME@</property>                             
-                               <property name="DatabaseName">lifesci-domain</property>
+                               <property name="DatabaseName">lifesci_domain</property>
                                <property name="User">@NUXEO_USER@</property>
                                <property name="Password">@NUXEO_PW@</property>
 
 
        <extension target="org.nuxeo.ecm.core.api.repository.RepositoryManager"
                point="repositories">
-               <documentation>The lifesci-domain repository</documentation>
-               <repository name="lifesci-domain" label="Default Repository" />
+               <documentation>The lifesci_domain repository</documentation>
+               <repository name="lifesci_domain" label="Default Repository" />
        </extension>
 </component>
index 2a972b97ae15178d57d04a0c99b376df4aa02804..1beb3f4b035adad470027bb50a5bc8dec9e403f7 100644 (file)
@@ -5,7 +5,7 @@
                 
   <tenant:tenantBinding id="2" name="lifesci.collectionspace.org" displayName="Life Sciences/Natural History Demo Tenant" version="0.1">
 
-    <tenant:repositoryDomain name="default-domain" storageName="lifesci-domain" repositoryName="lifesci-domain" repositoryClient="nuxeo-java" />
+    <tenant:repositoryDomain name="default-domain" storageName="lifesci_domain" repositoryName="lifesci_domain" repositoryClient="nuxeo-java" />
        
        <tenant:serviceBindings merge:matcher="id" id="CollectionObjects">
     <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
index cdea33f53e5b30331e76ded651799365019fb181..466e969cfe74a3fa9b30ba64d362ffaeae02cdb8 100644 (file)
@@ -7,6 +7,11 @@ import java.io.File;
 import java.io.FileInputStream;\r
 import java.io.FileNotFoundException;\r
 import java.io.InputStream;\r
+import java.sql.Connection;\r
+import java.sql.PreparedStatement;\r
+import java.sql.ResultSet;\r
+import java.sql.SQLException;\r
+import java.sql.Statement;\r
 import java.util.*;\r
 \r
 import javax.naming.NamingException;\r
@@ -23,6 +28,7 @@ import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
 import org.collectionspace.services.common.init.AddIndices;\r
 import org.collectionspace.services.config.service.InitHandler.Params.Field;\r
 import org.collectionspace.services.common.init.IInitHandler;\r
+import org.collectionspace.services.common.storage.DatabaseProductType;\r
 import org.collectionspace.services.common.storage.JDBCTools;\r
 import org.collectionspace.services.config.ClientType;\r
 import org.collectionspace.services.config.ServiceConfig;\r
@@ -399,7 +405,9 @@ public class ServiceMain {
        // Get the NuxeoDS info and create the necessary databases.\r
        // Consider the tenant bindings to find and get the data sources for each tenant.\r
        // There may be only one, one per tenant, or something in between.\r
-       DatabaseProductType dbType = JDBCTools.getDatabaseProductType(); // only returns PG or MYSQL\r
+       DatabaseProductType dbType = JDBCTools.getDatabaseProductType(\r
+                       JDBCTools.CSPACE_DATASOURCE_NAME,\r
+                       JDBCTools.DEFAULT_CSPACE_DATABASE_NAME); // only returns PG or MYSQL\r
        String dbExistsQuery = (dbType==DatabaseProductType.POSTGRESQL)?\r
                                                                DB_EXISTS_QUERY_PSQL : DB_EXISTS_QUERY_MYSQL;\r
 \r
@@ -538,7 +546,7 @@ public class ServiceMain {
                        // Postgres does not need passwords.\r
                        String sql = "CREATE DATABASE "+dbName+" ENCODING 'UTF8' OWNER "+ownerName;\r
                        stmt.executeUpdate(sql);\r
-                       sql = "GRANT CONNECT ON DATABASE nuxeo TO "+readerName;\r
+                       sql = "GRANT CONNECT ON DATABASE "+dbName+" TO "+readerName;\r
                        stmt.executeUpdate(sql);\r
                        if (logger.isDebugEnabled()) {\r
                                logger.debug("Created db: '"+dbName+"' with owner: '"+ownerName+"'");\r
index c0b999c17b275cb7b49338c95449b23a29a9cb5d..7120ad23b0bc0661813708aa7680a50d6e1b8e09 100644 (file)
@@ -1,5 +1,6 @@
 -- drop all the objects before dropping roles
 DROP database IF EXISTS nuxeo;
+DROP database IF EXISTS lifesci_domain;
 
 DROP USER IF EXISTS nuxeo;
 DROP USER IF EXISTS reader;