Preliminary migration of various FTL function libs for

assets/attachments.
ccm-docs
Jens Pelzetter 2019-12-21 19:09:36 +01:00
parent 56ba381833
commit 7b6fb22a1e
7 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<#--filedoc
Provides functions for processing the image attachemnts of a content item.
@depcrecated Use ccm-cms/image-attachments.ftl instead
-->
<#import "/ccm-cms/image-attachments.ftl" as ImageAttachments>
<#--doc
Creates a sorted sequence of hashes (see Freemarker docuementation) for the
image attachments of a content item.
@param item The model of the content item to use.
@return The images attached to the item.
-->
<#function getImageAttachments item>
<#return ImageAttachments.getImageAttachments(item)>
</#function>

View File

@ -0,0 +1,21 @@
<#--filedoc
Functions for processing note attachments.
@depcrecated Use ccm-cms/sidenote-attachments instead
-->
<#import "/ccm-cms/sidenote-attachments" as SideNotes>
<#--doc
Generates a sorted sequence of hashes (see Freemarker documentation) for
the note attachments of a content item.
@param item The model of the content item to use.
@return The side notes attached to the item.
-->
<#function getNotes item>
<#return item.sideNotes>
</#function>

View File

@ -0,0 +1,58 @@
<#--filedoc
Functions for processing related links.
@depcrecated Use ccm-cms/relatedlink-attachments.ftl instead
-->
<#import "/ccm-cms/relatedlink-attachments.ftl" as RelatedLinks>
<#--doc
Generates a sorted sequence of hashes (see Freemarker documentation)
from the related links of a content item.
@param item The model of the content item to use.
@param linkListName: The name of the link list to use.
@return The links attached to the provided item.
-->
<#function getRelatedLinks item linkListName="NONE">
<#return RelatedLinks.getRelatedLinks(item linkListName)>
<#-- <#return item["./links[./linkListName='${linkListName}']"]?sort_by("linkOrder")> -->
</#function>
<#--doc
*Internal* function for determing the type a related link.
@param link The link
@return The type of the link. Either `externalLink`, `internalLink` or `caption`.
-->
<#function _getLinkType link>
<#return RelatedLinks.:_getLinkType(link)>
</#function>
<#--doc
*Internal* function for getting parameters for the link.
@param link The link
@return Parameters for an internal link.
-->
<#function _getInternalLinkParameters link>
<#return RelatedLinks._getInternalLinkParameters(link)>
</#function>
<#--doc
*Internal* function for constructing the target URI of a related link.
@param link The link model to use.
@return The URL for the target of the link.
-->
<#function _getTargetUri link>
<#return RelatedLinks._getTargetUri(link)>
</#function>

View File

@ -0,0 +1,16 @@
<#--filedoc
Provides functions for processing the image attachemnts of a content item.
-->
<#--doc
Creates a sorted sequence of hashes (see Freemarker docuementation) for the
image attachments of a content item.
@param item The model of the content item to use.
@return The images attached to the provided item.
-->
<#function getImageAttachments item>
<#return item.imageAttachments>
</#function>

View File

@ -0,0 +1,51 @@
<#--filedoc
Functions for processing related links.
-->
<#--doc
Generates a sorted sequence of hashes (see Freemarker documentation)
from the related links of a content item.
@param item The model of the content item to use.
@param linkListName: The name of the link list to use.
@return The links attached to the provided item.
-->
<#function getRelatedLinks item linkListName="NONE">
<#return item.relatedLinks[linkListName]>
</#function>
<#--doc
*Internal* function for determing the type a related link.
@param link The link
@return The type of the link..
-->
<#function _getLinkType link>
<#return link.type>
</#function>
<#--doc
*Internal* function for getting parameters for the link.
@param link The link
@return Parameters for an internal link.
-->
<#function _getInternalLinkParameters link>
<#return link.parameters>
</#function>
<#--doc
*Internal* function for constructing the target URI of a related link.
@param link The link model to use.
@return The URL for the target of the link.
-->
<#function _getTargetUri link>
<#return link.targetUri>
</#function>

View File

@ -0,0 +1,17 @@
<#--filedoc
Functions for processing note attachments.
-->
<#--doc
Generates a sorted sequence of hashes (see Freemarker documentation) for
the note attachments of a content item.
@param item The model of the content item to use.
@return The side notes attached to the item.
-->
<#function getNotes item>
<#returm item.sideNotes>
</#function>

1
ccm-editor/.gitignore vendored 100644
View File

@ -0,0 +1 @@
*.tmp.txt