cq5.6 the event listener does not detect the from submitted node properties | Community
Skip to main content
srinivas_channa
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
 
 
 
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

AT high level look right to me.  Make sure your custom enable property is configured in 5.6.1 

3 replies

Sham_HC
Level 10
October 16, 2015

it should work, are you seeing any error in logs.  Post entire class rather than method for review.

srinivas_channa
Level 2
October 16, 2015

I have added entire class as attachment .please let me know if I have missed out anything.

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

AT high level look right to me.  Make sure your custom enable property is configured in 5.6.1