<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Keeping your Alfresco web scripts DRY</title>
	<atom:link href="http://ecmarchitect.com/archives/2009/06/01/994/feed" rel="self" type="application/rss+xml" />
	<link>http://ecmarchitect.com/archives/2009/06/01/994</link>
	<description>Jeff Potts on ECM, portals, search, collaboration, and a bunch of personal stuff</description>
	<lastBuildDate>Fri, 30 Jul 2010 09:25:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Krista</title>
		<link>http://ecmarchitect.com/archives/2009/06/01/994/comment-page-1#comment-49229</link>
		<dc:creator>Krista</dc:creator>
		<pubDate>Wed, 31 Mar 2010 16:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://ecmarchitect.com/?p=994#comment-49229</guid>
		<description>Ok... my code didn&#039;t show up previously, let&#039;s try again:

Hi Jeff,

I have a question with this. I am trying to refactor a web script I wrote and I want to use FTL macros to do this. I started with a very simple one to see how it went.

I have a macro in a file called: getPageTitle.lib.ftl that contains the following:
&lt;#macro getPageTitle currentPage&gt;
	${currentPage[&quot;ra:pagetitle&quot;]}
&lt;/#macro&gt;


In my .html.ftl file for the web script, I have the following:

&lt;#import &quot;getPageTitle.lib.ftl&quot; as pageTitleLib /&gt;
...

&lt;#list layoutDom[&quot;ra:layout/ra:page&quot;] as page&gt;
   ...
      &lt;@pageTitleLib.getPageTitle currentPage = page /&gt;


When I run the web script, I get an error saying, &quot;Error on line 2, column 11 in Prototype 1/entryFormCreator/getPageTitle.lib.ftl Expecting a string, date or number here, Expression currentPage[&quot;ra:pagetitle&quot;] is instead a freemarker.ext.dom.NodeListModel&#8217;. Please contact your system administrator.&quot;

I think that when I pass the &quot;page&quot; value, it is sending all the pages instead of just the single page I want.

When I put the macro inside the file and call it without importing, everything works as expected.

The web script files and the getPageTitle.lib.ftl all live in the same Space in the Alfresco repository under Company Home/ Data Dictionary/Web Scripts Extensions.

What do you think is causing the problem?

Any help would be great.

Thanks!
Krista</description>
		<content:encoded><![CDATA[<p>Ok&#8230; my code didn&#8217;t show up previously, let&#8217;s try again:</p>
<p>Hi Jeff,</p>
<p>I have a question with this. I am trying to refactor a web script I wrote and I want to use FTL macros to do this. I started with a very simple one to see how it went.</p>
<p>I have a macro in a file called: getPageTitle.lib.ftl that contains the following:<br />
&lt;#macro getPageTitle currentPage&gt;<br />
	${currentPage["ra:pagetitle"]}<br />
&lt;/#macro&gt;</p>
<p>In my .html.ftl file for the web script, I have the following:</p>
<p>&lt;#import &#8220;getPageTitle.lib.ftl&#8221; as pageTitleLib /&gt;<br />
&#8230;</p>
<p>&lt;#list layoutDom["ra:layout/ra:page"] as page&gt;<br />
   &#8230;<br />
      &lt;@pageTitleLib.getPageTitle currentPage = page /&gt;</p>
<p>When I run the web script, I get an error saying, &#8220;Error on line 2, column 11 in Prototype 1/entryFormCreator/getPageTitle.lib.ftl Expecting a string, date or number here, Expression currentPage["ra:pagetitle"] is instead a freemarker.ext.dom.NodeListModel&#8217;. Please contact your system administrator.&#8221;</p>
<p>I think that when I pass the &#8220;page&#8221; value, it is sending all the pages instead of just the single page I want.</p>
<p>When I put the macro inside the file and call it without importing, everything works as expected.</p>
<p>The web script files and the getPageTitle.lib.ftl all live in the same Space in the Alfresco repository under Company Home/ Data Dictionary/Web Scripts Extensions.</p>
<p>What do you think is causing the problem?</p>
<p>Any help would be great.</p>
<p>Thanks!<br />
Krista</p>
]]></content:encoded>
	</item>
</channel>
</rss>
