Get Image Files from JCR node through JCR API | Community
Skip to main content
Level 2
October 16, 2015
Solved

Get Image Files from JCR node through JCR API

  • October 16, 2015
  • 2 replies
  • 5714 views

Hi all, 

I have image files in a folder under DAM folder in JCR hierarchy.

How can I get the Image Files from JCR and display in a html page in my application?

I need to List images in a html page for display to user, so that user can pick some images from list of images in html page,

I need to query the Image files in JCR repository.

 

How to achieve this?

any suggestion is greatly appreciated. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

See the article -- http://helpx.adobe.com/experience-manager/using/aem-dam-image-components.html. It walks you through this use case. 

2 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

See the article -- http://helpx.adobe.com/experience-manager/using/aem-dam-image-components.html. It walks you through this use case. 

Level 6
October 16, 2015

Chekout this : http://cq5demosearch.wordpress.com/2013/10/20/building-search-in-cq/

You can use the below code :

String xPathQuery = “/jcr:root/content/mydemosite/documents/Sales//element(*,nt:file)[jcr:like(@name,'%"+docName+"%')]“; //docName is search query
xPathQuery += ” order by @jcr:score ascending”;
log.error(xPathQuery);
Query query = session.getWorkspace().getQueryManager().createQuery(xPathQuery, Query.XPATH);
QueryResult result = query.execute();