<condition property="osfamily-windows">
<os family="windows" />
</condition>
-
- <!--
- Profile version numbers
- -->
- <property name="publicart.profile.plugin.version" value="latest" />
- <property name="publicart.profile.plugin.name" value="cspaceUIPluginProfilePublicArt" />
- <property name="publicart.profile.plugin.dir" value="cspace#publicart" />
- <property name="publicart.profile.plugin.js" value="${publicart.profile.plugin.name}@${publicart.profile.plugin.version}.min.js" />
- <property name="publicart.profile.plugin.basename" value="/cspace/publicart" />
-
- <property name="anthro.profile.plugin.version" value="latest" />
- <property name="anthro.profile.plugin.name" value="cspaceUIPluginProfileAnthro" />
- <property name="anthro.profile.plugin.dir" value="cspace#anthro" />
- <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="package" depends="deploy">
</target>
-
+
+ <!--
+ Set all the values for a single/primary tenant deployment
+ -->
<target name="set_primary" if="${env.CSPACE_PRIMARY_UIPLUGIN}">
<echo>Setting primary vars</echo>
<property name="primary.profile.plugin.name" value="${env.CSPACE_PRIMARY_UIPLUGIN_NAME}" />
<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.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}" />
+
+ <!-- Set the logo URL value base on the env var CSPACE_PRIMARY_UIPLUGIN_LOGO value.
+ #
+ # Use empty string or "undefined" for default logo, a full URL to an image file, or a partial URL path to a local image resource
+ # Ex #1:
+ # export CSPACE_PRIMARY_UIPLUGIN_LOGO=""
+ # Ex #2
+ # export CSPACE_PRIMARY_UIPLUGIN_LOGO="http://mydomain.com/myimage.png"
+ # Ex #3
+ # export CSPACE_PRIMARY_UIPLUGIN_LOGO="/images/myimage.png"
+ #
+ -->
+ <condition property="primary.profile.plugin.logo" value="undefined">
+ <matches pattern="^undefined$" string="${env.CSPACE_PRIMARY_UIPLUGIN_LOGO}"/>
+ </condition>
+ <condition property="primary.profile.plugin.logo" value="undefined">
+ <matches pattern="^$" string="${env.CSPACE_PRIMARY_UIPLUGIN_LOGO}"/>
+ </condition>
+ <condition property="primary.profile.plugin.logo" value="'${env.CSPACE_PRIMARY_UIPLUGIN_LOGO}'">
+ <matches pattern="^(?!\s*$).+" string="${env.CSPACE_PRIMARY_UIPLUGIN_LOGO}"/>
+ </condition>
</target>
<!--
<target name="deploy_primary" depends="download_primary" if="${env.CSPACE_PRIMARY_UIPLUGIN}" description="deploy cspace ui to ${jee.server.cspace}">
<filter token="PLUGIN_VERSION" value="${primary.profile.plugin.version}" />
<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}"/>
</copy>
<delete file="${jee.deploy.cspace.ui.shared}/${primary.profile.plugin.js}" />
</target>
+ <!--
+ Common UI components
+ -->
+ <target name="download_common">
+ <!-- Core UI -->
+ <exec executable="curl" failonerror="true">
+ <arg line="-o ${cspace.ui.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui@${cspace.ui.version}/dist/${cspace.ui.webapp.name}.min.js"/>
+ </exec>
+ </target>
+
+ <target name="deploy_common" depends="download_common">
+ <move file="${cspace.ui.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
+ </target>
+
+ <target name="undeploy_common" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ <!-- Core webapp -->
+ <delete file="${jee.deploy.cspace.ui.shared}/${cspace.ui.js}" />
+ </target>
+
<!--
Core UI components
-->
<!-- 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="MESSAGE_TITLE" value="${cspace.ui.message.title}" />
+ <filter token="LOGO" value="${cspace.ui.logo}" />
+
<copy todir="${jee.deploy.cspace}/${cspace.ui.webapp}" filtering="true" overwrite="true">
<fileset dir="${cspace.ui.webapp}"/>
</copy>
<target name="undeploy_core" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- Core webapp -->
- <delete dir="${jee.deploy.cspace}/${cspace.ui.webapp}" />
- <delete file="${jee.deploy.cspace.ui.shared}/${cspace.ui.js}" />
- </target>
+ <delete dir="${jee.deploy.cspace}/${cspace.ui.webapp}" />
+ <delete file="${jee.deploy.cspace.ui.shared}/${cspace.ui.js}" />
+ </target>
<!--
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" />
+ <property name="publicart.profile.plugin.name" value="cspaceUIPluginProfilePublicArt" />
+ <property name="publicart.profile.plugin.dir" value="cspace#publicart" />
+ <property name="publicart.profile.plugin.js" value="${publicart.profile.plugin.name}@${publicart.profile.plugin.version}.min.js" />
+ <property name="publicart.profile.plugin.basename" value="/cspace/publicart" />
+ <!-- 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">
<filter token="UI_VERSION" value="${cspace.ui.version}" />
<filter token="PLUGIN_VERSION" value="${publicart.profile.plugin.version}" />
<filter token="PLUGIN_BASENAME" value="${publicart.profile.plugin.basename}" />
+ <filter token="TENANT_ID" value="${publicart.profile.plugin.tenantid}" />
+ <filter token="MESSAGE_TITLE" value="${publicart.profile.plugin.message.title}" />
+ <filter token="LOGO" value="${publicart.profile.plugin.logo}" />
+
<copy todir="${jee.deploy.cspace}/${publicart.profile.plugin.dir}" filtering="true" overwrite="true">
<fileset dir="${publicart.profile.plugin.dir}"/>
</copy>
<move file="${publicart.profile.plugin.name}@${publicart.profile.plugin.version}.min.js" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
- <target name="undeploy_publicart" unless="${env.CSPACE_PUBLICART_CREATE_DISABLED_OPT}" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ <target name="undeploy_publicart" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- Public Art Profile -->
<delete dir="${jee.deploy.cspace}/${publicart.profile.plugin.dir}" />
<delete file="${jee.deploy.cspace.ui.shared}/${publicart.profile.plugin.js}" />
<!--
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.logo" value="undefined" />
+ <property name="anthro.profile.plugin.version" value="latest" />
+ <property name="anthro.profile.plugin.name" value="cspaceUIPluginProfileAnthro" />
+ <property name="anthro.profile.plugin.dir" value="cspace#anthro" />
+ <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">
<move file="${anthro.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
</target>
- <target name="undeploy_anthro" unless="${env.CSPACE_ANTHRO_CREATE_DISABLED_OPT}" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ <target name="undeploy_anthro" description="undeploy collectionspace ui components from ${jee.server.cspace}">
<!-- Anthropology Profile -->
<delete dir="${jee.deploy.cspace}/${anthro.profile.plugin.dir}" />
<delete file="${jee.deploy.cspace.ui.shared}/${anthro.profile.plugin.js}" />
<!-- General deploy target -->
<target name="deploy_others" unless="${env.CSPACE_PRIMARY_UIPLUGIN}">
+ <antcall target="deploy_common" />
+ <antcall target="deploy_core" />
<antcall target="deploy_publicart" />
<antcall target="deploy_anthro" />
</target>
- <target name="deploy" depends="deploy_core, deploy_primary, deploy_others" description="deploy cspace ui to ${jee.server.cspace}">
+ <target name="deploy" depends="deploy_common, deploy_primary, deploy_others" description="deploy cspace ui to ${jee.server.cspace}">
<!-- Trigger dependencies -->
</target>
<!-- General undeploy target -->
- <target name="undeploy_others" unless="${env.CSPACE_PRIMARY_UIPLUGIN}">
+ <target name="undeploy_others">
<antcall target="undeploy_publicart" />
<antcall target="undeploy_anthro" />
+ <antcall target="undeploy_core" />
+ <antcall target="undeploy_common" />
</target>
- <target name="undeploy" depends="undeploy_core, undeploy_primary, undeploy_others" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+ <target name="undeploy" depends="undeploy_common, undeploy_primary, undeploy_others" description="undeploy collectionspace ui components from ${jee.server.cspace}">
</target>
</project>