<!-- set global properties for this build -->
<property name="services.trunk" value=".."/>
- <!-- enviornment should be declared before reading build.properties -->
+
+ <!-- Enviornment should be declared before reading build.properties -->
<property environment="env" />
<property file="${services.trunk}/build.properties" />
+ <!--
+ Properties set in this file will override all corresponding <property> definitions
+ made in this Ant file.
+ -->
+ <property file="${jee.server.cspace}/primary.tenant.properties" />
+ <property name="primary.profile.plugin.enabled" value="${env.CSPACE_PRIMARY_UIPLUGIN}"/>
+
+ <!--
+ #
+ # Default tenant ID's for profiles - You can override these values in the "primary.tenant.properties" file at
+ # the top-level directory of the tomcat deployment location.
+ #
+ -->
+ <property name="cspace.profile.core.default.id" value="1"/>
+ <property name="cspace.profile.testsci.default.id" value="2"/>
+ <property name="cspace.profile.anthro.default.id" value="1500"/>
+ <property name="cspace.profile.publicart.default.id" value="5000"/>
+ <property name="cspace.profile.bonsai.default.id" value="3000"/>
+ <property name="cspace.profile.botgarden.default.id" value="3500"/>
+ <property name="cspace.profile.fcart.default.id" value="1000"/>
+ <property name="cspace.profile.herbarium.default.id" value="4000"/>
+ <property name="cspace.profile.lhmc.default.id" value="501"/>
+ <property name="cspace.profile.materials.default.id" value="2000"/>
+
<condition property="osfamily-unix">
<os family="unix" />
</condition>
<!--
Set all the values for a single/primary tenant deployment
-->
- <target name="set_primary" if="${env.CSPACE_PRIMARY_UIPLUGIN}">
+ <target name="set_primary" if="${primary.profile.plugin.enabled}">
<echo>Setting primary vars</echo>
+ <echo>The value of primary.profile.plugin.name is ${primary.profile.plugin.name}</echo>
<property name="primary.profile.plugin.name" value="${env.CSPACE_PRIMARY_UIPLUGIN_NAME}" />
+ <!--
+ <condition property="primary.profile.plugin.name" value="${env.CSPACE_PRIMARY_UIPLUGIN_NAME}">
+ <not>
+ <isset property="primary.profile.plugin.name"/>
+ </not>
+ </condition>
+ -->
+ <echo>The value of primary.profile.plugin.name is ${primary.profile.plugin.name}</echo>
+
+
<property name="primary.profile.plugin.version" value="${env.CSPACE_PRIMARY_UIPLUGIN_VERSION}" />
<property name="primary.profile.plugin.package" value="${env.CSPACE_PRIMARY_UIPLUGIN_PACKAGE}" />
<property name="primary.profile.plugin.dir" value="${env.CSPACE_PRIMARY_UIPLUGIN_DIR}" />
- <property name="primary.profile.plugin.js" value="${primary.profile.plugin.name}@${primary.profile.plugin.version}.min.js" />
<property name="primary.profile.plugin.basename" value="${env.CSPACE_PRIMARY_UIPLUGIN_BASENAME}" />
<property name="primary.profile.plugin.tenantid" value="${env.CSPACE_PRIMARY_UIPLUGIN_TENANTID}" />
<property name="primary.profile.plugin.message.title" value="${env.CSPACE_PRIMARY_UIPLUGIN_TITLE_MESSAGE}" />
+ <!-- Derived from the other props -->
+ <property name="primary.profile.plugin.js" value="${primary.profile.plugin.name}@${primary.profile.plugin.version}.min.js" />
<!-- Set the logo URL value base on the env var CSPACE_PRIMARY_UIPLUGIN_LOGO value.
#
</condition>
<condition property="primary.profile.plugin.logo" value="'${env.CSPACE_PRIMARY_UIPLUGIN_LOGO}'">
<matches pattern="^(?!\s*$).+" string="${env.CSPACE_PRIMARY_UIPLUGIN_LOGO}"/>
- </condition>
+ </condition>
+
+ <!-- Test to see if "core" tenant is being asked for, since we'll need to do something special for it. -->
+ <condition property="is.primary.core" value="true">
+ <matches pattern="^cspaceUI$" string="${primary.profile.plugin.name}"/>
+ </condition>
</target>
<!--
- Primary tenant
+ Since "core" is a special tenant, we need to do a special check
+ -->
+ <target name="deploy_core_as_generic" if="${is.primary.core}">
+ <antcall target="deploy_core" />
+ </target>
+
+ <!--
+ Since "core" is a special tenant, we need to do a special check
+ -->
+ <target name="deploy_other_as_generic" unless="${is.primary.core}">
+ <antcall target="deploy_primary" />
+ </target>
+
+ <target name="deploy_generic" depends="set_primary">
+ <antcall target="deploy_core_as_generic" />
+ <antcall target="deploy_other_as_generic" />
+ </target>
+
+ <!--
+ Primary tenant - Use the props to decide what tenant plugin to deploy
-->
- <target name="download_primary" depends="set_primary" if="${env.CSPACE_PRIMARY_UIPLUGIN}">
+ <target name="download_primary" if="${primary.profile.plugin.enabled}">
<!-- Default primary tenant -->
+ <echo>-o ${primary.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/${primary.profile.plugin.package}@${primary.profile.plugin.version}/dist/${primary.profile.plugin.name}.min.js</echo>
<exec executable="curl" failonerror="true">
<arg line="-o ${primary.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/${primary.profile.plugin.package}@${primary.profile.plugin.version}/dist/${primary.profile.plugin.name}.min.js"/>
</exec>
- </target>
+ </target>
- <target name="deploy_primary" depends="download_primary" if="${env.CSPACE_PRIMARY_UIPLUGIN}" description="deploy cspace ui to ${jee.server.cspace}">
+ <target name="deploy_primary" depends="download_primary" if="${primary.profile.plugin.enabled}" description="deploy cspace ui to ${jee.server.cspace}">
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="PLUGIN_VERSION" value="${primary.profile.plugin.version}" />
+ <filter token="PLUGIN_NAME" value="${primary.profile.plugin.name}" />
<filter token="PLUGIN_BASENAME" value="${primary.profile.plugin.basename}" />
<filter token="TENANT_ID" value="${primary.profile.plugin.tenantid}" />
<filter token="MESSAGE_TITLE" value="${primary.profile.plugin.message.title}" />
<filter token="LOGO" value="${primary.profile.plugin.logo}" />
<copy todir="${jee.deploy.cspace}/${primary.profile.plugin.dir}" filtering="true" overwrite="true">
- <fileset dir="${primary.profile.plugin.dir}"/>
+ <fileset dir="cspace#template"/>
</copy>
<move file="${primary.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
- <target name="undeploy_primary" if="${env.CSPACE_PRIMARY_UIPLUGIN}" depends="set_primary" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ <target name="undeploy_primary" if="${primary.profile.plugin.enabled}" depends="set_primary" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<delete dir="${jee.deploy.cspace}/${primary.profile.plugin.dir}" />
<delete file="${jee.deploy.cspace.ui.shared}/${primary.profile.plugin.js}" />
</target>
</target>
<target name="deploy_core" depends="download_core" unless="${env.CSPACE_CORE_CREATE_DISABLED_OPT}">
+ <property name="cspace.profile.core.default.id" value="${cspace.ui.tenantid}" />
+ <condition property="cspace.profile.core.default.id" value="1234">
+ <not>
+ <isset property="cspace.profile.core.default.id"/>
+ </not>
+ </condition>
+
<!-- Core UI Webapp-->
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="PLUGIN_BASENAME" value="${cspace.ui.basename}" />
- <filter token="TENANT_ID" value="${cspace.ui.tenantid}" />
+ <filter token="TENANT_ID" value="${cspace.profile.core.default.id}" />
<filter token="MESSAGE_TITLE" value="${cspace.ui.message.title}" />
<filter token="LOGO" value="${cspace.ui.logo}" />
<!--
Public Art Tenant
-->
-
<property name="publicart.profile.plugin.tenantid" value="${cspace.profile.publicart.default.id}" />
<property name="publicart.profile.plugin.message.title" value="Default Public Art Profile Tenant" />
<property name="publicart.profile.plugin.version" value="latest" />
<!-- Use a value of "undefined" to use the default logo -->
<property name="publicart.profile.plugin.logo" value="undefined" />
-
<target name="download_publicart" unless="${env.CSPACE_PUBLICART_CREATE_DISABLED_OPT}">
<!-- Public Art Profile -->
<exec executable="curl" failonerror="true">
<!--
Anthropology Tenant
-->
-
<property name="anthro.profile.plugin.tenantid" value="${cspace.profile.anthro.default.id}" />
- <property name="anthro.profile.plugin.message.title" value="Default Anthropology Profile Tenant" />
+ <property name="anthro.profile.plugin.message.title" value="Default Anthropology Profile" />
<property name="anthro.profile.plugin.logo" value="undefined" />
<property name="anthro.profile.plugin.version" value="latest" />
<property name="anthro.profile.plugin.name" value="cspaceUIPluginProfileAnthro" />
<property name="anthro.profile.plugin.js" value="${anthro.profile.plugin.name}@${anthro.profile.plugin.version}.min.js" />
<property name="anthro.profile.plugin.basename" value="/cspace/anthro" />
-
<target name="download_anthro" unless="${env.CSPACE_ANTHRO_CREATE_DISABLED_OPT}">
<!-- Anthropology Profile -->
<exec executable="curl" failonerror="true">
<delete file="${jee.deploy.cspace.ui.shared}/${anthro.profile.plugin.js}" />
</target>
- <!-- General deploy target -->
-
- <target name="deploy_others" unless="${env.CSPACE_PRIMARY_UIPLUGIN}">
+ <!--
+ General deploy target
+ -->
+ <target name="deploy_others" unless="${primary.profile.plugin.enabled}">
<antcall target="deploy_common" />
<antcall target="deploy_core" />
<antcall target="deploy_publicart" />
<antcall target="deploy_anthro" />
</target>
- <target name="deploy" depends="deploy_common, deploy_primary, deploy_others" description="deploy cspace ui to ${jee.server.cspace}">
+ <target name="deploy" depends="deploy_common, deploy_generic, deploy_others" description="deploy cspace ui to ${jee.server.cspace}">
<!-- Trigger dependencies -->
</target>