Hi,
I've been puzzling over this for a couple of days now and cannot seem to figure out why this is not working.
I've been using this tutorial to write a custom collection of templates into a single blueprint. Not-with-standing the age of this tutorial and that it's not entirely up-to-date for the latest SDK; I've pretty much got everything I need sorted, so I'm confident the pom and atlassian-plugin.xml are well structured.
My only issue is that I cannot get the listener to fire on the BlueprintPageCreateEvent.
Here's the framework of my listener -
package com.itg.plugins.confluence.iso.impl;
import com.atlassian.confluence.plugins.createcontent.api.events.BlueprintPageCreateEvent;
import com.atlassian.event.api.EventListener;
import com.atlassian.event.api.EventPublisher;
import com.atlassian.plugin.ModuleCompleteKey;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.atlassian.confluence.pages.Page;
import com.atlassian.confluence.pages.PageManager;
import com.atlassian.confluence.spaces.Space;
import com.atlassian.confluence.spaces.SpaceManager;
import com.atlassian.confluence.spaces.SpacesQuery;
import java.util.List;
public class IsoDocumentTemplateListener {
private static final ModuleCompleteKey MY_BLUEPRINT_KEY = new ModuleCompleteKey("com.itg.plugins.confluence.iso", "iso-documentation");
private static final Logger log = LoggerFactory.getLogger(IsoDocumentTemplateListener.class);
private SpaceManager manager;
private SpacesQuery query;
public IsoDocumentTemplateListener(EventPublisher eventPublisher) {
eventPublisher.register(this);
}
@EventListener
public void onBlueprintCreateEvent(BlueprintPageCreateEvent event){
ModuleCompleteKey moduleCompleteKey = event.getBlueprintKey();
if (MY_BLUEPRINT_KEY.equals(moduleCompleteKey)){
//Do stuff here!
}
}
}
I'm using atlas SDK v6.3.7, building to confluence version 6.0.2 and JRE 1.8 (64 bit).
Any help you can provide would be welcome