<?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>
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
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
// 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
// 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