Hi,
I want to find all the components that have a nested multifield in the touch ui dialog in AEM 6.4. Kindly help with writing a query for it that can be executed in Query Builder.
I have written a below query to find out all the components that have a multifield. But not sure how to find out a sub node that has a sling:resourceType of "granite/ui/components/coral/foundation/form/multifield".
type=nt:unstructured
path=/apps/
1_property=sling:resourceType
1_property.value=granite/ui/components/coral/foundation/form/multifield
p.limit=-1
Kindly help with the same. Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
You have to do it with SQL2
Below is the Query but make sure, it would be time taken, so run on specific folders rather than on complete apps
SELECT parent.* FROM [cq:Component] AS parent
INNER JOIN [nt:unstructured] AS child
ON isdescendantnode(child,parent)
INNER JOIN [nt:unstructured] AS gc
ON isdescendantnode(gc,child)
WHERE ISDESCENDANTNODE(parent, '/apps/AEM63App')
AND child.[sling:resourceType] like '%granite/ui/components/coral/foundation/form/multifield%'
AND gc.[sling:resourceType] like '%granite/ui/components/coral/foundation/form/multifield%'
Views
Replies
Total Likes
What are you trying to do here - if you get a result set of certain components - what are you going to do with the data?
Views
Replies
Total Likes
Karthick,
Have you already referred to the Query Builder API ?
Views
Replies
Total Likes
There is an issue with customized multifield js in project. I just want to find out the list of all the components with nested multi fields available in my project to make sure they all work fine. But don't want to do it manually by checking each and every component.
Views
Replies
Total Likes
A nested multifield has a specific node pattern for the dialog. I recommend that you look here for that pattern.
It has an outer and then inner pattern - as discussed here:
Now you can query for all outer ones. Put the result set in a collection in Java code - an ArrayList purhaps. Then go through that result set - search to find the inner one. That is your best way i can think of.
Views
Replies
Total Likes
You may try with SQL2 otherwise with QB try this --
1_property=sling:resourceType
1_property.value=granite/ui/components/coral/foundation/form/multifield
2_property=*/ */sling:resourceType // find nth level depth based on your use case
2_property.value=granite/ui/components/coral/foundation/form/multifield
property.and=true
(
@jcr
:title =
'foo'
or */
@jcr
:title =
'foo'
or */*/
@jcr
:title =
'foo'
) or use property.depth
https://hashimkhan.in/aem-adobecq5-code-templates/query-builder/
Views
Replies
Total Likes
Hi,
You have to do it with SQL2
Below is the Query but make sure, it would be time taken, so run on specific folders rather than on complete apps
SELECT parent.* FROM [cq:Component] AS parent
INNER JOIN [nt:unstructured] AS child
ON isdescendantnode(child,parent)
INNER JOIN [nt:unstructured] AS gc
ON isdescendantnode(gc,child)
WHERE ISDESCENDANTNODE(parent, '/apps/AEM63App')
AND child.[sling:resourceType] like '%granite/ui/components/coral/foundation/form/multifield%'
AND gc.[sling:resourceType] like '%granite/ui/components/coral/foundation/form/multifield%'
Views
Replies
Total Likes
Able to get the list of nested multifield components quickly with Arun's suggestion. Thanks smacdonald2008, MatthewLaun, gauravb10066713 and Arun Patidar. All of your replies helped to learn something new
Views
Replies
Total Likes
I am happy you got it working. This thread shows the entire purpose of the AEM community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies