Publishing an xml file

I would really appreciate thoughts/approaches for my task…

I have a content type A, with a page template(which publishes a html file) associated to it. One of my task is to publish one big XML file with all the content items of Content type A. And also, when ever any item of content type A is update/added/removed, this xml file should be published. How can i implement this? Any solutions/suggestions?

Paddy

An autoindexer to index that content type with an xml page template seems like a potential solution…

Thank you Jitendra. Could you give me more details. Not sure how to implement what you proposed.

Paddy

Do you have multiple sites or a single site that you want to display content type A?
Let us assume that you have one site.

So you would create a new auto indexer content type. In the auto index slot, you would setup the query to be something like:

SELECT rx:sys_contentid, rx:sys_contentstartdate FROM rx:mycontenttypeA WHERE jcr:path like ‘//Sites/my_site’ ORDER BY rx:sys_contentstartdate

You can set parameters in that query if you want (view the rffAuto* as examples).

Next you would create a template that would publish an xml doc (if you don’t want to create a snippet template, you can just create a single page template and initialize the slot yourself).

I realize these are very generic directions, but hope it gets you going in the correct direction…

[QUOTE=Paddy;20596]I would really appreciate thoughts/approaches for my task…

I have a content type A, with a page template(which publishes a html file) associated to it. One of my task is to publish one big XML file with all the content items of Content type A. And also, when ever any item of content type A is update/added/removed, this xml file should be published. How can i implement this? Any solutions/suggestions?

Paddy[/QUOTE]

Here is a small example based on the rffSnAutoBulletList sample snippet in Enterprise Investments. You’d want a page template for this to publish.

<?xml version="1.0"?>
<press>
#initslot($slotname "site_path=$sitepath")##
#foreach($rel in $sys.currentslot.relresults)##
	<article id="$rel.getNode().getProperty("sys_contentid").getString()">
		<title>$rel.getNode().getProperty("displaytitle").getString()</title>
	</article>
#end##
#endslot($slotname)##
 </press>

Change the suffix property of the template to xml and the mime/type property to “text/xml”