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
master
jensp 2019-11-03 16:08:07 +00:00
parent 285c138cc7
commit 1862edc503
2 changed files with 90 additions and 0 deletions

View File

@ -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"])>
</#function>

View File

@ -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"]>
</#function>
<#--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)>
</#function>
<#--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"]>
</#function>
<#--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()"]>
</#function>
<#--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()"]>
</#function>
<#--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)>
</#function>
<#--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"]>
</#function>
<#--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)>
</#function>
<#--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"]>
</#function>
<#--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">
</#function>