Starting with version 2.5 the LibreCCM platform support Freemarker as an alternative to XSL. Freemarker is a project of the Apache Foundation and a well known and mature template engine for Java. The support for Freemarker in version 2.5 is a backport from the upcoming version 7 of the LibreCCM platform.
Compared to XSL Freemarker is a lot easier to use, especially if you have worked with other template engines like Twig, Velocity etc before. In version 7 of the LibreCCM platform Freemarker will be become the primary template engine. XSL will still be supported, but we recommanded that you port your themes to Freemarker. Why Freemarker and not one of the other template engines? Freemarker is able to process XML in a similar way than XSL.
Freemarker also allows it to define user defined directivies and functions. To make it easier to create impressive themes we provide functions and macros for Freemarker we provide several functions and macros which hide the complexity of the XML data model created by CCM from the template author. It is recommanded not to access the XML data model directly. Instead the provided functions should be used. Otherwise your theme might brake when the XML structure changes.
Freemarker themes have a different structure than the usual "old style" themes of LibreCCM.
ToDo
Several variables and functions are predefined and available without importing another file.
contextPathThe context path in which CCM is running.
contextPrefixThe context prefix.
dispatcherPrefixPrefix for the CCM dispatcher (usually /ccm)
hostThe current host.
modelThe XML document created by LibreCCM.
negotiatedLanguageThe language negoiated between the user agent and LibreCCM.
requestSchemeThe protocol (http or https).
selectedLanguageThe language selected by the user.
themePrefixThe prefix of the theme. Only available if a development theme is viewed.
getLocalizedTextString getLocalizedText(String key)
Returns the localized text from the resource bundle of the theme.
getContentItemTemplateString getContentItemTemplate(String objectType, view="DETAIL", style="")
This is an internal function!
Returns the path for the template of a content item of a specific type.
_formatDateTimeAn internal functions date time formatting. This functions should not be used directly.
/ccm-cms/content-item.ftl
This functions and macros work for all content item types. Unless stated otherwise all functions support the detail view as well as the list view generated by the ObjectList components of the ccm-navigation module.
Node getContentItem()Retrieves the content item of the current page. This works only on pages generated by the ContentSection application. To get the index item of a navigation page use the functions provided by the ccm-navigation module.
This function is primarly used to as parameter for other functions dealing with content items.
@contentItem item: Node view: String style: StringThis macro generates the detail view of a content item. Using the type of the provided content items, the provided type and the provided type this macro internally tries to find a view definition in for the provided parameters in the theme manifest. The template defined in this definition is used to generate the HTML representation of the item.
The parameters view and style are optional. The view parameter defaults to detail, the default value for the style parameter is an empty string.
String getItemTitle(item: Node)This function retrieves the title of the provided content items.
String getPageTitle(useCategoryMenu: String, useRootIndexItemTitle: boolean)Retrieves the title of the current page. The title retrieved depends on the provided parameters. Both parameters are optional. useCategoryMenuis used to select the category menu which is used to retrieve the page title. The default value is categoryMenu. The useRootIndexItemTitle defaults to false and is used to determine if the title of the category or the title of the index item is used as page title for the index page of an category.
String getItemSummary(item: Node)Retrieves the summary/lead text of the provided content item if the item has a property. The following property names are tried: lead, summary. If none is found an empty string is returned.
String getPageDescription(item: Node)Retrieves the value of the pageDescription property of the provided content item if the item has such a property. If not an empty string is returned.
String generateContentItemLink(oid: String)Generates a link to the content item with the provided OID.
String getEditLink(item: Node)This function generates a link for editing the provided content item is the link is available. If the link is not available, for example if the current user is not permitted to edit the item, an empty string is returned.
/ccm-cms/orgaunit.ftl
Sequence getAvailableTabs(item: Node)Returns a sequence of the information tabs available for the provided organizational unit item. For processing the return values of this functions the other functions provided by this file should be used.
String getTypeNameKey(item: Node)Retrieves the type of the provided orga unit item.
String getTabLabel(tab: Node)Retrieves the label of the provided tab.
boolean isTabSelected(tab: Node)Checks if the provided tab is the currently selected tab.
String getTabLink(tab: Node)Retrieves the link for the provided tab.
Node getSelectedTab(item: Node)Retrieves the data of the selected tab.
String getTypeOfSelectedTab(item: Node)Returns the type of the selected tab.
Node getPropertyFromTab(tab: Node)Returns a property from the provided tab.
Mixed getTabContent(tab: Node)Returns the content of the provided tab.
String getAddedum(data: Node)Retrieves the value of the addendum property from the provided tab data (as returned by getTabContent) if the data contains such a property.
Retrieves the members of the orga unit from the provided tab data (as returned by getTabContent) if the data contains such a property.
String getMemberRole(member: Node)Retrieves the role of the provided member.
String getMemberStatus(member: Node)Retrieves the status of the provided member.
Sequence<Node> getContactEntries(member: Node)Retrieves the contact entries of the provided member. For processing the members the functions provided by person.ftl can be used.
boolean hasOrgaUnitContact(data: Node)Returns true if the provided data contains a contact item.
Node getOrgaUnitContact(data: Node)Retrieves the contact item for the orga unit from the provided data.
Node getOrgaUnitContactPerson(data: Node)Retrieves the person associated with the provided contact.
Node getOrgaUnitContactEntries(data: Node)Retrieves the contact entries of the provided contact item. For further processing the functions provided by the ccm-cms-types-contact module should be used.
/ccm-cms/person.ftl
This functions can be used to process content items derivated from the GenericPerson type.
String getSurname(item: Node)Gets the surname from the provided person item.
String getGivenName(item: Node)Gets the given name from the provided person item.
String getTitlePre(item: Node)Gets the value of the titlePre property of the provided person item.
String getTitlePost(item: Node)Gets the value of the titlePost property of the provided person item.
String getHomepageLink(item: Node, contactType: string="commonContact", entry: String="homepage")Retrieves the link to the homepage of the provided person item if the item has an contact entry for a homepage. The optional parameters contactType and entry can be used to select the contact and the entry from which the value is read. The default value for contactType is commonContact. For entry the default value is homepage.
String getAddress(item: Node, contactType: String="commonContact")Retrieves the addres item associated with contact of the provided person. The contact to use can be selected using the optional parameters contactType. The default value is commonContact. # Functions for File Attachments
/ccm-cms-assets-fileattachments.ftl
This module provides functions for dealing with file attachments. A possible usage these functions:
<#list FileAttachments.getFileAttachments(item)>
<div class="file-attachments">
<h2>
${getLocalizedText("layout.page.main.fileAttachments")}
</h2>
<ul class="file-attachments">
<#items as file>
<#if FileAttachments.getFileType(file) == "caption">
<li class="caption">
<strong>${FileAttachments.getFileName(file)}</strong>
<p>
${FileAttachments.getFileDescription(file)}
</p>
</li>
<#else>
<li class="file-attachment">
<a href="${FileAttachments.getFileUrl(file)}">
<span class="fa fa-download"></span>
${FileAttachments.getFileDescription(file)}
(${FileAttachments.getMimeTypeFileExtension(file)},
${FileAttachments.getFileSize(file, "KiB")} KB)
</a>
</li>
</#if>
</#items>
</ul>
</div>
</#list>
getFileAttachments(item: Node): Sequence<Node>Retrieves the file attachments of the provided content item.
getFileType(file: Node): StringReturns the type of the file attachments which is either caption or file.
getMimeType(file: Node): StringReturns the mime type of the file, for example image/png or application/pdf.
getMimeTypeFileExtension(file: Node): StringReturns the usual file extension for the mime type of the file.
getFileSize(file: Node, unit: String = "byte"): NumberReturns the size of the provided file. The unit in which the size of the file is returned can be changed by using the optional parameter unit. The default value for the unit is byte.
getFileId(file: Node): StringReturns the ID of the file.
getFileName(file: Node): StringReturns the name of file.
getFileDescription(file: Node): StringReturns the description of the file.
getFileUrl(file: Node): StringReturns the URL of the file.
Provides functions for dealing with image attachments of a content item.
/ccm-cms-assets-imagestep.ftl"
Example usage:
<#import "/ccm-cms-assets-imagestep.ftl" as Images>
<#list Images.getImageAttachments(item)>
<div class="image-attachments">
<#items as image>
<figure>
<div>
<a data-fancybox="gallery">
<img src="${Images.getImageUrl(image)}"
width="100%"
height="auto" />
</a>
</div>
<figcaption>
${Images.getImageCaption(image)}
</figcaption>
</figure>
</#items>
</div>
</#list>
getImageAttachments(item: Node): Sequence<Node>Get the image attachments of the provided content item.
getImageId(image: Node): StringGets the ID of the provided image.
getImageName(image: Node): StringGets the name of the provided image.
getImageCaption(image: Node): StringGets the caption of the provided image.
getImageSortKey(image: Node): StringGets the sort key of the provided image.
getImageWidth(image: Node): StringGets the width of the provided image.
getImageHeight(image: Node): StringGets the height of the provided image.
getImageUrl(image: Node): StringGets the URL of the provided image.
Functions for processing note assets assigned to a content item.
/ccm-cms-assets-notes.ftl
getNotes(item: Node): Sequence<Node>Returns the notes assigned to a content item.
Gets the content of a note. The return value is the HTML content of the node. # Freemarker functions for related links
/ccm-cms-assets-relatedlinks
Functions for processing the related links assigned to a content item.
getRelatedLinks(item: Node, linkListName: String = "NONE"): Sequence<Node>Retrieves the related links assigned to a content item. Related links can be organized in named list. The optional parameters linkListName controls which list is used. If the parameter is omitted the default value NONE is used.
getLinkType(link: Node): StringGets the type of the provided link which can either be externalLink, internalLink or caption.
getLinkTitle(link: Node): StringGets the title of the provided link.
getLinkDescription(link: Node): StringGets the description of the provided link.
getLinkOrder(link: Node): StringGets the order value for the provided link.
getInternalLinkParameters(link: Node): StringGets the URL parameters of the of the provided link (The part after the question mark).
getTargetUri(link: Node): StringGets the URI of the target of the provided link.
/ccm-cms-publicpersonalprofile.md
Functions for processing the data of a public personal profile.
getProfileOwner(data: Node): NodeGet the data about the profile owner. The return value is a XML node which can be further processed with other functions.
getProfileOwnerSurname(owner: Node): StringGets the surname of a profile owner.
getProfileOwnerGivenName(owner: Node): StringGets the given name of a profile owner.
getProfileOwnerTitlePre(owner: Node): StringGets the titles a profile owner.
getProfileOwnerTitlePost(owner: Node): StringGets the titles a profile owner.
getProfilePosition(data: Node): StringReturns the value of the position property of a profile.
getProfileInterests(data: Node): StringReturns the value of the interests property of a profile.
getProfileMisc(data: Node): StringReturns the value of the misc property of a profile.
getProfileOwnerContact(owner: Node): NodeGets the contact data of the owner. The contact data is in the same format as a content item of the type ccm-cms-types-contact. The returned data can be processed further using the functions for content items of the type ccm-cms-types-contact?. The functions provided by the ccm-cms-types-contact module can be used to process this data.
getProfileImage(data: Node): StringReturns the data of the image attached to the profile, if any. The returned data is a image attachement which can be processed further by the functions provided for processing image assets (see ccm-cms-assets-imagestep).
getProfileOwnerName(data: Node): StringGets the name of the profile owner which is the name of the content item of the type Person assigned to the profile.
getPersonalPublications(data: Node): Sequence<Node>Gets the data about the personal publications of the profile owner, organized in publications groups.
getPersonalPublicationsAvailablePublicationGroups(data: Node): Sequence<Node>Get the available publications groups. The items of the sequence can be processed further using getPublicationGroupId and getPublicationGroupLink.
getPublicationGroupId(group: Node): StringReturns the ID of the publication group.
getPublicationGroupLink(group: Node): StringReturns the link for showing the publications of the group.
getPublicationGroups(data: Node): Sequence<Node>Get all publication groups currently displayed.
getPublicationsOfGroup(data: Node): Sequence<Node>Gets the publiations of a group. The publication can be processed further by the functions provided by ccm-sci-publications.
hasPublicationsPaginator(profile: Node): booleanDetermines if there is paginator for the current publication group.
getPublicationsPaginatorBaseUrl(profile: Node): StringReturns the base URL for the publications paginator.
getPublicationsPaginatorPageCount(profile: Node): StringReturns the number of pages from the publications paginatator.
getPublicationsPaginatorPageNumber(profile: Node): StringReturns the current page of the current publication group.
getPublicationsPaginatorPageParam(profile: Node): StringGets the name of the URL parameter for changing the current page.
getPublicationsPaginatorPageSize(profile: Node): StringGets the page size.
getPublicationsPaginatorObjectBegin(profile: Node): StringGets the index of the first displayed item of current publication group.
getPublicationsPaginatorObjectCount(profile: Node): StringGets the index of the number of items in the current publication group.
getPublicationsPaginatorObjectEnd(profile: Node): StringGets the index of the last displayed item of current publication group.
getPublicationsPaginatorPrevPageLink(profile: Node): StringGets the link to the previous page of the current publication group.
getPublicationsPaginatonFirstPageLink(profile. Node): StringGets the link the first page of the current publication group.
getPublicationsPaginatorNextPageLink(profile: Node): StringGets the link to the next page of the current publication group.
getPublicationsPaginatorLastPageLink(profile: Node): StringGets the link to the last page of the current publication group.
getAvailableProjectGroups(data: Node): Sequence<Node>Returns the available project groups. The sequence can be processed further using getProjectGroupId and getProjectGroupLink.
getProjectGroupId(group: Node): StringReturns the ID of the Project group.
getProjectGroupLink(group: Node): StringReturns the link for showing the Projects of the group.
getProjectGroups(data: Node): StringGets all project groups currently displayed.
getProjectsOfGroup(data: Node): Sequence<Node>Gets the projects of a group. The projects can be processed further by the functions provided by ccm-sci-types-project.
hasProjectsPaginator(profile: Node): booleanDetermines if the current project group has a paginator.
getProjectsPaginatorBaseUrl(profile: Node): StringReturns the base URL for the projects paginator.
getProjectsPaginatorPageCount(profile: Node): StringReturns the number of pages from the project paginatator.
getProjectsPaginatorPageNumber(profile: Node): StringReturns the current page of the current project group.
getProjectsPaginatorPageParam(profile: Node): StringGets the name of the URL parameter for changing the current page.
getProjectsPaginatorPageSize(profile: Node): StringGets the page size.
getProjectsPaginatorObjectBegin(profile: Node): StringGets the index of the first displayed item of current project group.
getProjectsPaginatorObjectCount(profile: Node): StringGets the number of items in the current project group.
getProjectsPaginatorObjectEnd(profile: Node): StringGets the index of the last displayed item of current project group.
getProjectsPaginatorPrevPageLink(profile: Node): StringGets the link to the previous page of the current project group.
getProjectsPaginatonFirstPageLink(profile: Node): StringGets the link the first page of the current project group.
getProjectsPaginatorNextPageLink(profile: Node): StringGets the link to the next page of the current project group.
getProjectsPaginatorLastPageLink(profile: Node): StringGets the link to the last page of the current project group. # Freemarker functions for ccm-cms-types-address
/ccm-cms-type-address.ftl
getAddressText(item: Node): StringReturns the value of the text property of the address.
getCity(item: Node): StringReturns the value of the city property of the address.
getPostalCode(item: Node): StringGets the postal code of the address.
getState(item: Node): StringGets the value of the state property of the address. (state means the a federal state or the equivialent here, for example California in the USA oder Lower Saxony in Germany)
getCountry(item: Node): StringThe country of the address.
getIsoCountryCode(item: Node): StringGets the ISO country code for the country of the address. # Freemarker functions for Article content items
getLead(item: Node): StringRetrieves the lead text of the provided article.
getMainText(item: Node): StringRetrieves the main text of the provided item. The return value is a HTML string. # Freemarker functions for Contact items
/ccm-cms-types-contact.ftl
getAddress(item: Node): NodeReturns the address associated wit the provided contact item. The address can be processed further using the functions provided by the ccm-cms-types-address module.
getPerson(item: Node): NodeReturns the person associated with the provided contact. The returned person item can be processed further using functions provided by the ccm-cms module.
getContactEntries(item: Node): Sequence<Node>Returns the contact entries of the provided contact.
getContactEntry(item: Node, keyId: String): NodeReturns the contact entry with the provided keyId if the provided contact has a matching contact entry. If not null is returned.
getContactEntryLabel(entry: Node): StringReturns the label of the provided contact entry.
getContactEntryValue(entry: Node): StringReturns the value of the provided contact entry. # Freemarker functions for Article content items
getLead(item: Node): StringRetrieves the lead text of the provided article.
getMainText(item: Node): StringRetrieves the main text of the provided item. The return value is a HTML string. # Freemarker functions for Bookmark items
getDescription(item: Node): StringGets the description of the bookmark.
getLink(item: Node): StringGets the link for the bookmark's target.
/ccm-cms-types-contact.ftl
getAddress(item: Node): NodeReturns the address associated wit the provided contact item. The address can be processed further using the functions provided by the ccm-cms-types-address module.
getPerson(item: Node): NodeReturns the person associated with the provided contact. The returned person item can be processed further using functions provided by the ccm-cms module.
getContactEntries(item: Node): Sequence<Node>Returns the contact entries of the provided contact.
getContactEntry(item: Node, keyId: String): NodeReturns the contact entry with the provided keyId if the provided contact has a matching contact entry. If not null is returned.
getContactEntryLabel(entry: Node): StringReturns the label of the provided contact entry.
getContactEntryValue(entry: Node): StringReturns the value of the provided contact entry. # Freemarker functions for Event items
/ccm-cms-types-event.ftl
getLead(item: Node): StringReturns the lead text of the event.
getMainText(item: Node): StringReturns the main text of the event.
getEndDate(item: Node): DateTimeNodeReturns the end date of the provided event item. To format the date the formatDateTime function provided by the ccm-cms module should be used.
getEndDateYear(item: Node): StringReturns the year part of the end date of the event.
getEndDateMonth(item: Node): StringReturns the month part of the end date of the event.
getEndDateShortMonth(item: Node): StringReturns the the short name of month part of the end date of the event.
getEndTime(item: Node): StringGets the end time of the event.
getEndTimeHour(item: Node): StringGets the hour part of the end time of the event.
getEndTimeMinute(item: Node): StringGets the minute part of the end time of the event.
getEndTimeSecond(item: Node): StringGets the second part of the end time of the event.
getStartDate(item: Node): DateTimeNodeReturns the start date of the provided event item. To format the date the formatDateTime function provided by the ccm-cms module should be used.
getStartDateYear(item: Node): StringReturns the year part of the start date of the event.
getStartDateMonth(item: Node): StringReturns the month part of the start date of the event.
getStartDateShortMonth(item: Node): StringReturns the the short name of month part of the start date of the event.
getStartTime(item: Node): StringGets the start time of the event.
getStartTimeHour(item: Node): StringGets the hour part of the start time of the event.
getStartTimeMinute(item: Node): StringGets the minute part of the start time of the event.
getStartTimeSecond(item: Node): StringGets the second part of the start time of the event.
getLocation(item: Node): StringGets the location of the event.
getMainContributor(item: Node): StringGets the value of the mainContributor property of the event.
getEventType(item: Node): StringReturns the value of the eventType property of the event.
getCost(item: Node): StringReturns the value of the cost property of the event.
getMapLink(item: Node): StringReturns the value of the mapLink property of the event.
getEventDateAddendum(item: Node): StringReturns the value of the addendum property of the event. # Freemarker functions for ExternalLink items
/ccm-cms-types-externallink.ftl
getDescription(item: Node): StringGets the description of the external link item.
getComment(item: Node): StringGets the value of the comment property of the link item.
isTargetNewWindow(item: Node): StringReturns true if the link should be opened in a new window/tab.
getUrl(item: Node): StringReturns the URL of the external link. # Freemarker functions for File Storage Items
/ccm-cms-types-filestorageitem.ftl
getDescription(item: Node): StringGets the description of the file storage item.
getFileId(item: Node): StringReturns the ID for the file represented by the file storage item.
getFileName(item: Node): StringReturns the name of the file represented by the file storage item.
getFileLink(item: Node, mode: String="download", useFileName: boolean = true): StringReturns the link for downloading or viewing the file. The optional parameter mode controls if the link for downloading or for viewing the file is generated. The supported values are download (default value) and stream. Unknown values are interpreted as download.
The optional useFileName parameter controls if the name of the file (see getFileName) is included in the link. The default value is true. # Freemarker functions for Form items
/ccm-cms-types-formitem.md
getDescription(item: Node): StringGets the description of the form item.
getFormAction(item: Node): StringGets the URL to which the form is send.
hasHoneypot(item: Node): booleanReturns true if the form contains a honeypot field for catching bots.
getHoneypotName(item: Node): StringGets the name of the honeypot field.
hasMinTimeCheck(item: Node): booleanReturns true if a check of the time the user needs to fill out the form should be added to the form. Bots are normally extremly fast (faster than any human).
getMinTimeCheckValue(item: Node): StringThe minium time for the min time check.
hasVisitedField(item: Node): booleanReturns true if a visited field is part of the form.
getVisitedField(item: Node): StringGets the value of the visited field.
getVisitedFieldName(item: Node): StringReturns the name of the visited field.
getPageStateFieldName(item: Node): StringGets the name to use for the (hidden) field holding the page state.
getPageStateFieldValue(item: Node): StringGets the value of the (hidden) field holding the page state.
getComponents(item: Node): Sequence<Node>Returns the compnents of the form.
getComponentName(component: Node): StringReturns the name of the provided component.
getComponentDefaultValue(component: Node): StringReturns the default value of the provided component.
getComponentDescription(component: Node): StringReturns the description of the provided component.
getComponentParameterName(component: Node): StringReturns the parameter name of the provided component.
getComponentType(component: Node): StringReturns the type of the provided component.
getFormSectionTitle(formSection: Node): StringGets the title of the provided form section.
getFormSectionComponents(formSection: Node): StringGets the components of the form section.
getLabelComponents(label: Node): Sequence<Node>Gets the components of a label.
getButtonGroupComponents(buttonGroup: Node): Sequence<Node>Gets the components of a button group.
isMultipleSelect(select: Node): booleanReturns true if the provided select component allows multiple values.
isDataDrivenSelect(select: Node): booleanReturns true if the provided select component is a data driven select.
getDataOptions(select: Node): Sequence<Node>Gets the options of a data driven select.
getDataOptionLabel(option: Node): StringGest the label of an option of an data driven select.
getDataOptionId(option: Node): StringGest the id of an option of an data driven select.
getDataOptionCompoents(option: Node): Sequence<Node>Gest the components of an option of an data driven select.
hasOtherOption(select: Node): booleanReturns true if the provided select component has an other option.
getOtherOptionLabel(select: Node): StringReturns the label for the other option.
getOtherOptionValue(select: Node): StringReturns the value for the other option.
hasMaxLength(component: Node): booleanReturns true if the provided component has a maxLength property.
getMaxLength(component: Node): StringGets the value of the maxLength property of the provided component.
hasSize(component: Node): booleanReturns true if the provided component has a size property.
getMaxSize(component: Node): StringGets the value of the size property of the provided component.
getRequired(component: Node): StringDetermines of the provided component represents a mandantory field of the form.
getDateFieldDayParamName(component: Node): StringReturns the name of the day param of a date input component.
getDateFieldMonthParamName(component: Node): StringReturns the name of the month param of a date input component.
getDateFieldYearParamName(component: Node): StringReturns the name of the year param of a date input component.
getDateFieldDefaultValueDay(component: Node): StringReturns the default value for the day of the provided date input component.
getDateFieldDefaultValueMonth(component: Node): StringReturns the default value for the month of the provided date input component.
getDateFieldDefaultValueYear(component: Node): StringReturns the default value for the year of the provided date input component.
getDateFieldMonthList(component: Node): Sequence<Node>Gets the list of permitted months.
getDateFieldYearList(component: Node): Sequence<Node>Gets the list of permitted years.
getMonthLabel(month: Node): StringGets the label for the provided month.
getYearLabel(year: Node): StringGets the label for the provided year.
getTextAreaRows(textArea: Node): StringGets the number of rows for the provided text area component.
getTextAreaCols(textArea: Node): StringGets the number of cols for the provided text area component. # Freemarker functions for Image items
/ccm-cms-types-image.ftl
getArtist(item: Node): StringReturns the name of the artist how created the image.
getCopyright(item: Node): StringReturns the value of the copyright property of the image.
getDescription(item: Node): StringReturns the description of the image.
getLicense(item: Node): StringReturns the license text for the image.
getMaterial(item: Node): StringGets the value of the material property of the image.
getPublishDate(item: Node): StringGets the publish date of the image.
getWidth(item: Node): StringGets the value of the width property of the image.
getHeight(item: Node): StringGets the value of the height property of the image.
getMainText(item: Node): HTMLStringGets the main text describing the image.
getOrigin(item: Node): StringGets the value of the origin property of the image.
getOriginalSize(item: Node): StringGets the original size of the image.
Returns the URL of the image resource.
getCaption(item: Node): StringReturns the caption of the image.
getImageId(item: Node): StringGets the ID of the image resource.
getThumbnailId(item: Node): StringGets the ID of the thumbnail image.
getThumbnailWidth(item: Node): StringGets the width of the thumbnail.
getThumbnailHeight(item: Node): StringGets the height of the thumbnail.
getSite(item: Node): StringGets the value of the site property of the image.
getSource(item: Node): StringGets the value of the source property of the image.
getTechnique(item: Node): StringGets the value of the technique property of the image. # Freemarker functions for MultiPartArticles
/ccm-cms-types-multiparticle.ftl
getSummary(item: Node): StringReturns the summary of the provided MultiPartArticle item.
getSections(item: Node): Sequence<Node>Returns the currently displayed sections of the multipart article. The sections can be processed further by some of the other funtions provided by this library.
getSectionTitle(section: Node): StringReturns title title of the provided section.
getSectionTitle(section: Node): HtmlStringGets the content of the provided section.
getSectionRank(section: Node): StringGets the value of the rank property of the provided section.
getPageNumber(item: Node): StringGets the number of the page of the multipart article displayed.
getNumberOfPages(item: Node): StringReturns the number of pages of the provided multipart article.
hasPreviousPage(item: Node): booleanReturns true if the provided multipart article has previous pages.
hasPreviousPage(item: Node): booleanReturns true if the provided multipart article has more pages.
hasMultiplePages(item: Node): booleanReturns true if the provided multipart article has more than one page.
getLinkToPreviousPage(item: Node): StringReturns the link to the previous page if any.
getLinkToNextPage(item: Node): StringReturns the link to the next page if any.
getAllSectionsLink(item: Node): StringReturns the link for showing the complete multipart article on a single page. # Freemarker functions for generating the table of contents of a MultiPartArticle
/ccm-cms-types-multiparticle-toc.ftl
These functions can be used to generate the table of contents (toc) for a multi part article. An example:
... // Other imports
<#import "/ccm-cms-types-multiparticle-toc.ftl" as Toc>
... // Other things
<#list Toc.getSections(item)>
<div class="mpa-toc">
<h3>${getLocalizedText("mpa.toc")}</h3>
<ul class="mpa-toc">
<#items as section>
<li>
<a href="${Toc.getSectionLink(section)}"
class="${Toc.isActiveSection(item, section)?then('active', '')}">
${Toc.getSectionTitle(section)}
</a>
</li>
</#items>
</ul>
</div>
</#list>
getSections(item: Node): Sequence<Node>Returns the sections of the provided MultiPartArticle item. The sections can be further be processed using the other functions provided by this file.
getSectionTitle(section: Node): StringGets the title of the provided section.
getSectionLink(section: Node): StringGets the link for displaying the provided section.
isActiveSection(section: Node): StringReturns true if the provided section is the active section. # Freemarker functions for News items
/ccm-cms-types-newsitem.ftl
getLead(item: Node): StringReturns the lead text of the provided news item.
getMainText(item: Node): HtmlStringReturns the main text of the news item.
getNewsDate(item: Node): NodeReturns the date of the news. For formatting the date the formatDateTime function from the utils.ftl library can be used.
getNewsDateYear(item: Node): StringGets the value of the year property of the news date.
getNewsDateMonth(item: Node): StringGets the value of the month property of the news date.
getNewsDateDay(item: Node): StringGets the value of the Day property of the news date.
getNewsDateDayNameShort(item: Node): StringGets the value of the year property of the news date as short day name.
newsDateHour(item: Node): StringGets the value of the hour property of the news date.
newsDateMinute(item: Node): StringGets the value of the minute property of the news date.
newsDateSecond(item: Node): StringGets the value of the second property of the news date.
newsDateIso(item: Node): StringGets the date of the news as ISO date. # Freemarker functions for SiteProxy items
/ccm-cms-types-siteproxy.ftl
getContent(item: Node): ?Returns the content of the site proxy. The type of the return value depends on the external content the site proxy is showing. # Freemarker functions for retrieving data from the user banner component.
/ccm-core/user-banner.ftl
getGreeting(): StringRetrieves to the greeting value provided by the UserBanner component.
isLoggedIn(): booleanReturn true if the current user is logged and false otherwise.
isNotLoggedIn(): booleanReturn true if the current user is not logged and false otherwise.
getChangePasswordUrl(): StringReturns the URL where a authenticated user can change his or her password.
getLoginLink(): StringReturns the URL of the login page.
getLogoutLink(): StringReturns the URL for logging out.
getScreenName(): StringReturns the username of the current user. If the user is not authenticated the will return an empty string.
getUserGivenName(): StringReturns the given of the current user, if availabe. If the user is not authenticated the will return an empty string.
getUserFamilyName(): StringReturns the given of the current user, if availabe. If the user is not authenticated the will return an empty string.
/ccm-navigation/object-list.ftl
Many functions provided by this library have a parameter listId. In most cases the value is itemList.
getItems(listId: String): Sequence<Node>Returns the items in the object list with the provided ID.
getObjectCount(listId: String): numberReturns then number of objects in the object list with the provided ID.
getPagniatorBaseUrl(listId: String): StringGets the base URL of the list paginator.
getPaginatorBegin(listId: String): NumberReturns the index of the first item displayed.
getPaginatorEnd(listId: String): NumberReturns the index of the last item displayed.
getPageCount(listId: String): NumberGets the number of pages of the object list with the provided ID.
getPageNumber(listId: String): NumberGets the number of page displayed.
getPageParam(listId: String): StringGets the name of the page param for the object list with the provided ID.
getPageSize(listId: String): NumberGets the number of objects per page for the object list with the provided ID.
getPrevPageLink(listId: String): StringGets the link to the previous page of the object list with the provided ID.
getNextPageLink(listId: String): StringGets the link to the next page of the object list with the provided ID.
getFirstPageLink(listId: String): StringGets the link to the first page of the object list with the provided ID.
getLastPageLink(listId: String): StringGets the link to the last page of the object list with the provided ID.
getItemTitle(item: Node): StringGets the title of a list item.
getItemLead(item: Node): StringGets the lead text of a list item.
getItemProperty(item: Node, property: String): StringA generic function the get the value of the property with the name provided the property parameter.
hasImage(item: Node): booleanDetermines if the provided list item has an image attachment.
getImageId(item: Node): StringGets the ID of the image attachment of the provided list item.
getImageUrl(item: Node): StringGets the URL of the image attachment of the provided list item.
getImageCaption(item: Node): StringGets the caption of the image attachment of the provided list item.
getFilters(listId: String): Sequence<Node>Returns the filters for the current list.
getFilterLabel(filter: Node): StringGets the label of the provided filter.
getFilterType(filter: Node): StringGets the type of the provided filter.
getSelectFilterOptions(filter: Node): Sequence<Node>Returns the options of the select filter. If the provided filter is not a filter of the type select an empty sequence is returned.
getSelectFilterOptionLabel(option: Node): StringReturns the label of the provided filter.
getCategoryFilterSearchString(filter: Node): StringReturns the search string for the provided category filter.
getCategoryFilterSeparator(filter: Node): StringGets the separation character for the value of the provided category filter.
getCategoryFilterMultiple(filter: Node): booleanDetermines if the provided category allows multiple selections.
getCategoryFilterCategories(filter: Node): Sequence<Node>Returns the categories for the provided category filter.
getCategoryFilterCategoryGroups(filter: Node): Sequence<Node>Returns the category groups of the provided category filter.
getCategoryGroupLabel(group: Node): StringReturns the label of the provided category group.
getCategoryFilterCategoryGroupsCategories(groups: Sequence<Node>): Sequence<Node>Gets the categories of all category groups.
getCategoryFilterCategoryId(category: Node): StringGets the ID of the provided category of a category filter.
getCategoryFilterCategoryLabel(category: Node): StringGets the label of the provided category of a category filter.
/ccm-portalworkspace.ftl
getPortals(): Sequence<Node>Returns all available portals.
isSelected(portal: Node): booleanDetermines if the provided portal is selected.
getPortalLink(portal: Node): StringGets the link for selecting the provided portal.
getPortalTitle(portal: Node): StringReturns the title of the provided portal.
getPortalEditForm(): NodeReturns the edit form for the selected portal.
getPortalLayoutForm(): NodeReturns the form for editing the layout of the selected portal.
getAddPageLink(): StringReturns the link for adding another portal.
getBasicPropertiesLink(): StringGets the link for the basic properties of the selected portal.
getPortletsFromColumn(colNumber: String): Sequence<Node>Returns the portals in the column colNumber.
getWorkspacePrimaryUrl(): StringReturns the primary URL of the portal workspace.
getMovePortletLeftLink(portlet: Node): StringReturns the link for moving the provided portlet left.
getMovePortletRightLink(portlet: Node): StringReturns the link for moving the provided portlet right.
getMovePortletUpLink(portlet: Node): StringReturns the link for moving the provided portlet up.
getMovePortletDownLink(portlet: Node): StringReturns the link for moving the provided portlet down.
getCustomizePortletLink(portlet: Node): StringReturns the link for customizing the portlet.
getDeletePortletLink(portlet: Node): StringReturns the link for deleting the portlet. # Contributing to MathJax
So you're interested in giving us a hand? That's awesome! We've put together some brief guidelines that should help you get started quickly and easily.
There are lots and lots of ways to get involved, this document covers:
If you're about to raise an issue because you think you've found a problem with MathJax, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first.
The GitHub issue tracker is the preferred channel for bug reports, feature requests, change requests and submitting pull requests, but please respect the following restrictions:
Please search for existing issues. Help us keep duplicate issues to a minimum by checking to see if someone has already reported your problem or requested your idea.
Please do not use the issue tracker for personal support requests (use the MathJax User Group.
Please be civil. Keep the discussion on topic and respect the opinions of others. See also our Conduct Guidelines
A bug is a demonstrable problem that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
Guidelines for bug reports:
Use the GitHub issue search — check if the issue has already been reported.
Check if the issue has been fixed — try to reproduce it using the latest develop or look for closed issues in the current milestone.
Isolate the problem — ideally create a reduced test case and a live example.
Include a screencast if relevant - Is your issue about a design or front end feature or bug? The most helpful thing in the world is if we can see what you're talking about. Use LICEcap to quickly and easily record a short screencast (24fps) and save it as an animated gif! Embed it directly into your GitHub issue. Kapow.
Use the Bug Report template below or click this link to start creating a bug report with the template automatically.
A good bug report shouldn't leave others needing to chase you up for more information. Be sure to include the details of your environment.
Here is a real example
Template Example (click to use):
Short and descriptive example bug report title
### Issue Summary
A summary of the issue and the browser/OS environment in which it occurs. If
suitable, include the steps required to reproduce the bug.
### Steps to Reproduce
1. This is the first step
2. This is the second step
3. Further steps, etc.
Any other information you want to share that is relevant to the issue
being reported. Especially, why do you consider this to be a bug? What
do you expect to happen instead?
### Technical details:
* MathJax Version: 2.3 (latest commit: f3aaf3a2a3e964df2770dc4aaaa9c87ce5f47e2c)
* Client OS: Mac OS X 10.8.4
* Browser: Chrome 29.0.1547.57
Feature requests are welcome. Before you submit one be sure to have:
Change requests cover both architectural and functional changes to how MathJax works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to:
Pull requests are awesome. If you're looking to raise a PR for something which doesn't have an open issue, please think carefully about raising an issue which your PR can close, especially if you're fixing a bug. This makes it more likely that there will be enough information available for your PR to be properly tested and merged.
Need Help?
If you're not completely clear on how to submit / update / do Pull Requests, please check out our source control policies. For more insights, chech the excellent in depth Git Workflow guide from Ghost, in particular
Never underestimate just how useful quality assurance is. If you're looking to get involved with the code base and don't know where to start, checking out and testing a pull request is one of the most useful things you could do.
If you want to get involved with testing MathJax, there is a set of QA Documentation in our testing framework.
Essentially though, check out the latest develop branch, take it for a spin, and if you find anything odd, please follow the bug report guidelines and let us know!
These are some excellent instructions on configuring your GitHub repository to allow you to checkout pull requests in the same way as branches: https://gist.github.com/piscisaureus/3342247.
MathJax's main documentation can be found at docs.mathjax.org.
The documentation is generated using Sphinx-doc and hosted on Read the docs. The source of the docs is hosted in the MathJax-Docs GitHub repository.
You can clone the repo and submit pull requests following the pull-request guidelines.
If you wish to add or update translations of MathJax, please do it on TranslateWiki.net (and while you're there you can help other open source projects, too!).
For bug reports and other questions that don't fit on TranslateWiki.net, head over to the mathjax/mathjax-i18n repository.
We are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, disability, ethnicity, religion, or similar personal characteristic.
Please be kind and courteous. There's no need to be mean or rude. Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer, merely an optimal answer given a set of values and circumstances.
Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour. We interpret the term "harassment" as including the definition in the Citizen Code of Conduct; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the MathJax core team immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome.
We also suggest to read discourse's rules
MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers. It was designed with the goal of consolidating the recent advances in web technologies into a single, definitive, math-on-the-web platform supporting the major browsers and operating systems. It requires no setup on the part of the user (no plugins to download or software to install), so the page author can write web documents that include mathematics and be confident that users will be able to view it naturally and easily. Simply include MathJax and some mathematics in a web page, and MathJax does the rest.
Some of the main features of MathJax include:
High-quality display of LaTeX, MathML, and AsciiMath notation in HTML pages
Supported in most browsers with no plug-ins, extra fonts, or special setup for the reader
Easy for authors, flexible for publishers, extensible for developers
Supports math accessibility, cut-and-paste interoperability, and other advanced functionality
Powerful API for integration with other web applications
See http://www.mathjax.org/ for additional details.
The MathJax installation and usage documentation is available in the docs/html directory of the MathJax distribution (see docs/html/index.html for the starting point). The documents are also available on the MathJax web site on line at http://www.mathjax.org/resources/docs/.
The main MathJax website is http://www.mathjax.org, and it includes announcements and other important information. MathJax is maintained and distributed on GitHub at http://github.com/mathjax/MathJax. A user forum for asking questions and getting assistance is hosted at Google, and the bug tracker is hosted at GitHub:
Bug tracker: https://github.com/mathjax/MathJax/issues
MathJax-Users Group: http://groups.google.com/group/mathjax-users
Before reporting a bug, please check that it has not already been reported. Also, please use the bug tracker for reporting bugs rather than the help forum.
/ccm-sci-member-navigation.ftl
getSciMemberList(listId: String = "itemList"): NodeGets the member list. Default is to use the list with the name itemList. The name can be overridden using the optional listId parameter.
getMembers(list: Node): Sequence<Node>Returns the members in the provided list.
getSurnameFilterValue(list: Node): StringGets the value of the surname filter of the provided list.
getCount(list: Node): StringGets the number of items in the list.
getCurrentPage(list: Node): StringReturns the number of the current page of the list.
getLimit(list: Node): StringGets the maximum number of items per page.
getMaxPages(list: Node): StringReturns the number of pages.
getNextPageLink(list: Node): StringReturns the link to the next page of the list.
getPreviousPageLink(list: Node): StringReturns the link to the previous page of the list.
getOffset(list: Node): StringReturns the index of the items shown.
getMemberItemId(item: Node): StringReturns the ID of the provided member item.
getMemberItemName(item: Node): StringReturns the name of the provided member item.
getMemberItemTitle(item: Node): StringReturns the value of the title property of the provided member item.
getMemberItemSurname(item: Node): StringReturns the value of the surname property of the provided member item.
getMemberItemGivenName(item: Node): StringReturns the value of the given name property of the provided member item.
getMemberItemTitlePre(item: Node): StringReturns the value of the titlePre property of the provided member item.
getMemberItemTitlePost(item: Node): StringReturns the value of the titlePost property of the provided member item.
getMemberItemCotactEntries(item: Node): Sequence<Node>Gets the contact entries of the provided member item.
getMemberItemCotactEntry(item: Node, key: String): NodeGets the contact entry with the provided key of the provided member item.
/ccm-sci-project-navigation.ftl
getSciProjectList(listId: String = "itemList"): NodeReturns an project list. The list can be selected by the optional listId parameter. The default value for the parameter is itemList.
getProjects(list: Node): Sequence<Node>Returns the projects in a project list.
getTitleFilterValue(list: Node): StringGets the value of the title filter of the provided list.
getResearchFieldFilterValue(list: Node): StringReturns the value of the research field filter of the provided list.
getCount(list: Node): StringReturns the number of projects in the provided list.
getCurrentPage(list: Node): StringReturns the number of the current page of the list.
getLimit(list: Node): StringGets the maximum number of items per page.
getMaxPages(list: Node): StringGets the number of page of the provided list.
getNextPageLink(list: Node): StringGets the link to the next page of the provided list.
getPrevPageLink(list: Node): StringGets the link to the previous page of the provided list.
getOffset(list: Node): StringGets the index of the first item on the current page.
getProjectItemId(item: Node): StringReturns the ID of the provided project item.
getProjectItemName(item: Node): StringReturns the name of the provided project item.
getProjectItemTitle(item: Node): StringReturns the value of the title property of the provided project item.
getProjectItemObjectType(item: Node): StringReturns the value of the object type of the provided project item.
getProjectItemBegin(item: Node): StringReturns the value of the begin property of the provided project item.
getProjectItemBeginDay(item: Node): StringReturns the value of the day property of begin date of the provided project item.
getProjectItemBeginMonth(item: Node): StringReturns the value of the month property of begin date of the provided project item.
getProjectItemBeginYear(item: Node): StringReturns the value of the year property of begin date of the provided project item.
getProjectItemEnd(item: Node): StringReturns the value of the end property of the provided project item.
getProjectItemEndDay(item: Node): StringReturns the value of the day property of end date of the provided project item.
getProjectItemEndMonth(item: Node): StringReturns the value of the month property of end date of the provided project item.
getProjectItemEndYear(item: Node): StringReturns the value of the year property of end date of the provided project item.
getProjectItemShortDesc(item: Node): StringReturns the value of the short-desc property of the provided project item.
getProjectItemMembers(item: Node): Sequence<Node>Returns the members of the project.
getProjectMemberSurname(member: Node): StringReturns the surname of the provided member.
getProjectMemberGivenname(member: Node): StringReturns the given name of the provided member.
/ccm-sci-publications/article.ftl
This functions are for processing items of types ArticleInCollectedVolume, ArticleInJournal and InProceedings.
getHref(article: Node): StringGenerates the link to the detail view of the provided article item. # Freemarker functions for processing the authors of a publication item
/ccm-sci-publications/authors.ftl
Gets the link to the homepage of the author from the contact entries of the author. The key of the contact entry to use is selected using the keyId parameter.
getId(author: Node): StringReturns the ID of the author as a string usable as value of the id attribute of a HTML element. The returned string consists of the ID of the master version of the author item, and the name of the author, separated by an underscore.
getPosition(author: Node): StringReturns the position of provided author item in the sequence of authors.
Determines if the provided author is the last author in the sequence of authors.
getSurname(author: Node): StringGets the surname of the author.
getGivenName(author: Node): StringGets the given name of the author.
isEditor(author: Node): booleanDetermines if the provided author is an editor. # Freemarker functions for proccessing Collected Volume items
/ccm-sci-publications/collected-volume.ftl
getHref(collectedVolume: Node): StringReturns the link to the detail view of the provided collected volume item. # Freemarker functions for generating the exportLink links of an publication item
/ccm-sci-publications/export-links.ftl
getHref(exportLink: Node): StringReturns the URL for for the provided export link.
getFormatKey(exportLink: Node): StringGets the key of the format provided by the export link provided by the exportLink parameter.
getFormatName(exportLink: Node): StringGets the name of the format provided by the export link provided by the exportLink parameter. # Freemarker functions for Journal items
/ccm-sci-publications/journal.ftl
getFirstYear(journal: Node): StringGets the value of the firstYear property of the provided journal.
getHref(journal: Node): StringReturns the link to the detail view of the journal.
getIssn(journal: Node): StringGets the ISSN of the journal.
getIssn(journal: Node): StringGets the value of the lastYear property of the journal.
getTitle(journal: Node): StringReturns the title of the journal. # Freemarker functions for processing library signatures
/ccm-sci-publications/library-signatures.ftl
A library signature object contains the library signature (usually an alpha numeric code) and additional information.
getLibrary(signature: Node): StringReturns the the library of the signature.
getSignature(signature: Node): StringReturns the signature itself.
getLibraryLink(signature: Node): StringReturns the link to the homepage of the library.
getMisc(signature: Node): StringReturns the value of the misc property of the signature.
/ccm-sci-publications/orderer.ftl
getName(orderer: Node): StringGets the name of the orderer. # Freemarker functions of processing proceedings
/ccm-sci-publications/proceedings.ftl
getHref(proceedings: Node): StringGets the link to the detail view of the provided proceeedings item.
getPaperHref(paper: Node): StringReturns the link to the detail view of the provided paper. # Freemarker functions for native SQL based publication lists
/ccm-sci-publications-navigation.ftl
getSciPublicationsList(listId: String = "itemList"): NodeRetrieves a publications list. The list to use can be selected using the optional listId parameter.
getPublications(list: Node): Sequence<Node>Returns the publications of the provided publication list.
getTitleFilterValue(list: Node): StringReturns the value of the title filter of the provided publication list.
getYearOfPublicationFilterValue(list: Node): StringReturns the value of the year of publication filter of the provided publication list.
getAuthorsFilterValue(list: Node): StringReturns the value of the authors filter of the provided publication list.
getSort(list: Node): StringReturns the property which is used to sort the list.
getCount(list: Node): StringReturns the number of publications in the list.
getCurrentPage(list: Node): StringGets the number of the current page of the list.
getLimit(list: Node): StringReturns the maximum number of publications per page.
getMaxPages(list: Node): StringReturns the number of pages of the list.
getNextPageLink(list: Node): StringReturns the link to the next page of the list.
getNextPageLink(list: Node): StringReturns the link to the previous page of the list.
getOffset(list: Node): StringGets the index of the first publication of the current page.
Returns the ID of the provided publication item.
getPublicationObjectType(item: Node): StringReturns the type of the provided publication item.
getPublicationTitle(item: Node): StringReturns the title of the provided publication item.
getPublicationYear(item: Node): StringGets the year of publication of the publication.
getPublicationAuthors(item: Node): Sequence<Node>Gets the authors of the publication.
hasAuthorSurname(author: Node): booleanDetermines if the provided author has a surname.
getAuthorSurname(author: Node): StringGets the surname of the author.
hasAuthorGivenName(author: Node): booleanDetermines if the provided author has a given name.
getAuthorGivenName(author: Node): StringGets the given name of the author.
getPublicationPlace(item: Node): StringGets the value of the place property of the publication.
getPublicationOrganization(item: Node): NodeGetsh the organization assigned to a publication.
getPublicationOrganizationName(item: Node): StringGets the name of the organization.
getPublicationUnpublishedPlace(item: Node): StringGets the place of the publication of the type UnPublished.
getPublicationPublisher(item: Node): StringGets the publisher of the publication.
getPublisherPlace(item: Node): StringGets the place of the publisher.
getPublisherName(item: Node): StringGets the name of the publisher.
getPublicationJournal(item: Node): NodeGets the journal to which the publication is assigned.
getJournalName(journal: Node): StringGets the name of the journal.
getPublicationIssue(item: Node): StringGets the issue in which the publication was published.
hasPublicationVolumeOfJournal(item: Node): StringDetermines if the publication has a value for the volume property.
getPublicationVolumeOfJournal(item: Node): StringReturns the value of the volume property.
getPublicationPagesFrom(item: Node): StringGets the value of the pageFrom property.
getPublicationPagesTo(item: Node): StringGets the value of the pageTo property.
getPublicationCollectedVolume(item: Node): NodeGets the collected volume to which the publication is assigned.
getCollectedVolumeAuthors(collectedVolume: Node): Sequence<Node>Returns the authors/editors of the collected volume.
getCollectedVolumeTitle(collectedVolume: Node): StringReturns the title of the collected volume.
getCollectedVolumePublisher(collectedVolume: Node): NodeReturns the publisher of the collected volume.
getCollectedVolume(collectedVolume: Node): StringGets the place of the collected volume.
hasProceedings(item: Node): booleanDetermines if the publication has proceedings.
getProceedigns(item: Node): Sequence<Node>Returns the proceedings the publication.
/ccm-sci-publications/publications.ftl
getAssignedTermsDomains(item: Node, domain: String): Sequence<Node>Returns the categories from the category system with the name provided by the domain parameters which are assigned to the publication.
getAuthors(item: Node): Sequence<Node>Returns the authors of the publication.
getPublisher(item: Node): Sequence<Node>Returns the publisher of the publication.
getYearOfPublication(item: Node): Sequence<Node>Returns the year of publication.
getNumberOfPages(item: Node): StringGets the number of pages of the publication.
getNumberOfVolumes(item: Node): StringGets the number of volumes of the publication.
getVolume(item: Node): StringGets the value of the volume property of the publication.
getEdition(item: Node): StringGet the edition of the publication.
getIsbn(item: Node): StringGets the ISBN of the publication.
getLanguageOfPublication(item: Node): StringGets the language of the publication.
getSeries(item: Node): NodeGets the series to which the publication is assigned.
isReviewed(item: Node): booleanDetermines if the publication is reviewed.
getAbstract(item: Node): StringReturns the abstract of the publication.
getMisc(item: Node): StringReturns the value of the misc property of the publication.
getExportLinks(item: Node): Sequence<Node>Returns the export links for the publication.
getPlace(item: Node): StringReturns the value of the place property of the publication.
getPagesFrom(item: Node): StringReturns the value of the pagesFrom property of the publication.
getPagesTo(item: Node): StringReturns the value of the pagesTo property of the publication.
getNumber(item: Node): StringReturns the value of the number property of the publication.
getYearFirstPublished(item: Node): StringReturns the value of the yearFirstPublished property of the publication.
getLibrarySignatures(item: Node): Sequence<Node>Returns the library signatures assigned to a publication.
getOrganization(item: Node): NodeGets the organization assigned to a publication.
getOrderer(item: Node): NodeGets the orderer assigned to a publication.
getIssn(item: Node): NodeGets the ISSN of a publication.
getLastAccessed(item: Node): StringGets the value of the lastAccessed property of a publication.
getUrl(item: Node): StringGets the value of the url property of a publication.
getUrn(item: Node): StringGets the value of the urn property of a publication.
getDoi(item: Node): StringGets the value of the doi property of a publication.
getIssue(item: Node): StringGets the issue of a publication.
getJournal(item: Node): NodeGets the journal to which a publication is assigned.
getCollectedVolume(item: Node): NodeGets the collected volume to which a publication is assigned.
getChapter(item: Node): StringGets the value of the chapter property of a publication.
getNameOfConference(item: Node): StringGets the name of the conference.
getPlaceOfConference(item: Node): StringGets the place of the conference.
getDateFromConference(item: Node): DateNodeGets the start date of the conference.
getDateToConference(item: Node): DateNodeGets the end date of the conference.
getProceedings(item: Node): NodeGets the proceedings to which an publication is assigned.
getProceedingsPapers(item: Node): Sequence<Node>Gets the papers of a proceedings publication item.
getSeriesVolume(item: Node): StringGets the volume of the series for a publication.
getEvent(item: Node): StringGets the value of the event property of a publication of the type talk.
getDateOfTask(item: Node): DateNodeGets the value of the date property of a publication of the type talk.
/ccm-sci-publications/publisher.ftl
getName(publisher: Node): StringGets the name of a publisher.
getPlace(publisher: Node): StringGets the place of a publisher. # Freemarker functions for Series
/ccm-sci-publications/series.ftl
getFilters(series: Node): Sequence<Node>Returns the filters for list of publications of the series. The filters can be procesed by the functions provided for object list filters.
getLink(series: Node): StringReturns the link to the detail view of the series.
getName(series: Node): StringReturns the name of a series.
getVolume(series: Node): StringGets the value of the volume property.
getVolumeHref(volume: Node): StringGets a link to a volume of a series.
/ccm-sci-types-department.ftl
getDescription(data: Node): HtmlStringReturns the description of the department.
getShortDescription(data: Node): StringReturns the short description of the department.
getDepartmentHeads(data: Node): Sequence<Node>Gets the heads of the department.
getDepartmentHeadId(head: Node): StringGets the ID of a head of a department.
getDepartmentHeadLink(head: Node): StringGets the link to the detail view of head of a department.
getDepartmentViceHeads(data: Node): Sequence<Node>Gets the vice heads of the department.
getDepartmentViceHeadId(head: Node): StringGets the ID of a vice head of a department.
getDepartmentViceHeadLink(head: Node): StringGets the link to the detail view of vicehead of a department.
getDepartmentSecretariats(data: Node): Sequence<Node>Gets the secretariats of the department.
getDepartmentSecretariatId(sec: Node): StringGets the ID of a secretariats of a department.
getDepartmentSecretariatLink(sec: Node): StringGets the link to the detail view of secretariats of a department.
getProjects(data: Node): Sequence<Node>Returns the list of projects assigned to the department.
getProjectId(project: Node): StringGets the id of a project.
getProjectLink(project: Node): StringReturns the link to the detail view of a project.
/ccm-sci-types-institute.ftl
getDescription(data: Node): HtmlStringReturns the description of the institute.
getShortDescription(data: Node): StringReturns the short description of the institute.
getDepartments(data: Node): Sequence<Node>Returns the departments assigned to a institute.
getDepartmentOid(department: Node): StringGets the OID of a department.
getDepartmentTitle(department: Node): StringGets the title of a department.
getDepartmentLink(department: Node): StringReturns the link to the detail view of a department. # Freemarker functions for SciProject items
/ccm-sci-types-project.ftl
getBegin(item: Node): DateNodeReturns the begin date of the project. To format the date the formatDateTime function provided by ccm-themedirector should be used.
getEnd(item: Node): DateNodeReturns the end date of the project. To format the date the formatDateTime function provided by ccm-themedirector should be used.
getDescription(item: Node): HtmlStringGets the description of the project.
getShortDescription(item: Node): StringGets the short description of the project.
getSponsors(item: Node): Sequence<Node>Returns the sponsors of the project.
getSponsorName(sponsor: Node): StringReturns the name of the sponsor.
hasSponsorFundingCode(sponsor: Node): booleanDetermines if the sponsor has assigned a funding code to the project.
getSponsorFundingCode(sponsor: Node): StringReturns the funding code of the project assigned by the sponsor.
getSponsorLink(sponsor: Node): StringGets the link to the homepage of the sponsor.
hasFunding(item: Node): StringDetermines if the project has a text describing the funding of the project.
getFunding(item: Node): HtmlStringGets the text describing the funding of the project.
hasFundingVolume(item: Node): booleanDetermines if the project has a value for the fundingVolume property.
getFundingVolume(item: Node): StringReturns the value of the fundingVolume property.
getMembers(item: Node): Sequence<Node>Returns the members of the project.
getMemberRole(member: Node): StringGets the role of the member.
getMemberStatus(member: Node): StringGets the status of the member.
getMemberId(member: Node): StringGets the ID of the member.
getMemberLink(member: Node): StringGets a link to the detail view of the member.
getMemberSurname(member: Node): StringGets the surname of the member.
getMemberGivenName(member: Node): StringGets the given name of the member.
getMemberTitlePre(member: Node): StringGets the value of the titlePre property of the member.
getMemberTitlePost(member: Node): StringGets the value of the titlePost property of the member.
getInvolvedOrganizations(item: Node): Sequence<Node>Gets the organizations involved in the project.
getInvolvedOrganizationName(orga: Node): StringGets the name of the organization.
getInvolvedOrganizationLink(orga: Node): StringGets the link to the homepage of the organization. # Freemarker functions for subsites
/ccm-subsite.ftl
getSubsiteName(): StringReturns the name of the current subsite. # Freemarker functions for language related tasks.
Import Path :/ccm-themedirector/language.ftl
getAvailableLanguages(): Sequence<String>Returns the available languages for the current document as sequence. This sequence can be used for creating links for selecting the language:
<ul class="language-selector">
<#list Lang.getAvailableLanguages()?sort as lang>
<li class="${(lang==negotiatedLanguage)?then('selected', '')}">${lang}</li>
</#list>
</ul>
This example uses the list directive from Freemarker to iterate over the available languages returned by getAvailableLanguages The Freemarker build-in ?then is used together with the negotiatedLanguage variable to check if the curent language is the selected language. If this is the case a CSS class is added to the HTML.
Import Path :/ccm-themedirectory/utils.ftl
getPageApplication(): StringReturn the application of the current page.
getPageTitle(): StringReturn the title of the current page as provided by the Category Menu Component of the ccm-navigation module.
getSiteHostName(): StringReturns the host name of the CCM installation as provided by the SiteBanner component of the ccm-core module.
getSiteName(): StringReturns the host name of the CCM installation as provided by the SiteBanner component of the ccm-core module.
getBooleanAttrValue(fromNode: Node, attrName: String): booleanA helper function which tries to convert the value of the attribute attrName of the node fromNode to a boolean. The following values are interpreted as true: true, yes. All other values are interpreted as false.
formatDateTime(style: String, date: DateValueNode): StringFormats the value of date/time value node according to the provided style. The is defined in the theme manifest in the date-time-formats section. It is possible to define different styles for different languages. The style definition in the theme manifest must be in the format expected by the Java DateTimeFormatter class.
In the theme manifest in the following format is defined:
"date-time-formats": [
...
{
"style": "news",
"lang": "de",
"format": "dd.MM.YYYY"
},
{
"style": "news",
"lang": "en",
"format": "MM/dd/YY"
},
...
]
Each style must have a name. It is possible to have different patterns for a style for different languages. The pattern itself is provided by the format property. For a documentation of the pattern format please refer to the documentation of the Java DateTimeFormatter.
The second parameter of these function is a date value, at the moment this is an XML node if several attributes providing the year, month etc. of the date. This value is usually provided by special function for the specific content type. A typical usage of the formatDateTime function looks like this:
<span>${Utils.formatDateTime("standard", News.getNewsDate(item))}</span>
In this example the getNewsDate function was used to retrieve the date of a news.
News.getNewsDate gets the date of a news item. If the date of the news is 2019-04-01 the return value of the function for german is
01.04.2019
and for english:
4/1/19