-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e744e85
commit e39858d
Showing
1 changed file
with
79 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
{ | ||
"logLevel":"info", | ||
"hops":[ | ||
{ | ||
"type":"runScript", | ||
"code":"output = utils.file.txt(\"properties_containing_hardcoded_urls\");\nSQL2Query = str:join([\"SELECT * FROM [nt:base] AS node WHERE ISDESCENDANTNODE([\",args.path,\"])\"])\nif (args.resourceTypeInclude != null && args.resourceTypeInclude.trim() != ''){\n SQL2Query = str:join ([SQL2Query,\" AND node.[sling:resourceType] LIKE \\\"\",args.resourceTypeInclude,\"\\\"\"])\n}\nif (args.resourceTypeExclude != null && args.resourceTypeExclude.trim() != ''){\n SQL2Query = str:join ([SQL2Query,\" AND node.[sling:resourceType] NOT LIKE \\\"\",args.resourceTypeExclude,\"\\\"\"])\n}", | ||
"extension":"jexl", | ||
"putLocalsBackIntoScope":true | ||
}, | ||
{ | ||
"type":"nodeQuery", | ||
"query":"${SQL2Query}", | ||
"queryType":"JCR-SQL2", | ||
"hops":[ | ||
{ | ||
"type":"each", | ||
"expression":"node.properties", | ||
"hops":[ | ||
{ | ||
"type":"filterNode", | ||
"expression":"str:contains(property.name, args.propertyName)", | ||
"hops":[ | ||
{ | ||
"type":"declare", | ||
"declarations":{ | ||
"joinedPropertyValue":"str:join(jcr:vals(node, property.name))" | ||
} | ||
}, | ||
{ | ||
"type":"filterNode", | ||
"expression":"str:contains(joinedPropertyValue, args.propertyValue)", | ||
"hops":[ | ||
{ | ||
"type":"runScript", | ||
"code":"output.append(node.path);\noutput.append(\"-\");\noutput.append(property.name);\noutput.append(\":\");\noutput.append(joinedPropertyValue);\noutput.append(\"\\n\");", | ||
"extension":"jexl", | ||
"putLocalsBackIntoScope":true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"iterator":"property" | ||
} | ||
] | ||
} | ||
], | ||
"parameters":[ | ||
{ | ||
"name":"path", | ||
"defaultValue":"/content/project/de", | ||
"type":"text", | ||
"evaluation":"STRING" | ||
}, | ||
{ | ||
"name":"resourceTypeInclude", | ||
"defaultValue":"", | ||
"type":"text", | ||
"evaluation":"STRING" | ||
}, | ||
{ | ||
"name":"resourceTypeExclude", | ||
"defaultValue":"", | ||
"type":"text", | ||
"evaluation":"STRING" | ||
}, | ||
{ | ||
"name":"propertyName", | ||
"defaultValue":"textIsTrue", | ||
"type":"text", | ||
"evaluation":"STRING" | ||
}, | ||
{ | ||
"name":"propertyValue", | ||
"defaultValue":"false", | ||
"type":"text", | ||
"evaluation":"STRING" | ||
} | ||
] | ||
"logLevel": "info", | ||
"hops": [ | ||
{ | ||
"type": "runScript", | ||
"code": "output = utils.file.txt(\"properties_containing_hardcoded_urls\");\nSQL2Query = str:join([\"SELECT * FROM [nt:base] AS node WHERE ISDESCENDANTNODE([\",args.path,\"])\"])\nif (args.resourceTypeInclude != null && args.resourceTypeInclude.trim() != ''){\n SQL2Query = str:join ([SQL2Query,\" AND node.[sling:resourceType] LIKE \\\"\",args.resourceTypeInclude,\"\\\"\"])\n}\nif (args.resourceTypeExclude != null && args.resourceTypeExclude.trim() != ''){\n SQL2Query = str:join ([SQL2Query,\" AND node.[sling:resourceType] NOT LIKE \\\"\",args.resourceTypeExclude,\"\\\"\"])\n}", | ||
"extension": "jexl", | ||
"putLocalsBackIntoScope": true | ||
}, | ||
{ | ||
"type": "nodeQuery", | ||
"query": "${SQL2Query}", | ||
"queryType": "JCR-SQL2", | ||
"hops": [ | ||
{ | ||
"type": "each", | ||
"expression": "node.properties", | ||
"hops": [ | ||
{ | ||
"type": "filterNode", | ||
"expression": "str:contains(property.name, args.propertyName)", | ||
"hops": [ | ||
{ | ||
"type": "declare", | ||
"declarations": { | ||
"joinedPropertyValue": "str:join(jcr:vals(node, property.name))" | ||
} | ||
}, | ||
{ | ||
"type": "filterNode", | ||
"expression": "str:contains(joinedPropertyValue, args.propertyValue)", | ||
"hops": [ | ||
{ | ||
"type": "runScript", | ||
"code": "output.append(node.path);\noutput.append(\"-\");\noutput.append(property.name);\noutput.append(\":\");\noutput.append(joinedPropertyValue);\noutput.append(\"\\n\");", | ||
"extension": "jexl", | ||
"putLocalsBackIntoScope": true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"iterator": "property" | ||
} | ||
] | ||
} | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "path", | ||
"defaultValue": "/content/project/de", | ||
"type": "text", | ||
"evaluation": "STRING" | ||
}, | ||
{ | ||
"name": "resourceTypeInclude", | ||
"defaultValue": "", | ||
"type": "text", | ||
"evaluation": "STRING" | ||
}, | ||
{ | ||
"name": "resourceTypeExclude", | ||
"defaultValue": "", | ||
"type": "text", | ||
"evaluation": "STRING" | ||
}, | ||
{ | ||
"name": "propertyName", | ||
"defaultValue": "textIsTrue", | ||
"type": "text", | ||
"evaluation": "STRING" | ||
}, | ||
{ | ||
"name": "propertyValue", | ||
"defaultValue": "false", | ||
"type": "text", | ||
"evaluation": "STRING" | ||
} | ||
] | ||
} |