I've got a small snippet of code that simply loops through the currentNode and grabs a imageReference property. Except instead of using nodes can I use resources instead? I'm really lost on how to go about doing this. Any ideas? What's slipping me up the most is there's a "NodeIterator" but there isn't a "ResourceIterator".
Node reference:
Node currentNode = (Node) context.getAttribute("currentNode");
Resource reference:
Resource resource = (Resource) context.getAttribute("resource");
NodeIterator chatNode = currentNode.getNodes();
while (chatNode.hasNext()) {
Node imageNode = chatNode.nextNode();
if(imageNode.hasProperty("imageReference")){
printNodeTitle = imageNode.getProperty("imageReference").getString();
}
}