def query = SQLQuery() <- my sql query
def result = query.execute()
result.nodes.each{node ->
node.setProperty(JcrConstants.JCR_TITLE, "new3")
I found all components with a certain resource type using groovy consoly, and I need to replace their titles with the titles of the pages in which this component is located.
I need to use parent node named jcr:content
Instead of "new3" i can use node.getParent().getParent().getParent().getProperty("jcr:title")
,but pages can have different structures. So, how to find parent node by name ?