]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-387: Added support for setting UI plugin properties 'logo' and 'tenantid'.
authorRichard Millet <remillet@yahoo.com>
Sat, 28 Apr 2018 21:18:59 +0000 (14:18 -0700)
committerRichard Millet <remillet@yahoo.com>
Sat, 28 Apr 2018 21:18:59 +0000 (14:18 -0700)
build.properties
cspace-ui/build.xml
cspace-ui/cspace#anthro/index.html
cspace-ui/cspace#core/index.html
cspace-ui/cspace#dvp/index.html
cspace-ui/cspace#publicart/index.html

index 4fb7d4c9fd518ee4a722cb764263a70b2608f9f7..f50d2a8a4b4afa1d2a0bd0fd1cf3a798ae3172ab 100644 (file)
@@ -6,6 +6,23 @@ host=127.0.0.1
 # The instance ID is blank by default. If it is added, by convention, 
 # instance IDs should begin with an underscore (_). E.g.: _trs80
 
+#
+# Default tenant ID's for profiles
+#
+cspace.profile.core.default.id=1
+cspace.profile.testsci.default.id=2
+cspace.profile.anthro.default.id=1500
+cspace.profile.publicart.default.id=5000
+cspace.profile.bonsai.default.id=3000
+cspace.profile.botgarden.default.id=3500
+cspace.profile.fcart.default.id=1000
+cspace.profile.herbarium.default.id=4000
+cspace.profile.lhmc.default.id=501
+cspace.profile.materials.default.id=2000
+
+#
+# Release version info
+#
 release.version=5.1
 cspace.release=${release.version}-SNAPSHOT
 cspace.instance.id=${env.CSPACE_INSTANCE_ID}
@@ -16,15 +33,17 @@ cspace.services.context=${domain.cspace}
 cspace.services.war=${cspace.services.context}.war
 domain.nuxeo=nuxeo-server
 
-# CSpace UI
+# CSpace UI plugin defaults
 cspace.ui.dest=
+cspace.ui.tenantid=1
+cspace.ui.logo=undefined
+cspace.ui.message.title=CollectionSpace Default Profile
 cspace.ui.version=latest
 cspace.ui.basename=/cspace/core
 cspace.ui.webapp=cspace#core
 cspace.ui.webapp.name=cspaceUI
 cspace.ui.js=${cspace.ui.webapp.name}@${cspace.ui.version}.min.js
 
-
 #nuxeo
 nuxeo.release=7.10-HF17
 nuxeo.ear=nuxeo.ear
index f91bfdfdaba81a9cad12629644d1efef28efe302..316a87ee888a4bc8b2dd3febbed7c314b5e46d2a 100644 (file)
        <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>
index 25573678aee4433e036443d1b1efc42a006124fa..e6464aeccc852c12b802d4147e5dca1cf763333d 100644 (file)
@@ -8,6 +8,13 @@
                <script src="/cspace-ui/cspaceUIPluginProfileAnthro@@PLUGIN_VERSION@.min.js"></script>
                <script>
                        cspaceUI({
+                               tenantid: '@TENANT_ID@',
+                               // No quotes for logo value.  Use "undefined" (no quotes) for default logo
+                               logo: @LOGO@,
+                               messages: {
+                               // Override the login page title
+                                       'about.title': '@MESSAGE_TITLE@',
+                               },
                                basename: '@PLUGIN_BASENAME@',
                                prettyUrls: true,
                                plugins: [
index dbc009f2d7ec878a5c67f74018410b177dcefd13..cf2ecf7139b5f6f6b706836419f1cb78fe40ecbd 100644 (file)
@@ -7,6 +7,13 @@
                <script src="/cspace-ui/cspaceUI@@UI_VERSION@.min.js"></script>
                <script>
                        cspaceUI({
+                               tenantid: '@TENANT_ID@',
+                               // No quotes for logo value.  Use "undefined" (no quotes) for default logo
+                               logo: @LOGO@,
+                               messages: {
+                               // Override the login page title
+                                       'about.title': '@MESSAGE_TITLE@',
+                               },
                                basename: '@PLUGIN_BASENAME@',
                                prettyUrls: true,
                        });
index d394d7d62d379daad978de069da6035d9651f240..c0bfccaee5db23b35ec5d4dcc6eb09d566f696e5 100644 (file)
@@ -8,6 +8,13 @@
                <script src="/cspace-ui/cspaceUIPluginProfileDartmouthVietnamProject@@PLUGIN_VERSION@.min.js"></script>
                <script>
                        cspaceUI({
+                               tenantid: '@TENANT_ID@',
+                               // No quotes for logo value.  Use "undefined" (no quotes) for default logo
+                               logo: @LOGO@,
+                               messages: {
+                               // Override the login page title
+                                       'about.title': '@MESSAGE_TITLE@',
+                               },
                                basename: '@PLUGIN_BASENAME@',
                                prettyUrls: true,
                                plugins: [
index 562f52446e179da5301b4104843925fad7b6779d..29c2b861d8a6950c89bc0bc096f3bd520fec1c7c 100644 (file)
@@ -8,6 +8,13 @@
                <script src="/cspace-ui/cspaceUIPluginProfilePublicArt@@PLUGIN_VERSION@.min.js"></script>
                <script>
                        cspaceUI({
+                               tenantid: '@TENANT_ID@',
+                               // No quotes for logo value.  Use "undefined" (no quotes) for default logo
+                               logo: @LOGO@,
+                               messages: {
+                               // Override the login page title
+                                       'about.title': '@MESSAGE_TITLE@',
+                               },
                                basename: '@PLUGIN_BASENAME@',
                                prettyUrls: true,
                                plugins: [