projectdoc Toolbox

The main purpose of content providers is to add additional context entries for the blueprints provided by an add-on. projectdoc defines a number of context providers to be used by add-on developers.

The context provider classes for projectdoc help to fill the blueprint context with convenient information to populate the created documents.

The context provider class is registered with the Content Template Module in the atlassian-plugin.xml file.

 

For more information on creating blueprints for Confluence:

 

The API is ot considered stable until version 2.0 of the projectdoc Toolbox. Incompatible changes may be rolled out on any minor change. Usually they will be reported in the release notes.

Basic Configuration

The Soy template defines the wizard, the template uses the information collected in the wizard.

Soy Template

{namespace ProjectDocPlugin.Blueprints.Template.Blank}

/**
 * Wizard to collect information for the blank document.
 */
{template .page1Form}
  <form action="#" method="post" class="aui" id="blank-form">
    <fieldset>
      <div class="field-group">
        <label for="projectdoc.doctype.common.name">{getText('projectdoc.blueprint.form.label.name')}</label>
        <input id="projectdoc.doctype.common.name" class="text long-field" type="text" name="projectdoc.doctype.common.name"
        placeholder="{getText('projectdoc.blueprint.form.label.name.placeholder')}">
          </div>
      <div class="field-group">
        <label for="projectdoc.doctype.common.shortDescription">{getText('projectdoc.blueprint.form.label.shortDescription')}</label>
        <textarea id="projectdoc.doctype.common.shortDescription" class="textarea long-field" name="projectdoc.doctype.common.shortDescription" rows="6"
            placeholder="{getText('projectdoc.blueprint.form.label.shortDescription.placeholder')}"></textarea>
      </div>
      <div class="field-group" id="target-location-binder">
         <label for="targetLocation">{getText('projectdoc.blueprint.form.targetLocation')}</label>
         <input id="targetLocation" type="checkbox" value="defaultLocation" name="targetLocation"/>
         <br><span id="targetLocationDocumentation" class="help">{getText('projectdoc.blueprint.form.targetLocation.placeholder')}</span>
      </div>
      <input id="projectdoc" type="hidden" name="projectdoc" value="true">
      <input id="templateLabel" type="hidden" name="templateLabel" value="blank">
    </fieldset>
  </form>
{/template}

Page Template

The template for the blank document.

<ac:layout>
  <ac:layout-section ac:type="single">
    <ac:layout-cell>
      <ac:structured-macro ac:name="projectdoc-properties-marker">
        <ac:rich-text-body>
          <div class="table-wrap">
            <table class="confluenceTable">
              <tbody>
                <tr>
                  <th class="confluenceTh"><at:i18n at:key="projectdoc.doctype.common.shortDescription"/></th>
                  <td class="confluenceTd"><at:var at:name="projectdoc.doctype.common.shortDescription"/></td>
                  <td class="confluenceTd"></td>
                </tr>
                <tr>
                  <th class="confluenceTh"><at:i18n at:key="projectdoc.doctype.common.doctype"/></th>
                  <td class="confluenceTd">blank</td>
                  <td class="confluenceTd">hide</td>
                </tr>
                <tr>
                  <th class="confluenceTh"><at:i18n at:key="projectdoc.doctype.common.name"/></th>
                  <td class="confluenceTd"><at:var at:name="projectdoc.doctype.common.name"/></td>
                  <td class="confluenceTd"></td>
                </tr>
...

The XML code shows how the parameters from the Soy template are referenced via the at:var element.

List of Context Providers

The following context providers generate additional information and set them to the blueprint context. This information can be used in your page templates. For each standard case there is a context provider. You may want to extend on of these for your special purpose context provider or create one on your own.

 

Please note that the API for context providers is not considered stable. Changes to the context provider classes may be applied without notice and may break dependent code.

Expect the API to be stable starting with a later version of the projectdoc Toolbox.

 

NameShort Description
ProjectDocContextProvider
The standard context provider or templates.
ProjectDocSpaceContextProvider
Context provider to templates of structural pages that need not to be created individually. This is usually the case for pages like the space homepage. It is created once and edited by the user. There is no need to create this page in an existing page, like it may be the case for a doctype homepage.
ProjectDocSubdocumentContextProvider
The standard context provider or templates to create subpages. The context provider basically deals with the title uniqueness (by adding the parent document's name as part of the page title) and sort order (first documents first).
SubspaceContextProvider
The standard context provider for home and special pages.