projectdoc Toolbox

Creates a hierarchy of documents based on the posted document.

Parent
Type
Extension
Since
4.1
Path
rest/projectdoc/1/service/document-create-hierarchy
HTTP Method
POST

Creates a set of documents based on a description document.

The service accepts JSON and XML documents.

Backup your Data!

 

There is no undo!

It is strongly recommended to run commands only on backed-up instances!

Make a backup of your data before starting to work with this API! Consider to run your experiments on a copy of the production data!

Parameters

The following parameters allow to control the creation of the projectdoc documents.

space-key

The key to the space where the new document will be stored.

location

The location within the space that defines the parent page.

Either provide

  • the title of the page (not the name of the document),
  • the page identifier surrounded by curly braces (e.g.{123456}, the value of  space-key  is not taken into account in this case), or
  • the keyword {homepage} (to store the document to the doctype's homepage).

If the page title starts with a curly brace ({) and ends with one (}), you need to escape it with a backslash ( \) as in \{My Page Title}.

Document

The basic structure is a list of documents.

{
  "documents": [ ]
}    

Each document has three properties:

  1. property
    1. name
    2. value
    3. controls
    4. position
  2. section
    1. title
    2. content
  3. children - list of documents
{
      "property": [],
      "section": [],
      "children": []
}    

The basic structure of a property:

{
  "name": "Iteration",
  "value": "production",
  "controls": "hide",
  "position": "replace-values"
}   

The basic structure of a section:

{
  "title": "References",
  "content": "The content in Confluence Storage Format."
}   

Example Document

 
{
  "documents": [
    {
      "property": [
        {
          "name": "Short Description",
          "value": "Document your content management strategy.",
          "position": "replace"
        },
        {
          "name": "Doctype",
          "value": "category",
          "position": "merge"
        },
        {
          "name": "Name",
          "value": "Content Management",
          "position": "merge"
        },
        {
          "name": "Iteration",
          "value": "production",
          "controls": "hide",
          "position": "replace-values"
        }
      ],
      "section": [],
      "children": [
        {
          "property": [
            {
              "name": "Short Description",
              "value": "The content design consists of the editorial strategy and experience design.",
              "position": "replace"
            },
            {
              "name": "Doctype",
              "value": "category",
              "position": "merge"
            },
            {
              "name": "Name",
              "value": "Content Design",
              "position": "merge"
            },
            {
              "name": "Iteration",
              "value": "production",
              "controls": "hide",
              "position": "replace-values"
            },
            {
              "name": "Sort Key",
              "value": "0010",
              "controls": "hide",
              "position": "replace"
            }
          ],
          "section": [],
          "children": [
            {
              "property": [
                {
                  "name": "Short Description",
                  "value": "Part of the content design the experience design documents the audience\u0027s needs and preferences, the shape of the ecosystem the content is part of, and the way the audience encounters and interacts with the content. It also takes into account the different environments from which users of the content will access the content. This leads to the decision in which formats the content will be delivered.",
                  "position": "replace"
                },
                {
                  "name": "Doctype",
                  "value": "category",
                  "position": "merge"
                },
                {
                  "name": "Name",
                  "value": "Experience Design",
                  "position": "merge"
                },
                {
                  "name": "Iteration",
                  "value": "production",
                  "controls": "hide",
                  "position": "replace-values"
                }
              ],
              "section": [],
              "children": []
            },
            {
              "property": [
                {
                  "name": "Short Description",
                  "value": "Part of the content design the editorial strategy documents the goal, the target audience, and the general guidelines you define to talk to your audience.",
                  "position": "replace"
                },
                {
                  "name": "Doctype",
                  "value": "category",
                  "position": "merge"
                },
                {
                  "name": "Name",
                  "value": "Editorial Strategy",
                  "position": "merge"
                },
                {
                  "name": "Iteration",
                  "value": "production",
                  "controls": "hide",
                  "position": "replace-values"
                }
              ],
              "section": [],
              "children": []
            }
          ]
        },
        {
          "property": [
            {
              "name": "Short Description",
              "value": "The system design consists of the information architecture and process design.",
              "position": "replace"
            },
            {
              "name": "Doctype",
              "value": "category",
              "position": "merge"
            },
            {
              "name": "Name",
              "value": "Systems Design",
              "position": "merge"
            },
            {
              "name": "Iteration",
              "value": "production",
              "controls": "hide",
              "position": "replace-values"
            },
            {
              "name": "Sort Key",
              "value": "0020",
              "controls": "hide",
              "position": "replace"
            }
          ],
          "section": [],
          "children": [
            {
              "property": [
                {
                  "name": "Short Description",
                  "value": "The process design explains, which tools are used, how new users are welcomed on-board, and which processes support the development of content and the maintenance of the support structures. This also includes a description about the change management process.",
                  "position": "replace"
                },
                {
                  "name": "Doctype",
                  "value": "category",
                  "position": "merge"
                },
                {
                  "name": "Name",
                  "value": "Process Design",
                  "position": "merge"
                },
                {
                  "name": "Iteration",
                  "value": "production",
                  "controls": "hide",
                  "position": "replace-values"
                }
              ],
              "section": [],
              "children": []
            },
            {
              "property": [
                {
                  "name": "Short Description",
                  "value": "The information architecture explains how content is organized and why it is organized that way. It also includes how and which content should be added.",
                  "position": "replace"
                },
                {
                  "name": "Doctype",
                  "value": "category",
                  "position": "merge"
                },
                {
                  "name": "Name",
                  "value": "Information Architecture",
                  "position": "merge"
                },
                {
                  "name": "Iteration",
                  "value": "production",
                  "controls": "hide",
                  "position": "replace-values"
                }
              ],
              "section": [],
              "children": []
            }
          ]
        }
      ]
    }
  ]
}

Doctype Maven Plugin Support

The Doctype Maven Plugin supports generating category trees since version 1.8.

To switch on category tree generation by setting the generateCategoryTree to true.

<generateCategoryTree>true</generateCategoryTree>

REST Service

The Documents Create Hierarchy Service is used to create document instance hierarchies.

Category Tree Repository

The category tree files can be downloaded in JSON format on Category Trees.

List of JSON files.

Category tree for the arc42 Template for the English locale.

Category tree for the arc42 Template for the German locale.

Category tree for Content Management for the English locale.
Category tree for Content Management for the Germany locale.

Category tree for the Doctypes for Service Management for the English locale.

Category tree for the Doctypes for Service Management for the German locale.
Category tree for the Software Development Doctypes for the English locale.
Category tree for the Software Development Doctypes for the German locale.
Category tree for the Doctypes for V-Modell XT for the German locale.

Resources

More information on related topics.

Confluence Storage Format
This page describes the XHTML-based format that Confluence uses to store the content of pages, page templates, blueprints, blog posts and comments. This information is intended for advanced users who need to interpret and edit the underlying markup of a Confluence page.