cq5 - How to access jcr:root with XPath JCR Query -
I would like to apply some Java function to CQ5 But this query does not supply any results. The CRX Expedial tool does not display any results, it also sees anecdotal picture: My / jcr: root / apps / myProject / pages / myComponent / dialog.xml looks like this: I can follow This works fine, my question is: why If it is not clear, then use CRX Day, open If you want to find all the dialogs, then use the primary type All the dialogues dialog . In the first step, I search for Dialog XML files in the
myComponent folder :
NodeEaterator tabrequirefield = getQueryResult ("/ jcr: root / apps / myProject / pages / MyComponent / dialog / jcr: root ")
& lt ;? Xml version = "1.0" encoding = "UTF-8" & gt; & Lt; Jcr: root xmlns: cq = "http://www.day.com/jcr/cq/1.0" xmlns: jcr = "http://www.jcp.org/jcr/1.0" xmlns: nt = "http: //www.jcp.org/jcr/nt/1.0 "JCR: Primary Type =" CC: Dialog "Stateful =" Fotal "title =" Test "..... & gt; & Lt; Item JCR: Primary Type = "cq: Widget" xtype = "Panel" & gt; ... ...... & lt; / Items & gt; ..... & lt; / Jcr: root & gt;
items
nodeitor tabRequiredFields = getQueryResult ("/ jcr: root / apps / myProject / Pages / MyComponent / dialog / items ")
jcr: root ? XML element named code> JCR: Route to
jcr: root node in the repository. This is a special, reserved identifier, and the CRX Package Manager keeps all the elements and sub-nodes of this element in the node, which is similar to the name without an extension (in your case this will be the
dialogue ).
/ apps / myProject / pages / myComponent and see what you can find there. This is why you should add
/ dialog instead of
/ jcr: root at the end of your path.
cq: dialog , as Rakhi 4110 suggests. The following query:
/ jcr: root / apps / myProject / pages // element (*, cq: dialog)
/ Apps / myProject / pages (and lineage).
Comments
Post a Comment