Documentation

Content Property

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.

Using Content Properties

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

{
  "confluenceContentProperties": [
    {
      "keyConfigurations": [
        {
          "propertyKey": "attachment",
          "extractions": [
            {
              "objectName": "attachment.size",
              "type": "number"
            },
            {
              "objectName": "attachment.type",
              "type": "string",
              "alias": "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"
      }
    }
  ]
}

Properties

key

Type
string
Required
Yes
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 /plugins/servlet/ac/my-addon/configure-me.

name

Required
Yes
Description

A human readable name.

keyConfigurations

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.