Expand my Community achievements bar.

SOLVED

Get jcr:data for images

Avatar

Level 2

Hi , 

I have a question.

using url : http://localhost:4502/content/dam/FinanceCorp/en_US/img.xml , I am able to fetch jcr:data (base64String format of image) for each image

This takes time to load all the data.

But, If I use url :  http://localhost:4502/content/dam/FinanceCorp/en_US/img.infinity.json , I am able to fetch data similar to xml format but , for images , the jcr:data does not have any base64String data that represents the image..

How can I retrieve the jcr:data(base64String)for image in json reqeust too?

 

Hope you understand my question

Example :

xml format

<cq5dam.thumbnail.140.100.png jcr:primaryType="nt:file" jcr:created="2011-12-20T15:57:21.905-08:00" jcr:createdBy="system">
<jcr:content jcr:primaryType="nt:resource" jcr:uuid="30ec7f42-ab4c-4c3e-8181-20237dfd8f84"jcr:data="iVBORw0KGgoAAAANSUhEUgAAAIwAAAAUCAYAAABf9dUQAAARW......="jcr:lastModified="2011-12-20T15:57:21.909-08:00" jcr:lastModifiedBy="system" jcr:mimeType="image/png"/>
</cq5dam.thumbnail.140.100.png>

underlined statements differ in both formats.

Json Format

"cq5dam.thumbnail.140.100.png":{"jcr:createdBy":"system","jcr:created":"Tue Dec 20 2011 15:57:21 GMT-0800","jcr:primaryType":"nt:file","jcr:content":{"jcr:lastModifiedBy":"system","jcr:uuid":"30ec7f42-ab4c-4c3e-8181-20237dfd8f84",":jcr:data":4499,"jcr:mimeType":"image/png","jcr:lastModified":"Tue Dec 20 2011 15:57:21 GMT-0800","jcr:primaryType":"nt:resource"}}

 

How can I get same data as in xml for json ?

Thanks

Shabarinadh . Vempati

1 Accepted Solution

Avatar

Correct answer by
Level 10
1 Reply

Avatar

Correct answer by
Level 10

You need to define custom resolution as per your need.

http://sling.apache.org/old-stuff/servlet-resolution.html