projectdoc Toolbox

Runs a projectdoc cleanup on the referenced document.

Parent
Type
Extension
Path
rest/projectdoc/1/service/cleanup
HTTP Method
POST

The projectdoc Toolbox is quite picky when processing property information in a properties table. It assumes that there is only plain text for the property name and the property controls. If an author copies a value from another web page as a property value, this text may contain additional HTML span or div elements. These elements are not rendered, but they are considered to be part of the value definition.

This problems can be manually solved using the Confluence Source Code Editor. The author simply needs to remove the extra HTML elements that have been added.

This service supports authors to execute some come cleanup procedures. These include:

  1. Remove any HTML elements from the property name
  2. Remove any HTML elements from the property controls
  3. Remove span, div, and p HTML elements from the property values
  4. Remove br elements from the property values

Document properties with the preserve control are not cleaned up. So this control enables page authors to override the cleaning process for a particular property.

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

These parameters control the cleaning procedure of a projectdoc document.

id-list

The comma-separated unique identifiers of the projectdoc documents to process.

The properties of these documents are cleaned. This includes the name, the value, and the controls of all properties. If a property is marked with preserve, this particular property is skipped and not cleaned.

new-version

 Flag to control whether a new version should be created. If set to false, the document is saved without creating a new version. Defaults to true to create a new version.

comment

 The optional comment for the version. If no new version is created, the current comment is overridden.

include-children

If checked, the process also cleans up the child documents of the specified document.

If this boolean request parameter is set to true, not only the document specified with the id parameter is cleaned, but also all of its children and their children.

html-elements

The comma-separated HTML tag names to remove from the property values. Defaults to span, div, p.

Select the names of HTML elements you want to remove here. If you set at least one element, the defaults are no longer taken into account. If you want to add additional elements to the defaults, you need to add the defaults as well.

property-names

The list of comma-separated properties to cleanup. If none is given, all properties are cleaned. Note that properties with the preserve control are never cleaned.

Related Components

Documents Create Facade Service
Creates a new projectdoc document based on a doctype, name, and short description.
CSV Bulk Update Service
Runs a bulk update based on a uploaded file. The information will patch existing files and create new ones.
Documents Create Hierarchy Service
Creates a hierarchy of documents based on the posted document.
CSV Update Service
Runs an update on a single projectdoc document based on an uploaded file. The information will patch the existing document or create a new one if the document does not exist.

Resources

Bookmarklets List Macro
List of bookmarklets provided by the projectdoc Toolbox.