Adds a section to a projectdoc document.
Adds a section to a document.
Sections do not track modification date and ETag. Therefore the returned information refers to the enclosing document.
Path Parameter
All path parameters are required to be specified.
name
The title or identifier of the requested section.
Representation
The format of the representation to post to the URL may be XML or JSON.
Note that the title of the document will be overridden by the title or id specified in the URL as path parameter name
.
Positioning of a document is specified with the position
and ref
elements of the representation.
content
The content references the section body.
{
"content": "The section content."
}
The body is added verbatim, so it may contain HTML tags.
{
"content": "The <strong>section</strong> content."
}
You may also specify macros as content as shown in the following example.
{
"content": "<p>A paragraph.</p><p><ac:structured-macro ac:name=\"projectdoc-display-table\" ac:schema-version=\"1\"><ac:parameter ac:name=\"doctype\">blank</ac:parameter><ac:parameter ac:name=\"render-no-hits-as-blank\">true</ac:parameter><ac:parameter ac:name=\"select\">Name, Short Description</ac:parameter><ac:parameter ac:name=\"restrict-to-immediate-children\">true</ac:parameter><ac:parameter ac:name=\"sort-by\">Sort Key, Name</ac:parameter></ac:structured-macro></p>"
}
You may enclose the body of a section within an XML element called content
.
{
"content": "<content><p>A paragraph.</p><p><ac:structured-macro ac:name=\"projectdoc-display-table\" ac:schema-version=\"1\"><ac:parameter ac:name=\"doctype\">blank</ac:parameter><ac:parameter ac:name=\"render-no-hits-as-blank\">true</ac:parameter><ac:parameter ac:name=\"select\">Name, Short Description</ac:parameter><ac:parameter ac:name=\"restrict-to-immediate-children\">true</ac:parameter><ac:parameter ac:name=\"sort-by\">Sort Key, Name</ac:parameter></ac:structured-macro></p></content>"
}
ref
Reference an existing section within the document if a section has to be added relative to an existing section.
If a referenced section is not part of the document, a 404
is returned.
The ref
parameter is only evaluated for relative positions (before
and after
).
position
New sections are added after the last section of the document per default. The position can be specified with the position property.
The following positions are valid:
before
- insert the new section before the referenced (ref
) sectionafter
- insert the new section after the referenced (ref
) sectionfirst
- insert the new section at the first positionlast
- insert the new section at the last position (default)
{
"content": "The section content.",
"position": "before",
"ref": "Summary"
}