[AEM6.5] Read multiple Properties from a Node and perform action
Hi All,
I have a basic requirement where I have a Image and havings it's custom rendition under /content/dam/test/Test.jpg/jcr:content/metadata/customRendition

Now I have to readthe values of properties from /content/dam/test/Test.jpg/jcr:content/metadata/customRendition which holds the path of assets [in given case it is prop1, prop2, prop3...] and unpublish those path.
For unpublishing we can use replicator.replicate(__,ReplicationActionType.DEACTIVATE).
But How o read the values of properties, and in our case property name is prop1, prop2, prop3 and so on...
Similarly we have to read all the values from all properties and it is not fixed.
// Get the current node
Node currentNode = resourceResolver.getResource("/content/dam/test/Test.jpg/jcr:content/metadata/customRendition").adaptTo(Node.class);
// Get the properties
PropertyIterator properties = currentNode.getProperties();
// Iterate over properties
while (properties.hasNext()) {
Property property = properties.nextProperty();
String propertyName = property.getName();
// Check if the property is prop1, prop2, prop3
if (propertyName.equals("prop1") || propertyName.equals("prop2") || propertyName.equals("prop3")) {
// Get the asset paths
String assetPath = property.getValue().getString();
// Get the asset node
Node assetNode = resourceResolver.getResource(assetPath).adaptTo(Node.class);
we can use Property Iterator but since we don't have fixed set of properties in that case how to check for properties.equal condition?
Thanks
@kautuk_sahni @arunpatidar @briankasingli @theo_pendle
