Last updated Jul 8, 2024

Writing a Blueprint - Advanced

If you've followed the steps in Confluence Blueprints and Writing a Blueprint - Intermediate and find that your Blueprint needs more flexibility, you're probably going to want a custom action and may have to interact with some other components made available by the Blueprint API.

Adding a dependency on the confluence-create-content-plugin

The Blueprint API is provided by a plugin called the confluence-create-content-plugin, so to interact with the API you will have to add a dependency in your project's pom.xml.

    <!-- 1.5.25 is the version released with Confluence 5.1.4 -->

Adding an event listener

If the only functionality you need to add to the default behaviour is to take some action after the Blueprint is created, you can listen for the BlueprintPageCreateEvent.

public class MyBlueprintListener
    private static final ModuleCompleteKey MY_BLUEPRINT_KEY = new ModuleCompleteKey(
        "com.atlassian.confluence.plugins.myplugin", "myplugin-blueprint");

    public MyBlueprintListener(EventPublisher eventPublisher)

    public void onBlueprintCreateEvent(BlueprintPageCreateEvent event)
        ModuleCompleteKey moduleCompleteKey = event.getBluePrintKey();
        if (MY_BLUEPRINT_KEY.equals(moduleCompleteKey))
            // Take some action when a My Plugin Blueprint is created
            System.out.println("Created your kind of blueprint");

You will also need to register the class as a component in your atlassian-plugin.xml

<component key="my-listener" class="myplugin.MyBlueprintListener" />

Blueprint API components

We are currently in the process of updating this Blueprints API for v2.

Please contact us if you require access to these managers in your plugin.

If you need to interact with the Blueprints API at a low level, you can import and use these components:

Component KeyInterfaceMethods
  • createAndPinIndexPage checks for and creates a index page if required for this blueprint, and pins it to the Space Sidebar.
  • setBlueprintCreatedByUser flags that a Blueprint of a certain type has been created by a given user
  • createIndexPageObject creates a content page object given a plugin template and a render context.

  • generateBlueprintPageObject creates an index page object given a plugin template and a render context.

Rate this page: