<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 01:11:08 CET 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[DOCU-650] cmsfn examples</title>
                <link>https://jira.magnolia-cms.com/browse/DOCU-650</link>
                <project id="10190" key="DOCU">Documentation</project>
                    <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;These examples don&apos;t seemed to execute at all:&lt;/p&gt;

&lt;p&gt;cmsfn.asNodeList(contentMapList)&lt;/p&gt;

&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;#assign myMapList = cmsfn.children(content, &amp;quot;mgnl:page&amp;quot;)&amp;#93;&lt;/span&gt;&lt;br/&gt;
  &lt;a href=&quot;#list cmsfn.asNodeList(myMapList) as child&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;list cmsfn.asNodeList(myMapList) as child&lt;/a&gt;&lt;br/&gt;
    ${cmsfn.parent(child)!},&lt;br/&gt;
  &lt;a href=&quot;#list&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;/#list&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;cmsfn.children(content, nodeTypeName)&lt;/p&gt;

&lt;p&gt;&amp;lt;ul&amp;gt;&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;#list cmsfn.children(content, &amp;quot;mgnl:page&amp;quot;) as child &amp;#93;&lt;/span&gt;&lt;br/&gt;
    &amp;lt;li&amp;gt;${child.title!}&amp;lt;/li&amp;gt;&lt;br/&gt;
&lt;a href=&quot;#list&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;/#list&lt;/a&gt;&lt;br/&gt;
&amp;lt;/ul&amp;gt;&lt;/p&gt;



&lt;p&gt;This one generates the error below:&lt;/p&gt;

&lt;p&gt;cmsfn.asContentMapList(nodeList)&lt;/p&gt;

&lt;p&gt;[#assign childrenNodesAsContentMaps = cmsfn.asContentMapList(cmsfn.children(currentNode, &lt;/p&gt;

&lt;p&gt;&quot;mgnl:page&quot;))]&lt;br/&gt;
&lt;a href=&quot;#list childrenNodesAsContentMaps as child&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;list childrenNodesAsContentMaps as child&lt;/a&gt;&lt;br/&gt;
  ${child.title!},&lt;br/&gt;
&lt;a href=&quot;#list&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;/#list&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Error (abridged):&lt;/p&gt;

&lt;p&gt;No compatible overloaded variation was found; declared parameter types and argument value types &lt;/p&gt;

&lt;p&gt;mismatch.&lt;br/&gt;
The FTL type of the argument values were: Null, string (wrapper: f.t.SimpleScalar).&lt;br/&gt;
The Java type of the argument values were: Null, String.&lt;br/&gt;
The matching overload was searched among these members:&lt;br/&gt;
    info.magnolia.templating.functions.TemplatingFunctions.children(javax.jcr.Node, String),&lt;br/&gt;
    info.magnolia.templating.functions.TemplatingFunctions.children&lt;/p&gt;

&lt;p&gt;(info.magnolia.jcr.util.ContentMap),&lt;br/&gt;
    info.magnolia.templating.functions.TemplatingFunctions.children(javax.jcr.Node),&lt;br/&gt;
    info.magnolia.templating.functions.TemplatingFunctions.children&lt;/p&gt;

&lt;p&gt;(info.magnolia.jcr.util.ContentMap, String)&lt;/p&gt;


&lt;p&gt;Caused by: freemarker.core._TemplateModelException: No compatible overloaded variation was found; &lt;/p&gt;

&lt;p&gt;declared parameter types and argument value types mismatch.&lt;br/&gt;
The FTL type of the argument values were: Null, string (wrapper: f.t.SimpleScalar).&lt;br/&gt;
The Java type of the argument values were: Null, String.&lt;/p&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Failed at: #assign childrenNodesAsContentMaps = ...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment></environment>
        <key id="49255">DOCU-650</key>
            <summary>cmsfn examples</summary>
                <type id="10" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10880&amp;avatarType=issuetype">Magnolia Malfunction</type>
                                            <priority id="3" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="11">Done</resolution>
                                        <assignee username="ahietala">Antti Hietala</assignee>
                                    <reporter username="lemoreno">Luis Moreno</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Dec 2015 21:22:23 +0100</created>
                <updated>Mon, 4 Jan 2016 15:44:29 +0100</updated>
                            <resolved>Mon, 14 Dec 2015 08:57:51 +0100</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="118228" author="ahietala" created="Fri, 11 Dec 2015 18:23:39 +0100"  >&lt;p&gt;Hi Luis,&lt;/p&gt;

&lt;p&gt;The cmsfn examples work but require a little bit setup. Let&apos;s look at them one by one.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;1.Convertcontentmapcollectiontonodelisthttps%3A%2F%2Fdocumentation.magnoliacms.com%2Fdisplay%2FDOCS%2Fcmsfn%23cmsfnConvertcontentmapcollectiontonodelist&quot;&gt;&lt;/a&gt;1. &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/cmsfn#cmsfn-Convertcontentmapcollectiontonodelist&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Convert content map collection to node list&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Put the example code into a page template script. You can use for example the &lt;tt&gt;hello.ftl&lt;/tt&gt; script which you can download with the &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/Hello+Magnolia#HelloMagnolia-Option2:Downloadthecompleteexample&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Hello Magnolia&lt;/a&gt; tutorial.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
[#assign myMapList = cmsfn.children(content, &lt;span class=&quot;code-quote&quot;&gt;&quot;mgnl:page&quot;&lt;/span&gt;)]
[#list cmsfn.asNodeList(myMapList) as child]
  ${cmsfn.parent(child)!},
[/#list]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create a page structure where your page has a parent page and some child pages:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
home                &amp;lt;--- Parent page
   &#9492;&#9472;&#9472; animals      &amp;lt;--- Execute the code in &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; page template
      &#9500;&#9472;&#9472; cats    &amp;lt;--- Child pages
      &#9500;&#9472;&#9472; dogs
      &#9492;&#9472;&#9472; monkeys
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What happens in the code:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Build a content map collection of the current page&apos;s (animals) children (cats, dogs, monkeys)&lt;/li&gt;
	&lt;li&gt;Convert the map to a node list.&lt;/li&gt;
	&lt;li&gt;Find each node&apos;s parent, which is the same for all nodes: animals&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Expected result:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;node /home/animals, node /home/animals, node /home/animals,&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;&lt;a name=&quot;2.Childrenhttps%3A%2F%2Fdocumentation.magnoliacms.com%2Fdisplay%2FDOCS%2Fcmsfn%23cmsfnChildren&quot;&gt;&lt;/a&gt;2. &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/cmsfn#cmsfn-Children&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Children&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Probably the same issue with this example. The page where you run the script must have subpages and the subpages need to have titles. Otherwise the example doesn&apos;t render anything.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;ul&amp;gt;
[#list cmsfn.children(content, &lt;span class=&quot;code-quote&quot;&gt;&quot;mgnl:page&quot;&lt;/span&gt;) as child ]
    &amp;lt;li&amp;gt;${child.title!}&amp;lt;/li&amp;gt;
[/#list]
&amp;lt;/ul&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected result:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
	&lt;li&gt;Cats&lt;/li&gt;
	&lt;li&gt;Dogs&lt;/li&gt;
	&lt;li&gt;Monkeys&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3&gt;&lt;a name=&quot;3.Convertnodecollectiontocontentmaplisthttps%3A%2F%2Fdocumentation.magnoliacms.com%2Fdisplay%2FDOCS%2Fcmsfn%23cmsfnConvertnodecollectiontocontentmaplist&quot;&gt;&lt;/a&gt;3. &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/cmsfn#cmsfn-Convertnodecollectiontocontentmaplist&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Convert node collection to content map list&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Your example seems to be missing the first line where we assign &lt;tt&gt;currentNode&lt;/tt&gt;. Try adding that line and run again.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
[#assign currentNode = cmsfn.asJCRNode(content)]
[#assign childrenNodesAsContentMaps = cmsfn.asContentMapList(cmsfn.children(currentNode, &lt;span class=&quot;code-quote&quot;&gt;&quot;mgnl:page&quot;&lt;/span&gt;))]
[#list childrenNodesAsContentMaps as child ]
  ${child.title!},
[/#list]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected result:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Cats, Dogs, Monkeys,&lt;/p&gt;&lt;/blockquote&gt;</comment>
                            <comment id="118596" author="lemoreno" created="Tue, 22 Dec 2015 20:44:04 +0100"  >&lt;p&gt;Thanks Antti,&lt;/p&gt;

&lt;p&gt;Number 1 might be worth mentioning in the docs that it only works in that location as it isn&apos;t intuitive to deduced that functionality. &lt;/p&gt;

&lt;p&gt;Number 2 and 3 only work for me with Hello Magnolia. But my page structure is a bit more complex.&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;home
   &#9492;&#9472;&#9472; animals
     |  &#9500;&#9472;&#9472; cats
     |  &#9500;&#9472;&#9472; dogs
     |  &#9492;&#9472;&#9472; monkey
     |
     &#9492;&#9472;&#9472; fish      
    |  &#9500;&#9472;&#9472; catfish    
    |  &#9500;&#9472;&#9472; dolphin
    |  &#9492;&#9472;&#9472; sharks
    |
    &#9492;&#9472;&#9472; birds      
      &#9500;&#9472;&#9472; bluejays    
      &#9500;&#9472;&#9472; doves
      &#9492;&#9472;&#9472; cardinals

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                            <comment id="118850" author="ahietala" created="Mon, 4 Jan 2016 15:44:29 +0100"  >&lt;p&gt;Added some help for &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/cmsfn#cmsfn-Runningtheexamples&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Running the examples&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>hotmail.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 11 Dec 2015 18:23:39 +0100</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ahietala</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 6 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>ahietala</customfieldvalue>
            <customfieldvalue>lemoreno</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i05hvb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>