Extension options are configurable settings defined by an extension developer. These options customize an extension's behavior for each workspace. For example, a developer can define an option that lets users control the SQL length limit, allowing the same extension to enforce different limits in different workspaces.
Background
Extension options are defined by the developer when an extension is registered. Users can then configure these options within a specific workspace.
For more information about how developers register extensions, see Develop and deploy an extension: Self-managed service method.
When using an extension in a workspace, you can configure its options before enabling it. On the Workspace Configuration > Extensions page, you can view a list of registered extensions with details such as extension points, applicable modules, and status. Select a scope, such as Global, from the extension scope drop-down list, and then click Settings in the Actions column to configure a registered extension.
Extension developers can call the GetOptionValueForProject API to retrieve the configuration values set by a user (such as a workspace administrator) for an extension in a specific workspace.
Notes
The extension developer provides the configuration information and related text for extension options. The platform is not responsible for any risks associated with the content.
Supported components
Option configuration currently supports seven types of form components: text (for static text display), single-line input box, multi-line input box, single-select drop-down list, multi-select drop-down list, checkbox (supports multiple options, such as opt1, opt2, and opt3), and radio button (supports multiple options, some of which can be disabled).
Option configuration
When registering an extension, the extension developer must define the options as a JSON string in the Option Configuration field.
{
"type": "object",
"properties": {
"Component name (must be unique)": {
"type": "string",
"title": "See the table below",
"x-decorator": "See the Parameters section for details",
"x-component": "See the Parameters section for details",
"x-decorator-props": {
"tooltip": "Description"
},
"x-component-props": {
"dataSource": "See the Parameters section for details",
"mode": "multiple"
}
}
}
}You can refer to the following resources for configuration:
For details about component parameters, see Parameters.
For component configuration examples, see Example: Set the CU resource threshold for an SQL task and Example: Use the seven component types.
For more information about registering and managing extensions, see Develop and deploy an extension: Self-managed service method.
Parameters
Parameter | Component type | Value |
title | text | The title of the component. |
single-line input box | The title of the component. | |
multi-line input box | The title of the component. | |
single-select drop-down list | The title of the component. | |
multi-select drop-down list | The title of the component. | |
checkbox | The title of the component. | |
radio button | The title of the component. | |
x-decorator | text | FormItem |
single-line input box | FormItem | |
multi-line input box | FormItem | |
single-select drop-down list | FormItem | |
multi-select drop-down list | FormItem | |
checkbox | FormItem | |
radio button | FormItem | |
x-component | text | PreviewText.Input |
single-line input box | Input | |
multi-line input box | Input.TextArea | |
single-select drop-down list | Select | |
multi-select drop-down list | Select | |
checkbox | Checkbox.Group | |
radio button | Radio.Group | |
dataSource | text | optional |
single-line input box | optional | |
multi-line input box | optional | |
single-select drop-down list | The data source is an array of unique objects. Each object must contain a | |
multi-select drop-down list | The data source is an array of unique objects. Each object must contain a | |
checkbox | The data source is an array of unique objects. Each object must contain a | |
radio button | The data source is an array of unique objects. Each object must contain a |
Example: Set CU threshold for SQL tasks
The following example demonstrates how to set a CU resource threshold for an SQL task.
After you enter the JSON Schema in the Option Configuration text area of the Register Extension form, the system automatically generates an Extension Options dialog box that displays the corresponding form controls, such as the CU Threshold input box.
The following JSON defines this configuration:
{
"type": "object",
"properties": {
"cuNumber": {
"type": "string",
"title": "CU Threshold",
"x-decorator": "FormItem",
"x-component": "Input",
"x-decorator-props": {
"tooltip": "Enter the CU consumption threshold for the SQL task."
}
}
}
}Example: Use the seven component types
The following example demonstrates how to configure and use the seven component types.
After you enter the JSON configuration in the Option Configuration field of the Register Extension dialog box, the Extension Options dialog box renders the seven corresponding form components.
The following JSON defines this configuration:
If you want to use all seven components at once, you can copy the following JSON and modify the data as needed.
{
"type":"object",
"properties":{
"text":{
"type":"string",
"title":"Text",
"x-decorator":"FormItem",
"x-component":"PreviewText.Input",
"x-decorator-props":{
"tooltip":"Description"
},
"default":"This is text information"
},
"input":{
"type":"string",
"title":"Single-line Input Box",
"x-decorator":"FormItem",
"x-component":"Input",
"x-decorator-props":{
"tooltip":"Description"
},
"x-component-props":{
},
"default":"This is the default value"
},
"textarea":{
"type":"string",
"title":"Multi-line Input Box",
"x-decorator":"FormItem",
"x-component":"Input.TextArea",
"x-decorator-props":{
"tooltip":"Description"
},
"x-component-props":{
},
"default":"This is the default value"
},
"select":{
"type":"string",
"title":"Single-select Drop-down List",
"x-decorator":"FormItem",
"x-component":"Select",
"x-decorator-props":{
"tooltip":"Description"
},
"x-component-props":{
"dataSource":[
{
"value":"10001",
"label":"opt1"
},
{
"value":10002,
"label":"opt2"
},
{
"value":10003,
"label":"opt3",
"disabled":true
}
]
},
"default":"10001"
},
"selectmore":{
"type":"string",
"title":"Multi-select Drop-down List",
"x-decorator":"FormItem",
"x-component":"Select",
"x-decorator-props":{
"tooltip":"Description"
},
"x-component-props":{
"dataSource":[
{
"value":"10001",
"label":"opt1"
},
{
"value":10002,
"label":"opt2"
},
{
"value":10003,
"label":"opt3",
"disabled":true
}
],
"mode":"multiple"
},
"default":["10001","10002"]
},
"checkbox":{
"type":"array",
"title":"Checkbox",
"x-decorator":"FormItem",
"x-component":"Checkbox.Group",
"x-decorator-props":{
"tooltip":"Description"
},
"x-component-props":{
"dataSource":[
{
"value":"10001",
"label":"opt1"
},
{
"value":10002,
"label":"opt2"
},
{
"value":10003,
"label":"opt3",
"disabled":true
}
],
"mode":"multiple"
},
"default":["10001","10002"]
},
"radio":{
"type":"number",
"title":"Radio Button",
"x-decorator":"FormItem",
"x-component":"Radio.Group",
"x-decorator-props":{
"tooltip":"Description"
},
"x-component-props":{
"dataSource":[
{
"value":"10001",
"label":"opt1"
},
{
"value":10002,
"label":"opt2"
},
{
"value":10003,
"label":"opt3",
"disabled":true
}
],
"mode":"multiple"
},
"default":"10001"
}
}
}For more information, see Best Practices: Prohibit the Use of the MAX_PT Function.