Files
opencloud/settings/docs/bundles.md
A.Unger f725ddaa65 Add 'settings/' from commit '230545a4a75b0611988fbcea51336a6c316d6a3d'
git-subtree-dir: settings
git-subtree-mainline: c26f7b390a
git-subtree-split: 230545a4a7
2020-09-18 12:43:43 +02:00

1.9 KiB

title, date, weight, geekdocRepo, geekdocEditPath, geekdocFilePath
title date weight geekdocRepo geekdocEditPath geekdocFilePath
Settings Bundles 2020-05-04T00:00:00+00:00 50 https://github.com/owncloud/ocis-settings edit/master/docs bundles.md

A Settings Bundle is a collection of settings, uniquely identified by the key of the extension registering the bundle and the key of the bundle itself. It's purpose is to let oCIS extensions define settings and make them available to users. They are dynamically rendered into forms, available in the frontend.

As of now we support five different types of settings:

  • boolean
  • integer
  • string
  • single choice list of integers or strings
  • multiple choice list of integers or strings

Each Setting is uniquely identified by a key within the bundle. Some attributes depend on the chosen type of setting. Through the information provided with the attributes of the setting, the settings frontend dynamically renders form elements, allowing users to change their settings individually.

Example

{
  "identifier": {
    "extension": "ocis-accounts",
    "bundleKey": "profile"
  },
  "displayName": "Profile",
  "settings": [
    {
      "settingKey": "lastname",
      "displayName": "Lastname",
      "description": "Input for lastname",
      "stringValue": {
        "placeholder": "Set lastname"
      }
    },
    {
      "settingKey": "age",
      "displayName": "Age",
      "description": "Input for age",
      "intValue": {
        "min": "16",
        "max": "200",
        "step": "2",
        "placeholder": "Set age"
      }
    },
    {
      "settingKey": "timezone",
      "displayName": "Timezone",
      "description": "User timezone",
      "singleChoiceValue": {
        "options": [
          {
            "stringValue": "Europe/Berlin",
            "displayValue": "Europe/Berlin"
          },
          {
            "stringValue": "Asia/Kathmandu",
            "displayValue": "Asia/Kathmandu"
          }
        ]
      }
    }
  ]
}