From 6f56750bbc0ae428239a9dcb9999c5b1b868679a Mon Sep 17 00:00:00 2001 From: Matija Obreza Date: Thu, 26 Jul 2018 09:31:36 +0200 Subject: [PATCH] Export descriptor list as HTML - Imported missing templates --- .../freemarker/descriptorlist/booklet.ftl | 98 +++++++++++++++++++ src/main/resources/freemarker/html.ftl | 92 +++++++++++++++++ src/main/webapp/WEB-INF/sitemesh3.xml | 1 + 3 files changed, 191 insertions(+) create mode 100644 src/main/resources/freemarker/descriptorlist/booklet.ftl create mode 100644 src/main/resources/freemarker/html.ftl diff --git a/src/main/resources/freemarker/descriptorlist/booklet.ftl b/src/main/resources/freemarker/descriptorlist/booklet.ftl new file mode 100644 index 000000000..9ac3acf2d --- /dev/null +++ b/src/main/resources/freemarker/descriptorlist/booklet.ftl @@ -0,0 +1,98 @@ +<#macro isPublished published what> + <#if published> + + <#else> +
Note: This ${what} is not published.
<#lt> + + + + +<#assign vocabprinted = { "dummy":true } /> +<#macro printVocabulary vocabulary> + <#compress> + **Note:** This descriptor uses the **${vocabulary.title}** controlled vocabulary + <#if vocabulary.publisher??> + published by **${vocabulary.publisher}** + <#else> + maintained by **${vocabulary.owner.name}** + . + + + + + <#if vocabprinted[vocabulary.uuid]??> + <#else> + ${vocabulary.description!}<#lt> + <#assign vocabprinted = vocabprinted + { vocabulary.uuid:true } /> + + + + +<#macro printDescriptor descriptor> + # ${descriptor.title} <#if descriptor.uom??>[${descriptor.uom}]<#lt> + + <@isPublished published=descriptor.published what="descriptor" /> + + <#if descriptor.description??> + ${descriptor.description}<#lt> + <#else> + > No description.<#lt> + + + + <#list descriptor.terms> + <#compress> + |Code|Term|Description| + |---|---|---| + <#items as term> + |**${term.code}**|${term.title}|${term.description!}| + + + + + <#if descriptor.vocabulary??> + <@printVocabulary vocabulary=descriptor.vocabulary /> + + + +
+ ${descriptorList.title} <#lt> +
+ ${descriptorList.versionTag}
+ <#if descriptorList.publisher??> + **${descriptorList.publisher}** <#lt> + <#else> + ${descriptorList.owner.name} <#lt> + +
+
+ +${descriptorList.description!} + +<@isPublished published=descriptorList.published what="descriptor list" /> + + +Version: ${descriptorList.versionTag} <#lt> +<#if descriptorList.publisher??> +Published by: **${descriptorList.publisher}** <#lt> +<#else> +Maintained by: ${descriptorList.owner.name} <#lt> + +Last modified: ${descriptorList.lastModifiedDate?date} <#lt> +Date registered: ${descriptorList.createdDate?date} <#lt> +Record: ${descriptorList.uuid} v${descriptorList.version} <#lt> + + +<#list descriptorList.descriptors> + + <#items as descriptor> + + <@printDescriptor descriptor=descriptor /> + + + +<#else> + +> The descriptor list does not declare any descriptors. + + diff --git a/src/main/resources/freemarker/html.ftl b/src/main/resources/freemarker/html.ftl new file mode 100644 index 000000000..814f2a4bd --- /dev/null +++ b/src/main/resources/freemarker/html.ftl @@ -0,0 +1,92 @@ + + + + ${title} + + + + + + + +
+ For internal use only. Do not distribute. +
+ +${html} + + + + diff --git a/src/main/webapp/WEB-INF/sitemesh3.xml b/src/main/webapp/WEB-INF/sitemesh3.xml index 3a6b329d1..7c83a521f 100644 --- a/src/main/webapp/WEB-INF/sitemesh3.xml +++ b/src/main/webapp/WEB-INF/sitemesh3.xml @@ -23,6 +23,7 @@ text/html + -- GitLab