Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Document Properties Marker
overridefalse
Short DescriptionUpdates and renames a document property.
 

Doctypeaddon-componenthide
NameProperty Service / PATCH
 

Short NamePATCH
 

Parent
Parent Property
property-nameName
 

Audience
Name List
render-no-hits-as-blanktrue
addon-componentrole
propertyAudience
 

Type

Name List
doctypeaddon-component-type
render-no-hits-as-blanktrue
namesREST Method
propertyType

 

Subject
Name List
doctypesubject
propertySubject
 

Categories
Name List
doctypecategory
propertyCategories
 

Tags
Tag List
propertyTags
 

Iteration

Iteration
value

filled

finished

hide
ExtensionWeb API Extension
Since1.1
 

Path

Parent Property
add-linkfalse
propertyPath
property-namePath

 



Deprecatedhide
Removedhide
Sort Key00300hide
Section
indextrue
show-titlefalse
titleDescription

Updates and renames a document property.

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!
projectdoc-boxtransclusion-warningmacro
documentPlease Backup your Data first!
idsSummary

If your environment does not support the HTTP PATCH method try to use the patch resource at projectdoc/1/patch/document/{id}/property/{name} as a workaround.

Properties do not track modification date and ETag. Therefore the returned information refers to the enclosing document.

Section
titlePath Parameter

All path parameters are required to be specified.

Section
titlename

The name of the requested property.

Section
titleid

The unique identifier of the requested projectdoc document.

Section
titlenamenew-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.

The parameter is available since version 1.2.

Section
titlecomment

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

The parameter is available since version 1.2The name of the requested property.

Section
titleRepresentation

The format of the representation to post to the URL may be XML or JSON.

Here is the basic structure in JSON:

Code Block
{
  "name": "",
  "value": "",
  "controls": "",
  "position": ""
}

Only the following position values are allowed:

PositionSinceDescription
replace-or-add
 - replaces
1.0Replaces an existing property or - if it does not exist - add it (default).
replace
- replaces an existing propertymerge - merges
1.0Replaces an existing property.
merge1.0

Merges the information into an existing property.

Property value and property controls of the existing property are only overridden if the new value is not empty.

merge-values3.1

Merges the information into an existing property.

Looking at the property as a list of values the service integrates the given values into the existing list.

Duplicates are not added.

delete-values3.1

Merges the information into an existing property.

Looking at the property as a list of values the service removes all values provided in the given list.

replace-values6.0

Merges the information into an existing property.

Removes all values and replaces them with the new ones.

In contrast to replace this position will keep the structure of the value untouched. So the values are replaced inside a macro. The macro is not replaced by the values.

For the list postion values (position ends with -values) values the following macros are supported:

  1. Name List Macro (Names parameter)
  2. Tag List Macro (Names parameter)
  3. Name Body List Macro (body)
  4. Tag Body List Macro (body)
  5. Parent Property Macro (Parent Doctype parameter)

Caution Box

If you use replace and you do not specify a value for controls, the property controls will be overridden with blank.

Typically you would use merge to only set the value.

Section
titleExamples

The following examples show usage scenarios for this service.

For all examples keep in mind: The name of the referred property, as well as the document it is part of, is specified in the URL.

Example Box
titleReplace a Property Value

The following sets the value and preserves the control values.

Code Block
{
  "value": "The value of the new property.",
  "position": "merge"
}

If you would use position 'replace' you would remove any controls set to the property. Replace replaces value and controls. The name is never removed by a blank property, so it can be omitted.

...