AnsweredAssumed Answered

Getting a list of spaces under a specified web project

Question asked by cmorrison on Sep 28, 2009
Hello,

I'm using alfresco 3.0 community and trying to programatically get a list of folders under 'Company Home/Web Projects/MyWebProject'.  I am trying to do this in freemarker which will run when a webform generates its renditions.

Here is a list of my failed attempts:
<#list companyhome.childrenByXPath["*[@cm:name='Web Projects']/*[@cm:name='MyWebProject']/*"] as child>
<#list companyhome.children as child>
<#list companyhome.childByNamePath["Web Projects/MyWebProject"].children as child>
<#list avm.webappsFolderPath["MyWebProject"].children as child>
<#list avm.lookupNode("/").children as child>
<#assign search="TYPE:\"{http://www.alfresco.org/model/wcmmodel/1.0}webfolder\""><#list companyhome.childrenByLuceneSearch[search] as wp>

Within the list I was outputting ${child.properties.name} to see if I could get it to work.  All the attempts above either failed with an error message or didn't generate any output.

A lot of these come from mixing up examples on these two pages:
- http://wiki.alfresco.com/wiki/FreeMarker_Template_Cookbook
- http://wiki.alfresco.com/wiki/Template_Guide#AVM

I also tried the code from this page verbatim just to see if I would get any nodes listed under MyWebProject/: http://wiki.alfresco.com/wiki/Example_Recursive_Template.

Still no luck.  Can someone point me in the right direction or point out my flaw with the above.

Thanks

Chuck

Outcomes