querying in whole dam except a folder. | Community
Skip to main content
Level 2
October 16, 2015
Solved

querying in whole dam except a folder.

  • October 16, 2015
  • 2 replies
  • 1545 views

hi, i want to query all the assets inside Dam, except asset inside a folder(read specific folder), how to achieve this.

since i am moving file from a folder to this specific folder, so i cant not user jar:content/cq:parent path..

please help.

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 Ojjis

I agree with Scott there that it would be the best idea if you cannot use the parentPath property. Though I would strongly recommend that you change the structure of your DAM instead to help you with this.

I guess that you have this kind of structure now:

dam/images/folder1
dam/images/folder2
dam/imaged/excludable_folder

I would rather use this:
dam/images/folder1
dam/images/folder2
dam/excludable_folder

Then you could move all the files outside the main location for images and you wont have a problem with a fast query for all the "valid" pictures for you by just querying dam/images/.

/Johan

2 replies

smacdonald2008
Level 10
October 16, 2015

You want to query DAM assets - but exclude assets within a specific folder? 
If so - you can use the Query Builder API - then get your reset set. Figure out where each asset is located and then populate a Java list with those assets that do meet your requirements. Exclude the assets that you do not want to use.  

To learn how to use the Query Builder API -- see http://scottsdigitalcommunity.blogspot.ca/2013/08/creating-aem-applications-that-use.html.

HTH

Ojjis
OjjisAccepted solution
Level 7
October 16, 2015

I agree with Scott there that it would be the best idea if you cannot use the parentPath property. Though I would strongly recommend that you change the structure of your DAM instead to help you with this.

I guess that you have this kind of structure now:

dam/images/folder1
dam/images/folder2
dam/imaged/excludable_folder

I would rather use this:
dam/images/folder1
dam/images/folder2
dam/excludable_folder

Then you could move all the files outside the main location for images and you wont have a problem with a fast query for all the "valid" pictures for you by just querying dam/images/.

/Johan