Extensions API Reference
API Reference for the ChartSQL Studio Extensions API
Extensions are in development. They will allow you to customize the editor with additional functionality and third party tools.
Interface com.chartsql.studio.model.Extension
com.chartsql.studio.model.Extension
Every Extension entry point is a single class file that implements com.chartsql.studio.model.Extension
interface
Extension Lifecycle Methods
Your Extension class has "lifecycle methods" that are called at different points in the request and rendering lifecycle. You use these lifecycle methods to intercept and implement UI features.
onRequest
Called at the start of a user HTTP request, the lifecycle method onRequest()
allows you to inspect and inject data into the request context object prior to any work performed by ChartSQL Studio.
onRequest Function Arguments
Name | Type | Description |
---|---|---|
context | struct | The request context structure that contains all of the HTTP request |
onResult
Called after ChartSQL Studio has finished processing the request but before it has rendered the HTML output. The onResult()
lifecycle method allows you to change the ChartSQL Studio's data structure output that will be used by the rendering.
onResult Function Arguments
Name | Type | Description |
---|---|---|
requestContext | struct | The request context structure that contains all of the HTTP request |
result | struct | The result of any controller processing for the request before rendering is completed. |
onRender
Called after ChartSQL Studio has rendered the next response. The onRender()
lifecycle methods allows you to manipulate the HTML output that will be sent to the user.
onRender Function Arguments
Name | Type | Description |
---|---|---|
requestContext | struct | The request context structure that contains all of the HTTP request |
result | struct | The result of any controller processing for the request before rendering is completed. |
doc | Jsoup Object | Jsoup document object model (DOM) that can be used to manipulate the content that will be returned to the UI |
Remote HTTP Methods
You can add methods to your extension that can be called from the UI via HTML forms or HTTP POST. Remote HTTP methods allow you to wire up buttons and forms that communicate with the backend ChartSQLStudio process.
Defining a HTTP method requires annotating a function in your extension with the remote
keyword.
You will then be able to POST to the function with HTML forms from the UI:
Class InfoPanelView
InfoPanelView
com.chartsql.studio.model.InfoPanelView
InfoPanelViews allow you to define additional panels that show up in the info area of the editor. Your Extension may instantiate instances of InfoPanelViews.
Constructor Arguments
Name | Required? | Default | Type | Description |
---|---|---|---|---|
ChartSQLStudio | n/a | ChartSQLStudio | The instance of the ChartSQLStudio editor singleton. | |
Name | n/a | string | The name for your InfoPanelView which shows up in the tab name in the UI. | |
IconClass | n/a | string | The CSS class name for the icon to use for the tab. See https://tabler.io/icons | |
content | "" | string | The HTML content for the body of the info panel view. You can set this on creation or update later. |
Property Summary
Name | Type | ReadOnly? | Description |
---|---|---|---|
Name | string | The name for your InfoPanelView which shows up in the tab name in the UI. | |
Link | string | The URL link to the InfoPanelView that is rendered in the UI. You do not set this directly, it will be calculated. | |
IconClass | string | The CSS class name for the icon to use for the tab. See https://tabler.io/icons | |
Content | string | The HTML content for the body of the info panel view. You can set this on creation or update later. |
Class FileBrowserView
FileBrowserView
com.chartsql.studio.model.FileBrowserView
FileBrowserViews allow you to define additional views hat show up in the file broser area of the editor. Your Extension may instantiate instances of FileBrowserView
Constructor Arguments
Name | Required? | Default | Type | Description |
---|---|---|---|---|
ChartSQLStudio | n/a | ChartSQLStudio | The instance of the ChartSQLStudio editor singleton. | |
Name | n/a | string | The name for your FileBrowserView which shows up in the tab name in the UI. | |
IconClass | n/a | string | The CSS class name for the icon to use for the tab. See https://tabler.io/icons | |
content | "" | string | The HTML content for the body of the FileBrowserView. You can set this on creation or update later. |
Property Summary
Name | Type | ReadOnly? | Description |
---|---|---|---|
Name | string | The name for your FileBrowserView which shows up in the tab name in the UI. | |
Link | string | The URL link to the FileBrowserView that is rendered in the UI. You do not set this directly, it will be calculated. | |
IconClass | string | The CSS class name for the icon to use for the tab. See https://tabler.io/icons | |
Content | string | The HTML content for the body of the FileBrowserView. You can set this on creation or update later. |
Last updated