Expand my Community achievements bar.

SOLVED

querying in whole dam except a folder.

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Level 7

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

View solution in original post

2 Replies

Avatar

Level 10

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

Avatar

Correct answer by
Level 7

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