Skip to content

Commit

Permalink
Update API.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelthca committed Jun 19, 2018
1 parent d366281 commit ac3e116
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
- **PARAMETERS**:
- p_node: Tree node object.

- p_node.createChildNode(p_text,p_expanded,p_icon,p_tag)
- ```p_node.createChildNode(p_text,p_expanded,p_icon,p_tag)```
- **DESCRIPTION**: Creates a child node in the current node. This function is supposed to be called with hooks that contain p_node as parameter.
- **PARAMETERS**:
- p_text: node text.
- p_expanded: whether to expand the node when creating it. This is useful when creating childs of childs.
- p_icon: path of an image to be used in the tab title. Use together with getPluginPath() to get the correct relative path.
- p_tag: sets a tag for the child node. This is useful to create custom attributes that will be used to identify this node when other hooks are triggered.

- callPluginFunction({ p_plugin_name: '', p_function_name: '', p_data: null, p_callback: null, p_loading: true, p_check_database_connection: true })
- ```callPluginFunction({ p_plugin_name: '', p_function_name: '', p_data: null, p_callback: null, p_loading: true, p_check_database_connection: true })```
- **DESCRIPTION**: Asynchronously calls a specific python function of a specific plugin (python backend).
- **PARAMETERS**:
- p_plugin_name: the name of the plugin.
Expand All @@ -74,7 +74,7 @@
- p_loading: whether to show the loading image.
- p_check_database_connection: whether to check if the database connection is working before calling the python function.

- createInnerTab({ p_name: '', p_image: '', p_select_function: null, p_before_close_function: null })
- ```createInnerTab({ p_name: '', p_image: '', p_select_function: null, p_before_close_function: null })```
- **DESCRIPTION**: Creates an internal blank tab.
- **PARAMETERS**:
- p_name: the name of the tab.
Expand All @@ -83,7 +83,7 @@
- p_before_close_function: function to be called before the tab is closed.
- **RETURNS**: tab object tag.

- createOuterTab({ p_name: '', p_image: '', p_select_function: null, p_before_close_function: null })
- ```createOuterTab({ p_name: '', p_image: '', p_select_function: null, p_before_close_function: null })```
- **DESCRIPTION**: Creates an external blank tab.
- **PARAMETERS**:
- p_name: the name of the tab.
Expand All @@ -92,35 +92,36 @@
- p_before_close_function: function to be called before the tab is closed.
- **RETURNS**: tab object tag.

- getSelectedInnerTabTag()
- ```getSelectedInnerTabTag()```
- **DESCRIPTION**: Gets the tag of the selected internal tab, allowing to store information there.
- **RETURNS**: Selected internal tab tag.

- getSelectedOuterTabTag()
- ```getSelectedOuterTabTag()```
- **DESCRIPTION**: Gets the tag of the selected external tab, allowing to store information there.
- **RETURNS**: Selected external tab tag.

- createSQLTab({ p_name: '', p_template: '', p_show_qtip: true })
- ```createSQLTab({ p_name: '', p_template: '', p_show_qtip: true })```
- **DESCRIPTION**: Creates an internal Query Tab with a specific SQL passed as a parameter.
- **PARAMETERS**:
- p_name: the name of the tab.
- p_template: the SQL to be filled in the editor.
- p_show_qtip: whether to show a tip with the message "Adjust command and run!"

- getPluginPath(p_plugin_name)
- ```getPluginPath(p_plugin_name)```
- **DESCRIPTION**: Get the path of the specific plugin to use reference static files.
- **PARAMETERS**:
- p_plugin_name: the name of the plugin.

- showError(p_message): shows a popup with the specific error message
- ```showError(p_message)```
- **DESCRIPTION**: Shows a popup with the specific error message.

- setDDL({ p_ddl: '', p_select: true})
- ```setDDL({ p_ddl: '', p_select: true})```
- **DESCRIPTION**: Sets the content of the DDL box in the DDL tab.
- **PARAMETERS**:
- p_ddl: the DDL to be filled in the editor.
- p_select: whether to also select the DDL tab.

- setProperties({ p_properties: [], p_select: true})
- ```setProperties({ p_properties: [], p_select: true})```
- **DESCRIPTION**: Sets the content of the Properties grid in the Properties tab.
- **PARAMETERS**:
- p_properties: the properties to be displayed in the grid. This is a list of lists.
Expand All @@ -132,7 +133,8 @@ Plugins on the python side are implemented as user defined functions that will b
the javascript API function `callPluginFunction()`. The functions are called always
with 2 parameters:

- my_python_function(p_database_object, p_data)
- p_database_object: OmniDB's database object that contains several attributes
and functions to retrieve data from the database.
- p_data: optional paramater to send data from the javascript side.
- ```my_python_function(p_database_object, p_data)```
- **PARAMETERS**:
- p_database_object: OmniDB's database object that contains several attributes
and functions to retrieve data from the database.
- p_data: optional paramater to send data from the javascript side.

0 comments on commit ac3e116

Please sign in to comment.