I have looked at the Add a field to CQL tutorial then I tried to do something different.
I tried to modify the listener class and added a new listener:
@EventListener
public void commentCreated(CommentCreateEvent commentCreateEvent){
ContentEntityObject page = commentCreateEvent.getComment().getContainer();
contentPropertyManager.setStringProperty(page, StatusPropertyExtractor.SEARCH_FIELD_NAME, PageStatus.COMPLETE.name());
}
I want to set the page status as COMPLETE when someone creates a new comment but it failed. There is no bug report within the log but the page is not set to COMPLETE as expected.
I guess I get the wrong page to set the status. If so, what does the getContainer() mean?