diff --git a/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl b/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl index 4fe2a2b05..e6c8337ef 100644 --- a/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl +++ b/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl @@ -5,6 +5,17 @@ "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> <#if (item["./projectBegin"]?size > 0)> <#return item["./projectBegin"]> @@ -15,6 +26,13 @@ +<#--doc + Gets the end date of a SciProject. + + @param item The SciProject to use. + + @return The end date of the project. +--> <#function getEnd item> <#if (item["./projectEnd"]?size > 0)> <#return item["./projectEnd"]> @@ -25,6 +43,13 @@ +<#--doc + Gets the description of a SciProject. + + @param item The SciProject to use. + + @return The description of the project. +--> <#function getDescription item> <#if (item["./projectDesc"]?size > 0)> <#return item["./projectDesc"]> @@ -35,6 +60,13 @@ +<#--doc + Gets the short description of a SciProject. + + @param item The SciProject to use. + + @return The short description of the project. +--> <#function getShortDescription item> <#if (item["./projectShortDesc"]?size > 0)> <#return item["./projectShortDesc"]> @@ -45,86 +77,236 @@ +<#--doc + Gets the sponsors of a project. + + @param item The SciProject to use. + + @return A sequence of sponsors (organizations). +--> <#function getSponsors item> <#return item[".//sponsors/sponsor"]> +<#--doc + Gets the name of sponsor. + + @param sponsor The sponsor to use. + + @return The name of the sponsor. +--> <#function getSponsorName sponsor> <#return sponsor["."]> +<#--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> <#return (sponsor["./@fundingCode"]?size > 0)> +<#--doc + Gets the funding code of sponsor. + + @param sponsor The sponsor to use. + + @return The funding code of the sponsor. +--> <#function getSponsorFundingCode sponsor> <#return sponsor["./@fundingCode"]> +<#--doc + Gets a link to the sponsor. + + @param sponsor The sponsor to use. + + @return A link to the sponsor. +--> + <#function getSponsorLink sponsor> <#return sponsor["./@href"]> +<#--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> <#return (item["./funding"]?size > 0)> +<#--doc + Gets the value of the `funding` property. + + @param item The SciProject to use. + + @return The value of the `funding` property. +--> <#function getFunding item> <#return item[".//funding"]> +<#--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> <#return (item[".//fundingVolume"]?size > 0)> +<#--doc + Gets the value of the `fundingVolume` property. + + @param item The SciProject to use. + + @return The value of the `fundingVolume` property. +--> <#function getFundingVolume item> <#return item[".//fundingVolume"][1].@@text> +<#--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> <#return item[".//members/member"]> +<#--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> <#return member["./@role"]> +<#--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> <#return member["./@status"]> +<#--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> <#return member["./masterVersion/id"] + "_" + member["./@name"]> +<#--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> <#return CMS.generateContentItemLink(member["./@oid"])> +<#--doc + Gets the surname of member of the project. + + @param member The member to use. + + @return The surname of the member. +--> <#function getMemberSurname member> <#return member["./surname"]> +<#--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> <#return member["./givenName"]> +<#--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> <#return member["./titlePre"]> +<#--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> <#return member["./titlePost"]> +<#--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> <#return item[".//involvedOrganizations/organization"]> +<#--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> <#return orga["./title"]> +<#--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> <#return orga["./links[1]/targetURI"]>