Got stuck when I tried to extend the "Add a field to CQL" tutorial

Robert Yang September 25, 2019

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?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events