Bugfix for Freemarker function libraries

git-svn-id: https://svn.libreccm.org/ccm/trunk@6265 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2019-10-12 17:27:11 +00:00
parent 2128b250c4
commit c89fe0a5b5
7 changed files with 50 additions and 10 deletions

View File

@ -14,6 +14,16 @@
for the provided view and style. The paramters view and style are for the provided view and style. The paramters view and style are
optional. If not provided the default value "detail" is used for optional. If not provided the default value "detail" is used for
the view parameter. the view parameter.
@param {node} item The data model of the content item itself. There are
several functions for extracting this provided by other modules.
@param {string} view View type to use. Either `detail` or `list`. Default
value is `detail`.
@param {string} style Style to use. Styles allow it to use different
templates for `detail` or `list` views depending on the context were the
content item is displayed.
--> -->
<#macro contentItem item view="detail" style=""> <#macro contentItem item view="detail" style="">

View File

@ -96,7 +96,11 @@
</#function> </#function>
<#function getItemLink item> <#function getItemLink item>
<#if (item["./nav:path"]?size > 0)>
<#return item["./nav:path"].@@text> <#return item["./nav:path"].@@text>
<#else>
<#return "/redirect/?oid=" + item["./@oid"]>
</#if>
</#function> </#function>
<#function getItemLead item> <#function getItemLead item>

View File

@ -82,7 +82,7 @@
</#function> </#function>
<#function getPublicationObjectType item> <#function getPublicationObjectType item>
<#return item["./object-type"].@@text> <#return item["./@object-type"]>
</#function> </#function>
<#function getPublicationTitle item> <#function getPublicationTitle item>

View File

@ -9,6 +9,10 @@
<#return author["./contacts/contact/contactentries[./keyId = '${keyId}']/value"]> <#return author["./contacts/contact/contactentries[./keyId = '${keyId}']/value"]>
</#function> </#function>
<#function hasLink author keyId>
<#return (author["./contacts/contact/contactentries[./keyId = '${keyId}']"]?size > 0)>
</#function>
<#function getId author> <#function getId author>
<#return author["./masterVersion/id"] + "_" + author["./@name"]> <#return author["./masterVersion/id"] + "_" + author["./@name"]>
</#function> </#function>
@ -21,10 +25,18 @@
<#return author["./last()"]> <#return author["./last()"]>
</#function> </#function>
<#function hasSurname author>
<#return (author["./surname"]?size > 0)>
</#function>
<#function getSurname author> <#function getSurname author>
<#return author["./surname"]> <#return author["./surname"]>
</#function> </#function>
<#function hasGivenName author>
<#return (author["./givenname"]?size > 0)>
</#function>
<#function getGivenName author> <#function getGivenName author>
<#return author["./givenname"]> <#return author["./givenname"]>
</#function> </#function>

View File

@ -5,6 +5,14 @@
"ui": "http://www.arsdigita.com/ui/1.0"} "ui": "http://www.arsdigita.com/ui/1.0"}
> >
<#function getExportLinks item>
<#return item["./publicationExportLink"]>
</#function>
<#function hasExportLinks item>
<#return (item["./publicationExportLink"]?size > 0)>
</#function>
<#function getHref exportLink> <#function getHref exportLink>
<#return "${dispatcherPrefix}/scipublications/export/?format=${exportLink['./formatKey']}&publication=${exportLink['./publicationId']}"> <#return "${dispatcherPrefix}/scipublications/export/?format=${exportLink['./formatKey']}&publication=${exportLink['./publicationId']}">
</#function> </#function>

View File

@ -50,7 +50,11 @@
</#function> </#function>
<#function isReviewed item> <#function isReviewed item>
<#if (item["./reviewed"]?size > 0)>
<#return item["./reviewed"] == "true"> <#return item["./reviewed"] == "true">
<#else>
<#return false>
</#if>
</#function> </#function>
<#function getAbstract item> <#function getAbstract item>
@ -61,8 +65,8 @@
<#return item["./misc"]> <#return item["./misc"]>
</#function> </#function>
<#function getExportLinks item> <#function hasPlace item>
<#return item["./publicationExportLink"]> <#return (item["./place"]?size > 0)>
</#function> </#function>
<#function getPlace item> <#function getPlace item>
@ -157,7 +161,7 @@
<#return item["./articles/article"]> <#return item["./articles/article"]>
</#function> </#function>
<#function getProceedigingsPapers item> <#function getProceedingsPapers item>
<#return item["./papers/paper"]> <#return item["./papers/paper"]>
</#function> </#function>

View File

@ -18,18 +18,20 @@
<#function getEnd item> <#function getEnd item>
<#if (item["./projectEnd"]?size > 0)> <#if (item["./projectEnd"]?size > 0)>
<#return item["./projectEnd"]> <#return item["./projectEnd"]>
<#elseif (item["./lifeSpan/end"])> <#elseif (item["./lifeSpan/end"]?size > 0)>
<#return item["./lifeSpan/end"]> <#return item["./lifeSpan/end"]>
<#elseif (item["./nav:attribute[@name = 'projectEnd']"])> <#elseif (item["./nav:attribute[@name = 'projectEnd']"]?size > 0)>
<#return item["./nav:attribute[@name = 'projectEnd']"]> <#return item["./nav:attribute[@name = 'projectEnd']"]>
</#if> </#if>
</#function> </#function>
<#function getDescription item> <#function getDescription item>
<#if (item["./projectDesc"])> <#if (item["./projectDesc"]?size > 0)>
<#return item["./projectDesc"]> <#return item["./projectDesc"]>
<#elseif (item["./description"])> <#elseif (item["./description"]?size > 0)>
<#return item["./description"]> <#return item["./description"]>
<#elseif (item["./projectDescription"]?size > 0)>
<#return item["./projectDescription"]>
</#if> </#if>
</#function> </#function>