diff --git a/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-dataDefault.ftl b/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-dataDefault.ftl deleted file mode 100644 index 9806cb28..00000000 --- a/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-dataDefault.ftl +++ /dev/null @@ -1,108 +0,0 @@ -<#-- $This file is distributed under the terms of the license in LICENSE$ --> - -<#-- VIVO-specific default data property statement template. - - This template must be self-contained and not rely on other variables set for the individual page, because it - is also used to generate the property statement during a deletion. - --> -<#import "lib-datetime.ftl" as dt> -<#import "lib-meta-tags.ftl" as lmt> -<#if property.rangeDatatypeURI?? && property.rangeDatatypeURI?contains("#")> - <#assign datatype = property.rangeDatatypeURI?substring(property.rangeDatatypeURI?last_index_of("#")+1) /> -<#else> - <#assign datatype = "none" /> -#if> -<@showStatement statement property datatype /> - -<#macro showStatement statement property datatype> - <#assign theValue = statement.value /> - - <#if theValue?contains("
") > - <#assign theValue = theValue?replace("
","
") />
- #if>
- <#if theValue?matches("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})") >
- <#assign theValue = theValue + "T00:00:00" />
- ${dt.formatXsdDateTimeLong(theValue, "yearMonthDayPrecision")}
- <#elseif theValue?matches("^([0-9]{4})-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))(T|\\s)(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9])")>
- <#if theValue?contains("T00:00:00") >
- ${dt.formatXsdDateTimeLong(theValue, "yearMonthDayPrecision")}
- <#else>
- ${dt.formatXsdDateTimeLong(theValue, "yearMonthDayTimePrecision")}
- #if>
- <#elseif theValue?matches("^([0-9]{4})-(0[1-9]|1[012])")>
- <#assign theValue = theValue + "-01T00:00:00" />
- ${dt.formatXsdDateTimeLong(theValue, "yearMonthPrecision")}
- <#elseif theValue?matches("^--(0[1-9]|1[012])")>
- <#assign theValue = "2000" + theValue?substring(1) + "-01T00:00:00" />
- ${dt.formatXsdDateTimeLong(theValue, "monthPrecision")}
- <#else>
- ${theValue} <#if !datatype?contains("none")> <@validateFormat theValue datatype/> #if>
- #if>
- <@lmt.addCitationMetaTag uri=(property.uri!) content=(theValue!) />
-#macro>
-<#macro validateFormat value datatype >
- <#if datatype?? >
- <#switch datatype>
- <#case "date">
- <#-- validated above -->
- invalid format
- <#break>
- <#case "dateTime">
-
<#-- validated above -->
- invalid format
- <#break>
- <#case "time">
- <#if !value?matches("(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9])") >
-
- invalid format
- #if>
- <#break>
- <#case "gYear">
- <#if !value?matches("^\\d{4}") >
-
- invalid format
- #if>
- <#break>
- <#case "gMonth">
-
<#-- validated above -->
- invalid format
- <#break>
- <#case "gYearMonth">
-
<#-- validated above -->
- invalid format
- <#break>
- <#case "float">
- <#if !value?matches("^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?.") >
-
- invalid format
- #if>
- <#break>
- <#case "integer">
- <#if !value?matches("^-?\\d+$") >
-
- invalid format
- #if>
- <#break>
- <#case "int">
- <#if !value?matches("^-?\\d+$") >
-
- invalid format
- #if>
- <#break>
- <#case "boolean">
- <#if !value?matches("false") && !value?matches("true") >
-
- invalid format
- #if>
- <#break>
- <#default>
- #switch>
- #if>
-#macro>
-