projectdoc Toolbox

Creates a new projectdoc document based on a document representation.

Parent
Type
Extension
Since
1.1
Path
rest/projectdoc/1/document

Creates a new projectdoc document based on a document representation.

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!

Representation

The representation is posted to the REST service and requires the following form.

 

Since version 4.0 this service requires to post a document with properties and optional sections. Properties must contain a doctype, a name (will be uses as the title of the document), and a short description.

  {
    "property": [
      {
        "name": "New Property",
        "value": "My Value",
        "controls": "",
        "position": "after",
        "ref": "Name"
      }
    ],
    "section": [
      {
        "title": "My Section",
        "content": "<p>Some text</p>",
        "position": "before",
        "ref": "References"
      }
    ]
  }

The name, value, and controls specify the values for the property to apply. The title and content specify the information for the section.

The position and ref specify the position where to add the property or section. The position may be one of the following keywords, while ref (that is: reference) specifies the name of a property or title of a section relative to which the position is evaluated.

PositionTargetSupports refDescription
beforeProperty (tick) Add the property before the property specified by ref. If the referenced property is not found, a 404 will be returned for that document.
beforeSection (tick) Add the section before the section specified by ref. If the referenced section is not found, a 404 will be returned for that document.
afterProperty (tick) Add the property after the property specified by ref. If the referenced property is not found, a 404 will be returned for that document.
afterSection (tick) Add the section after the section specified by ref. If the referenced section is not found, a 404 will be returned for that document.
firstProperty (error) Add the property in front of all properties.
firstSection (error) Add the section in front of all sections.
lastProperty (error) Add the property after all properties.
lastSection (error) Add the section after all sections.
deleteProperty (error) Deletes the specified property.
deleteSection (error) Deletes the specified section
replaceProperty (question) Replaces the specified property with this information. The ref references the property to be replaced (defaults to name).
mergeProperty (question)

Merges the specified property with this information. If no information is provided for value or controls, the existing information is not changed. The ref references the property to have the new information merged into (defaults to name).

Since version 4.10 this position allows to rename a property if value and controls are empty.

merge-valuesProperty (question) Like merge but also merges properties provided into list values. Available since version 3.1.
delete-valuesProperty (error) Like merge-values but removes the elements from the property list value. Available since version 3.1.
replace-valuesProperty(question)Like merge-values but clears the values before inserting the new. Available since version 6.0.
replace-or-addProperty (question) Replaces the property with the given name if it exist, otherwise adds a new property at the end. The ref references the property to be replaced (defaults to name).
replaceSection (question) Replaces the specified section. The ref references the section to be replaced (defaults to title).

Parameters

The following parameters allow to control the creation of a projectdoc document.

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}.

expand

Define if properties and/or sections should be expanded. Select from property and section. If both a specified, separate the two values by a single comma (no spaces).

This parameter refers to the representation returned on the request.

resource-mode

Controls how properties are rendered. Valid values are html, value, and storage  (default).

This parameter refers to the representation returned on the request.

navigation

Control the response information according to links to properties and section. Per default no links are rendered. Use none to suppress all links, all to render all links. Use property and section to identify the links you want to have rendered. Use the comma as separator.

The amount of links may provide much header data. So much so that it exceeds the standard 8k Bytes that is allowed by standard installations.

The parameter is available since version 1.3.1.