#db.jdbc.urloptions.encoded=ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory&foo=true
#
-# By default, as placeholders, we'll supply meaningless JDBC options -both encoded and non-encode forms.
+# Use the JDBC_URL_OPTS env var to set the urloptions for the jdbc connection string
+# The db.jdbc.urloptions.encoded needs to be created in each ant target which uses it by calling the
+# urlencode scriptdef. We can still reference it below as it will be added at runtime.
#
-db.jdbc.urloptions=foo=true&bar=false
-db.jdbc.urloptions.encoded=foo=true&bar=false
+db.jdbc.urloptions=${env.JDBC_URL_OPTS}
#
# JDBC urls that CollectionSpace needs to talk to the "admin" database, Nuxeo databases, and the "cspace" database (i.e., the AuthN/AuthZ database)
<os family="windows" />
</condition>
+ <scriptdef name="urlencode" language="javascript">
+ <attribute name="property"/>
+ <![CDATA[
+ var value = self.project.getProperty(attributes.get("property"));
+ var encoded = encodeURIComponent(value);
+ self.project.setProperty(attributes.get("property") + ".encoded", encoded)
+ ]]>
+ </scriptdef>
+
<target name="init">
<!-- Create the time stamp -->
<tstamp />
</target>
<!--
- This target sends the 'create_nuxeo_db' and 'create_nuxeo_db' targets to all the Ant sub-modules/directories
- and creates some database utility functions
+ This target calls the 'create_nuxeo_db' and 'create_cspace_db' targets and creates some database utility functions
-->
<target name="-create_db" depends="-validate_create_db_unix, -validate_create_db_windows">
+ <urlencode property="db.jdbc.urloptions" />
<antcall target="create_nuxeo_db" />
<antcall target="create_cspace_db" />
<antcall target="create_update_userid_db_function" />
</target>
<target name="import" description="import default configuration">
+ <urlencode property="db.jdbc.urloptions" />
<ant antfile="services/build.xml" target="import" inheritAll="false" />
</target>
</description>
<!-- set global properties for this build -->
<property name="services.trunk" value="../.."/>
+ <import file="${services.trunk}/build.xml" />
<!-- enviornment should be declared before reading build.properties -->
<property environment="env" />
<property file="${services.trunk}/build.properties" />
- <property name="application.trunk" location="${services.trunk}/../application" />
- <property name="cspace.tool.csmake" value="csmake" />
+ <property name="application.trunk" location="${services.trunk}/../application" />
+ <property name="cspace.tool.csmake" value="csmake" />
<property name="mvn.opts" value="-V" />
<property name="src" location="src"/>
<target name="package" depends="package-unix,package-windows"
description="Package CollectionSpace Services" />
+ <urlencode property="db.jdbc.urloptions" />
<target name="package-unix" if="osfamily-unix">
<exec executable="mvn" failonerror="true">
<arg value="package" />
<arg value="-Dmaven.test.skip=true" />
+ <arg value="-Ddb.jdbc.urloptions.encoded=${db.jdbc.urloptions.encoded}" />
<arg value="-f" />
<arg value="${basedir}/pom.xml" />
<arg value="-N" />
<delete dir="${jee.deploy.cspace}/${cspace.services.context}"/>
<copy file="${basedir}/target/${cspace.services.war}" todir="${jee.deploy.cspace}"/>
</target>
-
+
<!--
This target attempts to generate a set of Service artifacts (Nuxeo bundles and tenant bindings) by using the
Application layer's configuration files.
-
+
This target has a dependency on the Application layer's source tree. It assumes the Application layer's src tree root
is a directory sibling of the Source layer's source tree root. Also, it assumes the "csmake.jar" exists in the target
directory of the Application layer's "tomcat-main" module.
-
+
This target also assumes that the system environment variable 'CSPACE_JEESERVER_HOME' is set and pointing to the root
JEE server (usually Apache Tomcat) where CollectionSpace is installed. All generated Service artifacts wi
-->
<class>org.collectionspace.services.account.Status</class>
<properties>
<property name="hibernate.ejb.cfgfile" value="hibernate.cfg.xml"/>
-
- <!--property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
- <property name="hibernate.max_fetch_depth" value="3"/>
- <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
- <property name="hibernate.connection.username" value="test"/>
- <property name="hibernate.connection.password" value="test"/>
- <property name="hibernate.connection.url" value="${db.jdbc.cspace.url.encoded}"/-->
</properties>
</persistence-unit>
</persistence>