This page explains the workings of the Brix Publishing Plugin, and the steps you need to take to integrate it with the brix-demo project. The purpose of a publishing workflow is to ensure that content can be checked by several pairs of eyes, in different environments, from the developers machine, to a ‘staging’ or ‘preview’ website, and finally in the live or ‘customer’ website. This helps to ensure the quality of the content, as it has a better chance of passing through ‘proof’ reading.

The Plugin

The publishing plugin uses three different workspaces for each stage in the process of getting new content in production:

  1. Development
  2. Staging (also known as preview)
  3. Production

You can find these states in the class brix.plugin.publishing.PublishingPlugin

Integration with the brix-demo web application

There are a few things you need to change the brix-demo project into a project with the three workspaces required for the publishing plugin:

    // register plugins
    config.getRegistry().register(Plugin.POINT, new MenuPlugin(this));
    config.getRegistry().register(Plugin.POINT, new SnapshotPlugin(this));
    config.getRegistry().register(Plugin.POINT, new PrototypePlugin(this));
    config.getRegistry().register(Plugin.POINT, new PublishingPlugin(this));
    config.getRegistry().register(Plugin.POINT, new WebdavUrlPlugin());


    String[] statesForWorkspaces = new String[] 
    for (String state : statesForWorkspaces) 

Now, we just parameterize the ‘initDefaultWorkspace’ method with the state.

    private void initDefaultWorkspace(String state)
            final String defaultState = state;

The final change you have to make is in the URLMapper that is created in the ‘init’ method. Change the block below:

    final String name = getProperties().getJcrDefaultWorkspace();
    SitePlugin sitePlugin = SitePlugin.get(brix);
    return sitePlugin.getSiteWorkspace(name, "");


    final String name = getProperties().getJcrDefaultWorkspace();
    SitePlugin sitePlugin = SitePlugin.get(brix);
    return sitePlugin.getSiteWorkspace(name, PublishingPlugin.STATE_PRODUCTION);

This initializes the demo application with the ‘PRODUCTION’ workspace state as default.

That’s it, now you can start up everything like you’re used to and you should have the three different states. Using the Publish tab, you can copy the contents of one state to the next state. As the web application is in ‘PRODUCTION’ state by default, you will see no content in the publishing tab. Try switching to the ‘DEVELOPMENT’ state with the site selector drop down.

Once you have done this, you will be able to publish to ‘STAGING’. If you change the state to ‘STAGING’, you can then publish to ‘PRODUCTION’.

This is a unique website which will require a more modern browser to work!

Please upgrade today!