From 39ff11d5d8d4d0adaed373294584270fcb2b973a Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 6 Jun 2019 17:59:16 +0000 Subject: [PATCH] Documentation for the Freemarker functions provided by ccm-cms-types-contact, ccm-cms-types-event, ccm-cms-types-externallink and ccm-cms-types-filestorageitem git-svn-id: https://svn.libreccm.org/ccm/trunk@6112 8810af33-2d31-482b-a856-94f89814c4df --- .../doc/freemarker/ccm-cms-types-contact.md | 32 ++++++ .../doc/freemarker/ccm-cms-types-event.md | 102 ++++++++++++++++++ .../themes/freemarker/ccm-cms-types-event.ftl | 1 - .../freemarker/ccm-cms-types-externallink.md | 20 ++++ .../ccm-cms-types-filestorageitem.md | 25 +++++ 5 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 ccm-cms-types-contact/doc/freemarker/ccm-cms-types-contact.md create mode 100644 ccm-cms-types-event/doc/freemarker/ccm-cms-types-event.md create mode 100644 ccm-cms-types-externallink/doc/freemarker/ccm-cms-types-externallink.md create mode 100644 ccm-cms-types-filestorageitem/doc/freemarker/ccm-cms-types-filestorageitem.md diff --git a/ccm-cms-types-contact/doc/freemarker/ccm-cms-types-contact.md b/ccm-cms-types-contact/doc/freemarker/ccm-cms-types-contact.md new file mode 100644 index 000000000..9be665e89 --- /dev/null +++ b/ccm-cms-types-contact/doc/freemarker/ccm-cms-types-contact.md @@ -0,0 +1,32 @@ +# Freemarker functions for Contact items + +Import path +: `/ccm-cms-types-contact.ftl` + +## `getAddress(item: Node): Node` + +Returns 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): Node` + +Returns 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` + +Returns the contact entries of the provided contact. + +## `getContactEntry(item: Node, keyId: String): Node` + +Returns the contact entry with the provided `keyId` if the provided contact has a matching contact entry. If not `null` is returned. + +## `getContactEntryLabel(entry: Node): String` + +Returns the label of the provided contact entry. + +## `getContactEntryValue(entry: Node): String` + +Returns the value of the provided contact entry. \ No newline at end of file diff --git a/ccm-cms-types-event/doc/freemarker/ccm-cms-types-event.md b/ccm-cms-types-event/doc/freemarker/ccm-cms-types-event.md new file mode 100644 index 000000000..6240f9dd9 --- /dev/null +++ b/ccm-cms-types-event/doc/freemarker/ccm-cms-types-event.md @@ -0,0 +1,102 @@ +# Freemarker functions for Event items + +Import path +: `/ccm-cms-types-event.ftl` + +## `getLead(item: Node): String` + +Returns the lead text of the event. + +## `getMainText(item: Node): String` + +Returns the main text of the event. + +## `getEndDate(item: Node): DateTimeNode` + +Returns 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): String` + +Returns the year part of the end date of the event. + +## `getEndDateMonth(item: Node): String` + +Returns the month part of the end date of the event. + +## `getEndDateShortMonth(item: Node): String` + +Returns the the short name of month part of the end date of the event. + +## `getEndTime(item: Node): String` + +Gets the end time of the event. + +## `getEndTimeHour(item: Node): String` + +Gets the hour part of the end time of the event. + +## `getEndTimeMinute(item: Node): String` + +Gets the minute part of the end time of the event. + +## `getEndTimeSecond(item: Node): String` + +Gets the second part of the end time of the event. + +## `getStartDate(item: Node): DateTimeNode` + +Returns 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): String` + +Returns the year part of the start date of the event. + +## `getStartDateMonth(item: Node): String` + +Returns the month part of the start date of the event. + +## `getStartDateShortMonth(item: Node): String` + +Returns the the short name of month part of the start date of the event. + +## `getStartTime(item: Node): String` + +Gets the start time of the event. + +## `getStartTimeHour(item: Node): String` + +Gets the hour part of the start time of the event. + +## `getStartTimeMinute(item: Node): String` + +Gets the minute part of the start time of the event. + +## `getStartTimeSecond(item: Node): String` + +Gets the second part of the start time of the event. + +## `getLocation(item: Node): String` + +Gets the location of the event. + +## `getMainContributor(item: Node): String` + +Gets the value of the `mainContributor` property of the event. + +## `getEventType(item: Node): String` + +Returns the value of the `eventType` property of the event. + +## `getCost(item: Node): String` + +Returns the value of the `cost` property of the event. + +## `getMapLink(item: Node): String` + +Returns the value of the `mapLink` property of the event. + +## `getEventDateAddendum(item: Node): String` + +Returns the value of the addendum property of the event. \ No newline at end of file diff --git a/ccm-cms-types-event/web/themes/freemarker/ccm-cms-types-event.ftl b/ccm-cms-types-event/web/themes/freemarker/ccm-cms-types-event.ftl index ec6d0d4e4..b7e96896b 100644 --- a/ccm-cms-types-event/web/themes/freemarker/ccm-cms-types-event.ftl +++ b/ccm-cms-types-event/web/themes/freemarker/ccm-cms-types-event.ftl @@ -15,7 +15,6 @@ <#return Article.getMainText(item)> - <#function getEndDate item> <#if (item["./endDate"]?size > 0)> <#return item["./endDate"]> diff --git a/ccm-cms-types-externallink/doc/freemarker/ccm-cms-types-externallink.md b/ccm-cms-types-externallink/doc/freemarker/ccm-cms-types-externallink.md new file mode 100644 index 000000000..6662fab6e --- /dev/null +++ b/ccm-cms-types-externallink/doc/freemarker/ccm-cms-types-externallink.md @@ -0,0 +1,20 @@ +# Freemarker functions for ExternalLink items + +Import path +: `/ccm-cms-types-externallink.ftl` + +## `getDescription(item: Node): String` + +Gets the description of the external link item. + +## `getComment(item: Node): String` + +Gets the value of the `comment` property of the link item. + +## `isTargetNewWindow(item: Node): String` + +Returns `true` if the link should be opened in a new window/tab. + +## `getUrl(item: Node): String` + +Returns the URL of the external link. \ No newline at end of file diff --git a/ccm-cms-types-filestorageitem/doc/freemarker/ccm-cms-types-filestorageitem.md b/ccm-cms-types-filestorageitem/doc/freemarker/ccm-cms-types-filestorageitem.md new file mode 100644 index 000000000..02e172985 --- /dev/null +++ b/ccm-cms-types-filestorageitem/doc/freemarker/ccm-cms-types-filestorageitem.md @@ -0,0 +1,25 @@ +# Freemarker functions for File Storage Items + +Import path +: `/ccm-cms-types-filestorageitem.ftl` + +## `getDescription(item: Node): String` + +Gets the description of the file storage item. + +## `getFileId(item: Node): String` + +Returns the ID for the file represented by the file storage item. + +## `getFileName(item: Node): String` + +Returns the name of the file represented by the file storage item. + +## `getFileLink(item: Node, mode: String="download", useFileName: boolean = true): String` + +Returns 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`. \ No newline at end of file