<?xml version="1.0"?>
+<!--
+ This is a prototype/template file for Nuxeo repository configuration files.
+ For each tenant that has their own repository specified in the CollectionSpace
+ tenant bindings file, we will create a corresponding Nuxeo repository config-
+ uration file. You won't have to change the value for most of these elements
+ and attributes because they will be set when CollectionSpace starts.
+
+ *** NOTE *** One value you may want to change is the 'binaryStore' path which is the location
+ that Nuxeo places binary files like images and PDF documents. Be sure to read the comment to
+ the right of the <binaryStore> element below.
+-->
+
+<!-- *** WARNING *** Don't manually change the values here unless you know exactly what you're doing. -->
+
+<!-- Values in the following elements are primarily added during execution -->
+<!-- of the 'ant deploy' command, within the Services source code tree. -->
+<!-- (Several values are also added during system startup, into repository-specific -->
+<!-- 'clones' of this prototype configuration file, as noted below.) -->
+
<component name="config:default-repository">
<extension target="org.nuxeo.ecm.core.repository.RepositoryService"
point="repository">
<repository name="default">
<pool minPoolSize="0" maxPoolSize="20"
blockingTimeoutMillis="100" idleTimeoutMinutes="10" />
- <clustering enabled="false" delay="1000" />
- <binaryStore path="" /> <!-- Should be parameterized. See CSPACE-6393 -->
- <!-- Values in the following elements are primarily added during execution -->
- <!-- of the 'ant deploy' command, within the Services source code tree. -->
- <!-- (Several values are also added during system startup, into repository-specific -->
- <!-- 'clones' of this prototype configuration file, as noted below.) -->
- <!-- The transactional datasource for Nuxeo -->
- <xa-datasource>@XA_DATASOURCE@</xa-datasource>
+ <clustering enabled="false" delay="1000" />
+ <binaryStore path="" /> <!-- Default value will be repository/database name. Can be partial or full system path. Partial path is relative to Nuxeo's data dir -->
+ <xa-datasource>@XA_DATASOURCE@</xa-datasource> <!-- The transactional datasource for Nuxeo -->
<!-- While the following element's value is primarily inserted during 'ant deploy' -->
<!-- the database name at the end of this JDBC URL is added during system startup. -->
<property name="URL">@DB_URL@</property>
}\r
if (repositoryNameList == null || repositoryNameList.isEmpty() == true) {\r
logger.warn(String.format("Could not get repository name(s) for tenant %s", tbt.getName()));\r
- continue;\r
+ continue; //break out of loop\r
} else {\r
for (String repositoryName : repositoryNameList) {\r
if (Tools.isBlank(repositoryName)) {\r
repositoryConfigDoc = (Document) prototypeConfigDoc.clone();\r
// Update this config file by inserting values pertinent to the\r
// current repository.\r
- repositoryConfigDoc = updateRepositoryConfigDoc(repositoryConfigDoc, repositoryName, this.getCspaceInstanceId());\r
+ String binaryStorePath = tbt.getBinaryStorePath();\r
+ repositoryConfigDoc = updateRepositoryConfigDoc(repositoryConfigDoc, repositoryName,\r
+ this.getCspaceInstanceId(), binaryStorePath);\r
if (logger.isTraceEnabled()) {\r
logger.trace("Updated Nuxeo repo config file contents=\n" + repositoryConfigDoc.asXML());\r
}\r
}\r
}\r
\r
- private Document updateRepositoryConfigDoc(Document repoConfigDoc, String repositoryName, String cspaceInstanceId) {\r
+ /*\r
+ * This method is filling out the proto-repo-config.xml file with tenant specific repository information.\r
+ */\r
+ private Document updateRepositoryConfigDoc(Document repoConfigDoc, String repositoryName,\r
+ String cspaceInstanceId, String binaryStorePath) {\r
String databaseName = JDBCTools.getDatabaseName(repositoryName, cspaceInstanceId);\r
\r
repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
REPOSITORY_EXTENSION_POINT_XPATH + "/repository", "name", repositoryName);\r
repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository", "name", repositoryName);\r
+ repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
+ REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/binaryStore", "path",\r
+ Tools.isBlank(binaryStorePath) ? repositoryName : binaryStorePath); // Can be either partial or full path. Partial path will be relative to Nuxeo's data directory\r
String url = XmlTools.getElementValue(repoConfigDoc,\r
REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/property[@name='URL']");\r
if (! Tools.isBlank(url)) {\r
URL blobUrl = new URL(theBlobUri);\r
File theBlobFile = null;\r
\r
- if (blobUrl.getProtocol().equalsIgnoreCase("http")) {\r
+ if (blobUrl.getProtocol().equalsIgnoreCase("http")) { //REM: Add support for https as well\r
Download fetchedFile = new Download(blobUrl);\r
if (logger.isDebugEnabled() == true) {\r
logger.debug("Starting blob download into temp file:" + fetchedFile.getFilePath());\r
</xs:annotation>
<xs:sequence>
<xs:element name="repositoryDomain" type="RepositoryDomainType" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="binaryStorePath" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="properties" type="types:PropertyType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="serviceBindings" type="service:ServiceBindingType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>