- Created by Robert Reiner, last modified on 28. Mar 2019
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 10 Next »
projectdoc Toolbox
Creates a new projectdoc document based on a document representation.
- Type
- Extension
- Since
- 1.1
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.
Position | Target | Supports ref | Description |
---|---|---|---|
before | Property | Add the property before the property specified by ref . If the referenced property is not found, a 404 will be returned for that document. | |
before | Section | Add the section before the section specified by ref . If the referenced section is not found, a 404 will be returned for that document. | |
after | Property | Add the property after the property specified by ref . If the referenced property is not found, a 404 will be returned for that document. | |
after | Section | Add the section after the section specified by ref . If the referenced section is not found, a 404 will be returned for that document. | |
first | Property | Add the property in front of all properties. | |
first | Section | Add the section in front of all sections. | |
last | Property | Add the property after all properties. | |
last | Section | Add the section after all sections. | |
delete | Property | Deletes the specified property. | |
delete | Section | Deletes the specified section | |
replace | Property | Replaces the specified property with this information. The ref references the property to be replaced (defaults to name ). | |
merge | Property | Merges the specified property with this information. If no information is provided for value or controls, the existing information is not changed. The Since version 4.10 this position allows to rename a property if value and controls are empty. | |
merge-values | Property | Like merge but also merges properties provided into list values. Available since version 3.1. | |
delete-values | Property | Like merge-values but removes the elements from the property list value. Available since version 3.1. | |
replace-values | Property | Like merge-values but clears the values before inserting the new. Available since version 6.0. | |
replace-or-add | Property | 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 ). | |
replace | Section | 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 ofspace-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.
- No labels