Introduction
The
How To Create an XML User Defined Extension Introduction example demonstrates how to add a new node to the database navigator.
The Sample code can be downloaded here
ftp://ftp.oracle.com/svrtech/outgoing/sqldev_sdk/xml_simple_tablespace.zip
The tablespace_nav.xml file specified the new nodes in the navigator
Extend the Navigator
The XML in bold specifies the node information.
A query is used to populate the folder with children nodes, each row returned by the query represents another child.
The children nodes are defined in the <node> tags. In this case only their icon is specified.
The names displayed in the navigator automatically uses the column defined with the id="NAME"
<?xml version="1.0" encoding="windows-1252" ?>
<navigator RESOURCE_FILE="oracle.dbtools.raptor.navigator.OracleNavigatorResource"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="navigator.xsd">
<objectType connType="Oracle" id="TABLESPACE" weight="100.0" includesSyns="true">
<folder>
<icon RSKEY="TABLE_FOLDER_ICON"/>
<label RSKEY="Tablespaces"/>
<queries>
<query minversion="8">
<sql constrained="true">
<![CDATA[SELECT tablespace_name FROM USER_TABLESPACES]]>
</sql>
</query>
<columns>
<column filterable="true" sortable="true" id="TABLESPACENAME">
<colName>
<![CDATA[TABLESPACE_NAME]]>
</colName>
</column>
<column filterable="true" sortable="true" id="NAME">
<colName>
<![CDATA[TABLESPACE_NAME]]>
</colName>
</column>
</columns>
</queries>
</folder>
<node>
<icon RSKEY="OracleIcons.TABLE"/>
</node>
</objectType>
</navigator>
Copy the code above and paste it into a new file such as tablespace_nav.xml.
- Open Oracle SQL Developer, select Tools -> Preferences. Expand the Database node, and select User Defined Extensions.
- Click Add Row, click in the Type field, and select NAVIGATOR from the list.
- Click in the Location field, and click Browse to add the location of the tablespace_nav.xml file.
- Restart Oracle SQL Developer to register this new extension.
You should now see that you can browse a Tablespace node in the databases navigator.
Although the list of tablespaces is now available in the database navigator, nothing shows up on the right hand side when a tablespace is selected.