The purpose of this module is to make the data inside content properties available to CQL search so that add-on vendors can search for content they have set data on via CQL.
Content properties are one of the forms of persistence available for Confluence Connect add-ons, allowing you to store key-value pairs against a piece of content, where the value must be well formed JSON. Content Properties are stored as JSON objects, and allow you to track extra information that your add-on needs, without the use of a backing data-store. Values from these JSON objects can be extracted, indexed and made available to CQL queries.
To start creating and manipulating content properties, you don't need to declare anything in your descriptor. Just use the REST API to store your JSON data against a piece of content.
To integrate with search, you'll need to define some extractions to declare what fields and nested data you want to be indexable by Confluence. You can also optionally define an alias for simpler CQL querying, and UI support for your fields to be filterable by users on the search screen and in the CQL query builder.
Once you've done that, you can use CQL to query content based on your custom content property.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
{
"confluenceContentProperties": [
{
"keyConfigurations": [
{
"propertyKey": "myFirstAddon_attachment",
"extractions": [
{
"objectName": "attachment.size",
"type": "number"
},
{
"objectName": "attachment.type",
"type": "string",
"alias": "myFirstAddon_contentType",
"uiSupport": {
"defaultOperator": "~",
"name": {
"value": "Content Type",
"i18n": "attachment.type.name"
},
"tooltip": {
"value": "Content Type Tooltip",
"i18n": "attachment.type.tooltip"
},
"dataUri": "/data/content-types",
"valueType": "string"
}
},
{
"objectName": "attachment.updated",
"type": "date"
}
]
}
],
"name": {
"value": "Attachment Index Document"
}
}
]
}
key
Type | |
Max length | 100 |
Required | Yes |
Pattern | ^[a-zA-Z0-9-]+$ |
Description | A key to identify this module. This key must be unique relative to the add on, with the exception of Confluence macros: Their keys need to be globally unique. Keys must only contain alphanumeric characters and dashes. The key is used to generate the url to your add-on's module. The url is generated as a combination of your add-on key and module key. For example, an add-on which looks like: { "key": "my-addon", "modules": { "configurePage": { "key": "configure-me", } } }
Will have a configuration page module with a URL of |
name
Type | |
Required | Yes |
Description | A human readable name. Represents a string that can be resolved via a localization properties file. You can use the same Example1 2 3 4
|
value |
| ||||||||
i18n |
|
keyConfigurations
Type | |
Description | A Content Property Index Key Configuration defines which values from your JSON content property object should be indexed and made available to the CQL search syntax. |
Rate this page: