Shows how users can create their own add-on project for their doctypes. This involves creating a new project using a Maven Archtetype and then add blueprint based on model descriptors.

Prerequisites

There are a number of prerequisites regarding knowledge and configuration of Confluence, Maven, and the Doctypes Maven Plugin.

Since the plugin generates blueprints based on the projectdoc Toolbox, you should also be familiar with this add-on and its concepts.

Create new Project

 

We recommend to create a model project and create the add-on project based on the models provided in that project. But in case you are not interested in models and you are only interested to create a project to get going, this is what you are looking for.

First create a new project with the use of the Doctype Add-on Archetype. The interface to use the archetype is simplified by the create mojo. So we recommend to use the following command on the commandline. This reduces the number of parameters you have to specify to one (shortId), also it is recommended to also provide a name for the new project (projectName).

mvn doctype:create -DshortId=myshortid -DprojectName="My Doctype Add-on"

Specify a short ID (only characters, digits allowed except as first char) and an optional project name (which is recommended). With that a project based on Maven for the add-on for the projectdoc Toolbox is created.

Configuration

The project POM contains the configuration to create blueprint files based on the model descriptors.

      <plugin>
        <groupId>de.smartics.maven.plugin</groupId>
        <artifactId>doctype-maven-plugin</artifactId>
        <version>1.9.4</version>
        <executions>
          <execution>
            <id>doctype</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
        </executions>
        <configuration>
          <shortId>myshortid</shortId>
        </configuration>
      </plugin>

So the next step is to provide the model descriptors. There are basically there models: add-on, spaces, and doctypes. All descriptors are XML files stored in

src\main\resources\projectdoc-models

spaces are stored in a subfolder spaces, doctypes in a subfolder doctypes.

The createExamples flag is set true by default. So there are some sample files to start with describing your model.

Create Blueprint Files

Based on the model files the following command, run from within the project (where the pom.xml is found), creates the necessary files to make the blueprint files come to life.

 

The following command will change your source files and if you applied any changes to the project created with the archetype, then make sure you have a backup of these files!

You cannot rollback the changes!

We recommend to have your project in version control (for instance with Bitbucket or GitHub) and run this command only on files you have updated and no local changes. If anything goes wrong - for whatever reasons - you can easily restore your previous work from the repository.

mvn doctype:generate

After that everything is in place in your source folder of your project. You can start the Confluence server on your developer box (see next step).

Check that Everything is in Place

The next step is to start (for instance in debug mode) a local Confluence server instance with your add-on.

atlas-debug

After the server is up, login as admin (password admin), create a new space and create a couple of pages of with your blueprints.

Create an OBR

The OSGi Bundle repository (OBR) is the deployment unit of your add-on. Create this OBR file by the use of your SDK. The OBR file can then be installed on a Confluence server. Please note that the projectdoc Tooolbox for Confluence (commercial) and the Core Blueprints Add-on (free) for the Core Doctypes need to be installed.

Resources

More information on working with the Doctypes Plugin for Maven.

projectdoc Model Descriptors
Provides an overview over the model descriptors to describe the add-on, spaces, and doctypes.
Usage
List of usage scenarios creating blueprints with the plugin for Maven.

More usage scenarios:

Create a new Doctype Model
Shows how users can create their own model project for their doctypes. This involves creating a new project using a Maven Archtetype and then add blueprint based on model descriptors.
Add new Doctype
Shows how to add a new doctype to an existing project.
Update Doctype
Shows how to update an existing doctype.