anchorNamesFilter = null
if (hasModuleCondition) {
anchorNamesFilter[] = ... // execute current query to get just cm handle names!
}
if (hasPropertyConditons) {
cmHandleObjects[] = ... //execute current code to get cm handle objects based on property conditions
if (anchorNamesFilter != null) {
cmHandleObjects.removeAll(cmHandlObject.id not in anchorNameFilter)
}
return cmHandleObjects[]
}
if (justIds) {
return convertAnchorNamesToEmptyCmHandleObject(anchorNamesFilter[]) //similar to code you have in your latest patch
} else {
cmHandleObjects[] = new collection
for each anchorName in anchorNameFilter[] {
cmHandleObject = get /dmi-registry/cm-handlehandles[@id=anchorName] // use GET with absolute path NOT a query!!!!
cmHandleObjects[].add(cmHandleObject)
}
return cmHandleObjects[]
} |