AnsweredAssumed Answered

Issue wit Atom response file for listing folders in Alfresco

Question asked by suryabadami on Feb 29, 2012
Latest reply on Mar 13, 2012 by mitpatoliya
My response file for listing the folders in Alfresco looks like this (folder.get.atom)

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <generator version="${server.version}">Alfresco (${server.edition})</generator>
  <title>Folder: ${folder.displayPath}/${folder.name?xml}</title>
  <updated>${xmldate(date)}</updated>
  <icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
<#list folder.children as child>
  <entry>
    <title>${child.name?xml}</title>
    <#if child.isContainer>
      <link rel="alternate" href="${absurl(url.serviceContext)}/sample/folder<@encodepath node=child/>"/>
    <#else>
      <link rel="alternate" href="${absurl(url.serviceContext)}/api/node/content/${child.nodeRef.storeRef.protocol}/${child.nodeRef.storeRef.identifier}/${child.nodeRef.id}/${child.name?url}"/>
    </#if>
    <icon>${absurl(url.context)}${child.icon16}</icon>
    <id>urn:uuid:${child.id}</id>
<updated>${xmldate(child.properties.modified)}</updated>
    <summary>${child.properties.description?xml!""}</summary>
    <author>
      <name>${child.properties.creator?xml}</name>
    </author>
  </entry>
</#list>
</feed>
<#macro encodepath node><#if node.parent?exists><@encodepath node=node.parent/>/${node.name?url}</#if></#macro>
*************************************************************************************************************************************************************************************
Discription file (folder.get.desc.xml)

<webscript>
<shortname>Folder Listing Sample</shortname>
<description>
Sample demonstrating the listing of folder contents
</description>
<url>/sample/folder/{path}</url>
<format default="html">argument</format>
<authentication>guest</authentication>
<transaction>required</transaction>
</webscript>
*************************************************************************************************************************************************************************************
When i invoke this webscript http://localhost:8080/alfresco/service/sample/folder/Company%20Home?format=atom , it displays the XML response file as expected.
I want to define properties in folder.get.atom for child so that i get XML response file even for the child.

Mean to say when i invoke websrcipt using URL http://localhost:8080/alfresco/service/sample/folder/Company%20Home/Sites(Any child)?format=atom , i want to get same Xml format of response.

Please guide me with the changes(adding properties for every child) in the code  folder.get.atom to make it work in generic.

Outcomes