Bugfixes for several Freemarker function libraries

git-svn-id: https://svn.libreccm.org/ccm/trunk@6257 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2019-10-06 09:50:17 +00:00
parent e46b6f34bb
commit 62a5a65447
2 changed files with 26 additions and 6 deletions

View File

@ -2,11 +2,16 @@
"bebop":"http://www.arsdigita.com/bebop/1.0", "bebop":"http://www.arsdigita.com/bebop/1.0",
"cms":"http://www.arsdigita.com/cms/1.0", "cms":"http://www.arsdigita.com/cms/1.0",
"nav":"http://ccm.redhat.com/navigation", "nav":"http://ccm.redhat.com/navigation",
"ppp":"http://www.arsdigita.com/PublicPersonalProfile/1.0",
"ui": "http://www.arsdigita.com/ui/1.0"} "ui": "http://www.arsdigita.com/ui/1.0"}
> >
<#function getProfileOwnerFullName model>
<#return model["./ppp:profile/ppp:ownerName"]>
</#function>
<#function getProfileOwner data> <#function getProfileOwner data>
<#return data["./profileOwner"]> <#return data["./profileOwner/owner"]>
</#function> </#function>
<#function getProfileOwnerSurname owner> <#function getProfileOwnerSurname owner>
@ -25,20 +30,20 @@
<#return owner["./titlePost"]> <#return owner["./titlePost"]>
</#function> </#function>
<#function getProfilePosition> <#function getProfilePosition data>
<#return data["./position"]> <#return data["./position"]>
</#function> </#function>
<#function getProfileInterests> <#function getProfileInterests data>
<#return data["./interests"]> <#return data["./interests"]>
</#function> </#function>
<#function getProfileMisc> <#function getProfileMisc data>
<#return data["./misc"]> <#return data["./misc"]>
</#function> </#function>
<#function getProfileOwnerContact owner> <#function getProfileOwnerContact owner>
<#return owner["./contact"]> <#return owner["./contacts/contact"]>
</#function> </#function>
<#function getProfileImage data> <#function getProfileImage data>
@ -49,6 +54,17 @@
</#if> </#if>
</#function> </#function>
<#function getProfileImageUrl data>
<#if (data["./ppp:profile/ppp:profileImage"]?size > 0)>
<#assign imageId=data["./ppp:profile/ppp:profileImage/imageAttachments[1]/image/id"]>
<#return dispatcherPrefix + '/cms-service/stream/image/?image_id=' + imageId>
<#elseif (data["./nav:greetingdata/cms:data/profileOwner/owner/imageAttachments"]?size > 0)>
<#assign imageId=data["./nav:greetingdata/cms:data/profileOwner/owner/imageAttachments[1]/image/id"]>
<#return dispatcherPrefix + '/cms-service/stream/image/?image_id=' + imageId>
</#if>
</#function>
<#function getProfileOwnerName data> <#function getProfileOwnerName data>
<#return data["./ppp:profile/ppp:ownerName"]> <#return data["./ppp:profile/ppp:ownerName"]>
</#function> </#function>

View File

@ -6,7 +6,7 @@
> >
<#function getAddress item> <#function getAddress item>
<#return item["./address/address"]> <#return item["./address"]>
</#function> </#function>
<#function getPerson item> <#function getPerson item>
@ -25,6 +25,10 @@
<#return entry["./key"]> <#return entry["./key"]>
</#function> </#function>
<#function getContactEntryKey entry>
<#return entry["./key"]>
</#function>
<#function getContactEntryValue entry> <#function getContactEntryValue entry>
<#return entry["./value"]> <#return entry["./value"]>
</#function> </#function>