On 5/12/10 2:43 PM, Tony Giaccone wrote:
> 
> 
> 
> I see from the demonstration deliverable, that you can easily get out json 
> representation of the data you pushed in. 
> 
> 
> From the example you put in  using curl you get back:
> 
> {"title":"Another 
> Title","sling:resourceType":"foo/bar","jcr:primaryType":"nt:unstructured"}
> 
> So a few  quick questions. Is there a template that's transforming to json in 
> the same way that the you enter the html and get back info in the transaction 
> from document to html view? 
Not exactly. There's a servlet which outputs JSON. The key class is
org.apache.sling.servlets.get.impl.helpers.JsonResourceWriter which
assembles the JSON object graph from a resource.

> 
> 
> Is there a way to get the same information out in XML?  I realize there's a 
> bit of a problem as some of the tags like "sling:resource" are going to 
> create complications as tag names in XML. So I guess I'm asking is there a 
> basic Doc to XML transaction, and is it customizable?  Or is that something I 
> would need to develop using on of the transform templates (jsp for example?)
Yes. Just us .xml as the extension. By default, this uses the JCR
Document View, but can use System View instead by using the selector
sysview.

Both of these default servlets can be overridden by registering
scripts/servlets.

Justin


> 
> 
> Tony Giaccone

Reply via email to