Level 2
October 16, 2015
Solved
cq5.6 the event listener does not detect the from submitted node properties
- October 16, 2015
- 3 replies
- 888 views
I have to submit a form data to "/content/usergenerated" and on the node we store few properties like formpath and formtype.
We are using eventlistener which used to created few properties based on this node properties. I see that if check in the below code fails for the properties.
In cq5.5 the below code used to work with eventlisterner used to detect the properties of form submit node. I see the same code is not working in CQ5.6.1 any suggestions
public void onEvent(EventIterator events) {
while (events.hasNext()) {
Event event = (Event) events.next();
try {
String path = event.getPath();
if (StringUtils.isNotEmpty(path)) {
if (event.getType() == Event.NODE_ADDED) {
Node nde = resolver.getResource(path). adaptTo(Node.class);
if (nde != null && nde.hasProperty("formpath") && nde.hasProperty("formtype")
&& nde.hasProperty("email")) {
.......
}
}
}
} catch (RepositoryException e) {
log.error("UserFormsListener path: " + e);
}
}
}
Thanks,
Srinivas