]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-365: Deploy materials profile UI.
authorRay Lee <rhlee@berkeley.edu>
Mon, 1 Oct 2018 20:35:10 +0000 (13:35 -0700)
committerRay Lee <rhlee@berkeley.edu>
Mon, 1 Oct 2018 20:35:10 +0000 (13:35 -0700)
cspace-ui/build.xml
cspace-ui/cspace#materials/WEB-INF/web.xml [new file with mode: 0644]
cspace-ui/cspace#materials/index.html [new file with mode: 0644]

index 8a394507ca2332a5baaa41ce9ded310e7e52d2e3..4312fcaa063fd4f56ecac4908faddd1d9c44881e 100644 (file)
                <delete file="${jee.deploy.cspace.ui.shared}/${fcart.profile.plugin.js}" />
        </target>
 
+       <!--
+               Materials Authority Tenant
+       -->
+       <property name="materials.profile.plugin.tenantid" value="${cspace.profile.materials.default.id}" />
+       <property name="materials.profile.plugin.message.title" value="Default Materials Authority" />
+       <property name="materials.profile.plugin.logo" value="undefined" />
+       <property name="materials.profile.plugin.version" value="latest" />
+       <property name="materials.profile.plugin.name" value="cspaceUIPluginProfileMaterials" />
+       <property name="materials.profile.plugin.dir" value="cspace#materials" />
+       <property name="materials.profile.plugin.js" value="${materials.profile.plugin.name}@${materials.profile.plugin.version}.min.js" />
+       <property name="materials.profile.plugin.basename" value="/cspace/materials" />
+       
+       <target name="download_materials" unless="${env.CSPACE_MATERIALS_CREATE_DISABLED_OPT}">
+               <!-- Materials Authority Profile -->
+               <exec executable="curl"  failonerror="true">
+                       <arg line="-o ${materials.profile.plugin.js} --fail --insecure --remote-name --location https://unpkg.com/cspace-ui-plugin-profile-materials@${materials.profile.plugin.version}/dist/${materials.profile.plugin.name}.min.js"/>
+               </exec>
+       </target>
+       
+       <target name="deploy_materials" unless="${env.CSPACE_MATERIALS_CREATE_DISABLED_OPT}" depends="download_materials">
+               <!-- Materials Authority Profile -->
+               <filter token="UI_VERSION" value="${cspace.ui.version}" />
+               <filter token="PLUGIN_VERSION" value="${materials.profile.plugin.version}" />
+               <filter token="PLUGIN_BASENAME" value="${materials.profile.plugin.basename}" />
+               <filter token="TENANT_ID" value="${materials.profile.plugin.tenantid}" />
+               <filter token="MESSAGE_TITLE" value="${materials.profile.plugin.message.title}" />
+               <filter token="LOGO" value="${materials.profile.plugin.logo}" />
+               
+               <copy todir="${jee.deploy.cspace}/${materials.profile.plugin.dir}" filtering="true" overwrite="true">
+                       <fileset dir="${materials.profile.plugin.dir}"/>
+               </copy>
+               <move file="${materials.profile.plugin.js}" todir="${jee.deploy.cspace.ui.shared}"></move>
+       </target>
+       
+       <target name="undeploy_materials" description="undeploy collectionspace ui components from ${jee.server.cspace}">
+               <!-- Materials Authority Profile -->
+               <delete dir="${jee.deploy.cspace}/${materials.profile.plugin.dir}" />
+               <delete file="${jee.deploy.cspace.ui.shared}/${materials.profile.plugin.js}" />
+       </target>
+
        <!--
                General deploy target 
        -->             
                <antcall target="deploy_publicart" />
                <antcall target="deploy_anthro" />
                <antcall target="deploy_fcart" />
+               <antcall target="deploy_materials" />
        </target>
                
        <target name="deploy" depends="deploy_common, deploy_generic, deploy_others" description="deploy cspace ui to ${jee.server.cspace}">                            
        <!-- General undeploy target -->
 
        <target name="undeploy_others">
+               <antcall target="undeploy_materials" />
                <antcall target="undeploy_fcart" />
                <antcall target="undeploy_anthro" />
                <antcall target="undeploy_publicart" />
diff --git a/cspace-ui/cspace#materials/WEB-INF/web.xml b/cspace-ui/cspace#materials/WEB-INF/web.xml
new file mode 100644 (file)
index 0000000..3c1a184
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.0" metadata-complete="true">
+        <filter>
+                <filter-name>FallbackResourceFilter</filter-name>
+                <filter-class>org.collectionspace.services.common.filter.FallbackResourceFilter</filter-class>
+        </filter>
+        <filter-mapping>
+                <filter-name>FallbackResourceFilter</filter-name>
+                <url-pattern>/*</url-pattern>
+        </filter-mapping>
+        <filter>
+                <filter-name>ExpiresFilter</filter-name>
+                <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
+                <init-param>
+                        <param-name>ExpiresDefault</param-name>
+                        <param-value>access plus 2 hours</param-value>
+                </init-param>
+        </filter>
+        <filter-mapping>
+                <filter-name>ExpiresFilter</filter-name>
+                <url-pattern>/*</url-pattern>
+        </filter-mapping>
+</web-app>
diff --git a/cspace-ui/cspace#materials/index.html b/cspace-ui/cspace#materials/index.html
new file mode 100644 (file)
index 0000000..ee3a256
--- /dev/null
@@ -0,0 +1,26 @@
+<html>
+       <head>
+               <meta charset="UTF-8" />
+       </head>
+       <body>
+               <div id="cspace"></div>
+               <script src="/cspace-ui/cspaceUI@@UI_VERSION@.min.js"></script>
+               <script src="/cspace-ui/cspaceUIPluginProfileMaterials@@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: [
+                                       cspaceUIPluginProfileMaterials(),
+                               ],
+                       });
+               </script>
+       </body>
+</html>