It may help to your requirement ,
1 ) You can create a component with
Session session = slingReq.getResourceResolver().adaptTo(Session.class);
QueryBuilder builder = resource.getResourceResolver().adaptTo(QueryBuilder.class);
Query query = null;
SearchResult result = null;
Map<String, String> map = new HashMap<String, String>();
and check extension of each file
2) Check Example CQ 5.5
http://localhost:4502/damadmin -- > Search
Thanks for your reply...
But i have different requirement..
Consider i have uploaded multiple videos in a page using multiple video component (general)..
I want to perform a search for a particular video among those...
Is there any query to find the path of the videos posted under particular site using video component...
I'm expecting something like the below query..
select * from cq:Page where jcr:path like '/content/training/%'... but in my case i want to check the video file name..
1 person found this helpful
In that case you can do search based on resource Type. Also you have to store vedio name in one of the property of that component. something like <Path>//element(*,cq:Page) [@sling:resourceType='<Your vedio resource Type>' and @<Your Vedio Name Property>='<Your Vedio name>].
Some way you can use query (http://wemcode.wemblog.com/using-query) There are more using query builder as well.
Thanks a lot, It works...
But if i give Path, it's not giving the desired result... Meanwhile if i dont give Path, it is retrieving all the video components under all the site and direcotories..
Thanks for your help.
My new video search component started working...
Thank you all for your help...