Usecase that I am trying to solve is:
Find all page references of all components under /apps.
i.e. First find all pages where a component is being used, and then do this for all components under /apps.
By using the report builder tool for Adobe AEM: https://adobe-consulting-services.github.io/acs-aem-commons/features/report-builder/configuring.html
Query I am trying:
SELECT * FROM [nt:base] AS s
WHERE [sling:resourceType] IN (SELECT path FROM [cq:Component] AS s WHERE [componentGroup] IS NOT NULL AND ISDESCENDANTNODE([/apps]))
AND ISDESCENDANTNODE([/content])
Background:
I only need to sanitize the resultset from inner query.
Without sanitization, it would spit path of the form /apps/acs-commons/components/utilities/report-builder/columns/text
while sling:resourceType from outer query can only accept acs-commons/components/utilities/report-builder/columns/text
.
So I need to strip out /apps/
from the inner query resultset path.
Here is the error message:
Caused by: java.text.ParseException: Query: SELECT * FROM [nt:base] AS s
WHERE [sling:resourceType] IN (SELECT(*)CAST(path, AS STRING) FROM [cq:Component] AS s WHERE [componentGroup] IS NOT NULL AND ISDESCENDANTNODE([/apps]))
AND ISDESCENDANTNODE([/content]); expected: static operand