Hello all,
I have a case with a bunch of pdf's and they have sub folders with various years. Within the years are pdf files.
Now on ingestion AEM creates sub assets of each page within the PDF. For my use case I need my query
to just return the pdf file path. How can I get query results that exclude the sub assets?
Solved! Go to Solution.
Views
Replies
Total Likes
The Big Red wrote...
smacdonald2008 wrote...
Post a screenshot of the JCR with the PDF files please.
Attached is the screen shot of the JCR. I need to get the pdf only in my query while filtering out the subassets.
So in this case I just want query to return AVA12_1999.pdf and filter out the page#.pdf
Please have alook at:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
// String sql= "SELECT * FROM sling:Folder WHERE jcr:path LIKE '"+path +"/%' AND NOT jcr:path LIKE '"+path +"/%/%'";
OR
select * from [dam:Asset] where [jcr:path] like '/content/pdf_archives/current_brands/Avantages/%' AND [jcr:path] NOT like '/content/pdf_archives/current_brands/Avantages/%/subassets%'
~kautuk
Views
Replies
Total Likes
Post a screenshot of the JCR with the PDF files please.
Views
Replies
Total Likes
Hi
Please have a look at this old Post:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
//
For this type of query - i would look at using the JCR SQL/2. You may have better results by specifying JCR SQL search criteria. See:
https://wiki.magnolia-cms.com/display/WIKI/JCR+Query+Cheat+Sheet
http://www.day.com/maven/jcr/2.0/6_Query.html.
http://www.h2database.com/jcr/grammar.html
What I like about JCR SQL is the ability is include and exclude JCR paths. For example:
String sql= "SELECT * FROM sling:Folder WHERE jcr:path LIKE '"+path +"/%' AND NOT jcr:path LIKE '"+path +"/%/%'";
You should be able to write methods using JCR SQL to grab all content in the tree that you specified and search through it.
I hope this will help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
smacdonald2008 wrote...
Post a screenshot of the JCR with the PDF files please.
Attached is the screen shot of the JCR. I need to get the pdf only in my query while filtering out the subassets.
So in this case I just want query to return AVA12_1999.pdf and filter out the page#.pdf
Views
Replies
Total Likes
You can try the following- select * from [dam:Asset] where [jcr:path] like '/content/pdf_archives/current_brands/Avantages/%' AND [jcr:path] NOT like '/content/pdf_archives/current_brands/Avantages/%/subassets%'
Views
Replies
Total Likes
The Big Red wrote...
smacdonald2008 wrote...
Post a screenshot of the JCR with the PDF files please.
Attached is the screen shot of the JCR. I need to get the pdf only in my query while filtering out the subassets.
So in this case I just want query to return AVA12_1999.pdf and filter out the page#.pdf
Please have alook at:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
// String sql= "SELECT * FROM sling:Folder WHERE jcr:path LIKE '"+path +"/%' AND NOT jcr:path LIKE '"+path +"/%/%'";
OR
select * from [dam:Asset] where [jcr:path] like '/content/pdf_archives/current_brands/Avantages/%' AND [jcr:path] NOT like '/content/pdf_archives/current_brands/Avantages/%/subassets%'
~kautuk
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies