From 1862edc503ecee4e7c6623a8774e4cd1e57119d4 Mon Sep 17 00:00:00 2001 From: jensp Date: Sun, 3 Nov 2019 16:08:07 +0000 Subject: [PATCH] Docuementation for ccm-sci-publications/article.ftl and ccm-sci-publications/authors.ftl git-svn-id: https://svn.libreccm.org/ccm/trunk@6307 8810af33-2d31-482b-a856-94f89814c4df --- .../ccm-sci-publications/article.ftl | 12 +++ .../ccm-sci-publications/authors.ftl | 78 +++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/article.ftl b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/article.ftl index 1d17889bb..2bd28f803 100644 --- a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/article.ftl +++ b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/article.ftl @@ -7,6 +7,18 @@ <#import "../ccm-cms/content-item.ftl" as ContentItem> +<#--filedoc + Functions for publications of the types ArticleInCollectedVolume. + ArticleInJournal and InProceedings. +--> + +<#--doc + Constructs the link to the detail view for the article. + + @param article The article to use. + + @return The link to the detail view of the article. +--> <#function getHref article> <#return ContentItem.generateContentItemLink(article["./@oid"])> diff --git a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl index 31d341e07..187403277 100644 --- a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl +++ b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl @@ -5,42 +5,120 @@ "ui": "http://www.arsdigita.com/ui/1.0"} > +<#--filedoc + Functions for processing the authors of a publication. +--> + +<#--doc + Constructs the link the homepage of the author. + + @param author The author to use. + + @param keyId The `keyId` of the contact entry providing the link to the homepage. + + @return The link to the homepage of the author. +--> <#function getLink author keyId> <#return author["./contacts/contact/contactentries[./keyId = '${keyId}']/value"]> +<#--doc + Determines if an author has a link to a homepage. + + @param author The author to use. + + @param keyId The `keyId` of the contact entry providing the link to the homepage. + + @return `true` if the author has a link to a homepage, `false` otherwise. +--> <#function hasLink author keyId> <#return (author["./contacts/contact/contactentries[./keyId = '${keyId}']"]?size > 0)> +<#--doc + Gets the ID of the author. + + @param author The author to use. + + @return The ID of the author. +--> <#function getId author> <#return author["./masterVersion/id"] + "_" + author["./@name"]> +<#--doc + Gets the position of the author in the sequence of authors. + + @param author The author to use. + + @return The position of the author. +--> <#function getPosition author> <#return author["./position()"]> +<#--doc + Determines if the author is the last author in the sequence. + + @param author The author to use. + + @return `true` if the author is the last in the sequence, `false`otherwise. +--> <#function isLast author> <#return author["./last()"]> +<#--doc + Determines if the author has a surname. + + @param author The author to use. + + @return `true` if the author has a surname, `false`otherwise. +--> <#function hasSurname author> <#return (author["./surname"]?size > 0)> +<#--doc + Gets the surname of the author. + + @param author The author to use. + + @return The surname of the author. +--> <#function getSurname author> <#return author["./surname"]> +<#--doc + Determines if the author has a givnen name. + + @param author The author to use. + + @return `true` if the author has a given name, `false`otherwise. +--> <#function hasGivenName author> <#return (author["./givenname"]?size > 0)> +<#--doc + Gets the given name of the author. + + @param author The author to use. + + @return The given name of the author. +--> <#function getGivenName author> <#return author["./givenname"]> +<#--doc + Determines if the author is an editor. + + @param author The author to use. + + @return `true` if the author an editor, `false`otherwise. +--> <#function isEditor author> <#return author["./@isEditor"] == "true">