Is it possible to call a soy template from an event Listener? I am working on a blueprint plugin that forces the user to add labels to the page before saving the page. So one of my approaches for that is call the exact dialog box that we get when we try to add labels to the page, but that dialog box should pop up when the use presses the save button on the page. So basically, it should be like this :
public class PageCreatedListener implements DisposableBean {
protected EventPublisher eventPublisher;
private final LabelManager labelManager;
private final PageManager pageManager;
private final Logger log;
public PageCreatedListener(EventPublisher eventPublisher, LabelManager labelManager, PageManager pageManager) {
this.eventPublisher = eventPublisher;
eventPublisher.register(this);
this.labelManager = labelManager;
this.pageManager = pageManager;
log = LoggerFactory.getLogger(PageCreatedListener.class);
}
@EventListener
public void pageCreateFromTemplateEvent(PageCreateEvent event) {
/* Call the soy template or the dialog box that
* asks the user to add labels from here
* Is this possible?
*/
}
@Override
public void destroy() throws Exception {
// TODO Auto-generated method stub
}
}