Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Returns the current context path, and an array with all configuration names and metadata.

Example response:

Code Block
javascript
javascript
{
  "contextPath": "/content/path",
  "configNames": [
    {
      "configName": "configName",
      "label": "Sample Configuration",
      "description": "This is a sample configuration.",
      "collection": false,
      "exists": true
    },
    {
      "configName": "configNameList",
      "label": "Sample Configuration List",
      "description": "This is a sample configuration list.",
      "collection": true,
      "exists": true
    }
  ]
}


Read Configuration Data

URL: <resource-path>.configData.json?configName=<configName>[&collection=true]

...

The response may contain nested configuration data elements. Each of them has their on configName which can be used for posting as well.

Example response for singleton config:

Code Block
javascript
javascript
{
  "configName": "configName",
  "properties": [
    {
      "name": "stringParam",
      "value": "This is an example string value",
      "effectiveValue": "This is an example string value",
      "configSourcePath": "/conf/contextaware-config-sample/sample/sling:configs/io.wcm.caconfig.sample.config.ConfigSample",
      "default": false,
      "inherited": false,
      "overridden": false,
      "metadata": {
        "type": "String",
        "label": "String Param",
        "description": "This is a string parameter in the singleton configuration."
      }
    },
    {
      "name": "stringArrayParam",
      "effectiveValue": [
        "value1",
        "value2"
      ],
      "default": true,
      "inherited": false,
      "overridden": false,
      "metadata": {
        "type": "String",
        "multivalue": true,
        "defaultValue": [
          "value1",
          "value2"
        ],
        "label": "String Array Param"
      }
    }
  ]
}

Example response for collection config:

Code Block
javascript
javascript
{
  "configName": "configNameList",
  "properties": {
    "colProp1": "value1"
  },
  "items": [
    {
      "configName": "configNameList",
      "collectionItemName": "item1",
      "properties": [
        {
          "name": "stringParam",
          "value": "Value of item1",
          "effectiveValue": "Value of item1",
          "configSourcePath": "/conf/contextaware-config-sample/sample/sling:configs/io.wcm.caconfig.sample.config.ConfigSampleList/item1",
          "default": false,
          "inherited": false,
          "overridden": false,
          "metadata": {
            "type": "String",
            "label": "String Param",
            "description": "This is a string parameter within the configuration list."
          }
        }
      ]
    },
    {
      "configName": "configNameList",
      "collectionItemName": "item2",
      "properties": [
        {
          "name": "stringParam",
          "value": "Value of item2",
          "effectiveValue": "Value of item2",
          "configSourcePath": "/conf/contextaware-config-sample/sample/sling:configs/io.wcm.caconfig.sample.config.ConfigSampleList/item2",
          "default": false,
          "inherited": false,
          "overridden": false,
          "metadata": {
            "type": "String",
            "label": "String Param",
            "description": "This is a string parameter within the configuration list."
          }
        }
      ]
    }
  ]
}

In case of nested configurations the property object contains a nestedConfig (singleton) or nestedConfigCollection (collection) object, which content has the same structure as shown above.

Persist Configuration Data

...