From 59c3f31e9637ac331dfadaabf96542f61731715e Mon Sep 17 00:00:00 2001 From: ryounes Date: Fri, 22 Apr 2011 00:05:28 +0000 Subject: [PATCH] NIHVIVO-2479 Continue work on dump templates for values of different types --- .../freemarker/body/partials/dump/dump1.ftl | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/webapp/web/templates/freemarker/body/partials/dump/dump1.ftl b/webapp/web/templates/freemarker/body/partials/dump/dump1.ftl index f877c3e02..296b2b598 100644 --- a/webapp/web/templates/freemarker/body/partials/dump/dump1.ftl +++ b/webapp/web/templates/freemarker/body/partials/dump/dump1.ftl @@ -65,28 +65,54 @@ div.dump { <#if map.value?has_content> -

+

Value: <#local value = map.value> <#if value?is_string || value?is_number>${value} - <#elseif value?is_boolean || value?is_number>${value?string} + <#elseif value?is_boolean>${value?string} <#elseif value?is_date>${value?string("EEEE, MMMM dd, yyyy hh:mm:ss a zzz")} - <#elseif value?is_sequence><@doSequence value /> + <#-- At this point both types and collections have sequence values. We need to + reference the type of the original object to know whether it's indexable + or not. --> + <#elseif value?is_sequence><@doSequenceItems value map.type/> + + <#elseif value?is_method || value?is_directive><@doMethod value /> + <#elseif value?is_hash_ex><@doMapItems value /> + <#else> -

+
-<#macro doSequence seq> +<#macro doSequenceItems seq type> <#if seq?has_content> +<#macro doMapItems map> + <#if map?has_content> + + + + +<#macro doMethod method> + + + <#-- This will work after we move stylesheets to Configuration sharedVariables ${stylesheets.add('')} -->