Docuementation for ccm-sci-types-project.ftl

git-svn-id: https://svn.libreccm.org/ccm/trunk@6311 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2019-11-03 18:15:20 +00:00
parent 7871487205
commit d85eb92b50
1 changed files with 182 additions and 0 deletions

View File

@ -5,6 +5,17 @@
"ui": "http://www.arsdigita.com/ui/1.0"} "ui": "http://www.arsdigita.com/ui/1.0"}
> >
<#--filedoc
Functions for processing SciProjects
-->
<#--doc
Gets the begin date of a SciProject.
@param item The SciProject to use.
@return The begin date of the project.
-->
<#function getBegin item> <#function getBegin item>
<#if (item["./projectBegin"]?size > 0)> <#if (item["./projectBegin"]?size > 0)>
<#return item["./projectBegin"]> <#return item["./projectBegin"]>
@ -15,6 +26,13 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the end date of a SciProject.
@param item The SciProject to use.
@return The end date of the project.
-->
<#function getEnd item> <#function getEnd item>
<#if (item["./projectEnd"]?size > 0)> <#if (item["./projectEnd"]?size > 0)>
<#return item["./projectEnd"]> <#return item["./projectEnd"]>
@ -25,6 +43,13 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the description of a SciProject.
@param item The SciProject to use.
@return The description of the project.
-->
<#function getDescription item> <#function getDescription item>
<#if (item["./projectDesc"]?size > 0)> <#if (item["./projectDesc"]?size > 0)>
<#return item["./projectDesc"]> <#return item["./projectDesc"]>
@ -35,6 +60,13 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the short description of a SciProject.
@param item The SciProject to use.
@return The short description of the project.
-->
<#function getShortDescription item> <#function getShortDescription item>
<#if (item["./projectShortDesc"]?size > 0)> <#if (item["./projectShortDesc"]?size > 0)>
<#return item["./projectShortDesc"]> <#return item["./projectShortDesc"]>
@ -45,86 +77,236 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the sponsors of a project.
@param item The SciProject to use.
@return A sequence of sponsors (organizations).
-->
<#function getSponsors item> <#function getSponsors item>
<#return item[".//sponsors/sponsor"]> <#return item[".//sponsors/sponsor"]>
</#function> </#function>
<#--doc
Gets the name of sponsor.
@param sponsor The sponsor to use.
@return The name of the sponsor.
-->
<#function getSponsorName sponsor> <#function getSponsorName sponsor>
<#return sponsor["."]> <#return sponsor["."]>
</#function> </#function>
<#--doc
Determines if the sponsor has a funding code.
@param sponsor The sponsor to use.
@return `true` if a funding code is found, `false` otherwise.
-->
<#function hasSponsorFundingCode sponsor> <#function hasSponsorFundingCode sponsor>
<#return (sponsor["./@fundingCode"]?size > 0)> <#return (sponsor["./@fundingCode"]?size > 0)>
</#function> </#function>
<#--doc
Gets the funding code of sponsor.
@param sponsor The sponsor to use.
@return The funding code of the sponsor.
-->
<#function getSponsorFundingCode sponsor> <#function getSponsorFundingCode sponsor>
<#return sponsor["./@fundingCode"]> <#return sponsor["./@fundingCode"]>
</#function> </#function>
<#--doc
Gets a link to the sponsor.
@param sponsor The sponsor to use.
@return A link to the sponsor.
-->
<#function getSponsorLink sponsor> <#function getSponsorLink sponsor>
<#return sponsor["./@href"]> <#return sponsor["./@href"]>
</#function> </#function>
<#--doc
Determines if a SciProject has value for the `funding` property.
@param item The SciProject to use.
@return `true` if a value for the `funding` property is found, `false`
otherwise.
-->
<#function hasFunding item> <#function hasFunding item>
<#return (item["./funding"]?size > 0)> <#return (item["./funding"]?size > 0)>
</#function> </#function>
<#--doc
Gets the value of the `funding` property.
@param item The SciProject to use.
@return The value of the `funding` property.
-->
<#function getFunding item> <#function getFunding item>
<#return item[".//funding"]> <#return item[".//funding"]>
</#function> </#function>
<#--doc
Determines if a SciProject has value for the `fundingVolume` property.
@param item The SciProject to use.
@return `true` if a value for the `fundingVolume` property is found, `false`
otherwise.
-->
<#function hasFundingVolume item> <#function hasFundingVolume item>
<#return (item[".//fundingVolume"]?size > 0)> <#return (item[".//fundingVolume"]?size > 0)>
</#function> </#function>
<#--doc
Gets the value of the `fundingVolume` property.
@param item The SciProject to use.
@return The value of the `fundingVolume` property.
-->
<#function getFundingVolume item> <#function getFundingVolume item>
<#return item[".//fundingVolume"][1].@@text> <#return item[".//fundingVolume"][1].@@text>
</#function> </#function>
<#--doc
Gets the members of a project.
@param item The SciProject to use.
@return A sequence of the members (person items) of the project.
-->
<#function getMembers item> <#function getMembers item>
<#return item[".//members/member"]> <#return item[".//members/member"]>
</#function> </#function>
<#--doc
Gets the role of a member of the project.
@param member The member to use.
@return The role of the member.
-->
<#function getMemberRole member> <#function getMemberRole member>
<#return member["./@role"]> <#return member["./@role"]>
</#function> </#function>
<#--doc
Gets the status of a member of the project.
@param member The member to use.
@return The status of the member.
-->
<#function getMemberStatus member> <#function getMemberStatus member>
<#return member["./@status"]> <#return member["./@status"]>
</#function> </#function>
<#--doc
Gets the ID of a member of the project.
@param member The member to use.
@return The ID of the member.
-->
<#function getMemberId member> <#function getMemberId member>
<#return member["./masterVersion/id"] + "_" + member["./@name"]> <#return member["./masterVersion/id"] + "_" + member["./@name"]>
</#function> </#function>
<#--doc
Gets the link to the member of the project.
@param member The member to use.
@return The link to the member.
-->
<#function getMemberLink member> <#function getMemberLink member>
<#return CMS.generateContentItemLink(member["./@oid"])> <#return CMS.generateContentItemLink(member["./@oid"])>
</#function> </#function>
<#--doc
Gets the surname of member of the project.
@param member The member to use.
@return The surname of the member.
-->
<#function getMemberSurname member> <#function getMemberSurname member>
<#return member["./surname"]> <#return member["./surname"]>
</#function> </#function>
<#--doc
Gets the given name of member of the project.
@param member The member to use.
@return The given name of the member.
-->
<#function getMemberGivenName member> <#function getMemberGivenName member>
<#return member["./givenName"]> <#return member["./givenName"]>
</#function> </#function>
<#--doc
Gets the name prefix of member of the project.
@param member The member to use.
@return The name prefix of the member.
-->
<#function getMemberTitlePre member> <#function getMemberTitlePre member>
<#return member["./titlePre"]> <#return member["./titlePre"]>
</#function> </#function>
<#--doc
Gets the name suffix of member of the project.
@param member The member to use.
@return The name suffix of the member.
-->
<#function getMemberTitlePost member> <#function getMemberTitlePost member>
<#return member["./titlePost"]> <#return member["./titlePost"]>
</#function> </#function>
<#--doc
Gets organizations associated with the project.
@param item The SciProject to use.
@return A sequence of the organizations associated with the project.
-->
<#function getInvolvedOrganizations item> <#function getInvolvedOrganizations item>
<#return item[".//involvedOrganizations/organization"]> <#return item[".//involvedOrganizations/organization"]>
</#function> </#function>
<#--doc
Gets the name of an organization associated with the project.
@param orga The organization to use.
@return The name of the organization.
-->
<#function getInvolvedOrganizationName orga> <#function getInvolvedOrganizationName orga>
<#return orga["./title"]> <#return orga["./title"]>
</#function> </#function>
<#--doc
Gets the link to an organization associated with the project.
@param orga The organization to use.
@return The link the the organization associated with the project.
-->
<#function getInvolvedOrganizationLink orga> <#function getInvolvedOrganizationLink orga>
<#return orga["./links[1]/targetURI"]> <#return orga["./links[1]/targetURI"]>
</#function> </#function>