I'll just ask the questions first so you don't need to try to find them below. The goal is explained about half way down.
Using Jdev 12.1.2, Sql Dev 184.108.40.206.21 and the latest Extension SDK
1. Are there any sample extensions available from Oracle for Sql Developer 4 and the new framework?
2. Is ANY documentation available on the 'sql dev specific' IDs used for menu and other user interface items?
3. Is there a CURRENT version of the extension.xsd file available?
This is the link to an article from over two years ago, by Jeff Smith, titled 'How To Create a Java Defined Extension'.
That was useful as were the other extension examples provided.
The menu structure and IDs for Sql Developer are different than for JDeveloper. So some documentation (a list?) or programmatic method is needed to obtain the IDs to use for working with the menus.
The old framework and Sql Dev samples and my own extension used 'db_nav' and I was able to get the JDev FirstSample extension from the ESDK to work in Sql Dev 4. But I don't know of any place even that one 'id' is actually documented.
The extension.xsd file deployed with both Sql Developer and JDeveloper appears to be an older version than what is required in JDeveloper. The 'menuType' says the first element can be a 'label' but JDeveloper gives an error saying it expects a section element.
<xs:element name="label" type="i18n_string" minOccurs="0"
<xs:documentation>The label for the menu.</xs:documentation>
I have reviewed all of the latest JDeveloper samples in the Extension SDK for the new OSGI extension framework.
The goal is to migrate my Sql Dev 3 extension to the new framework. It basically adds items and a submenu when you right-click on any database item (e.g. the DEPT table)
1) adding multiple, and/or multi-level, items to a context menu
2) filtering/recognizing specific node types
3) executing custom actions for the new context menu items
Assuming this tree in the DB navigator
. . .
. . .
The goal is to add additional menu items for ONLY that lowest level (the FirstSample items show up everywhere).
So for a given table, e.g. Dept, Add Custom1, Custom2 or CustomSubMenu . . . which then has Custom1 and Custom2 submenu items.
. . .
. . .
In the old framework it was easy. You just needed a listener hook in the extension.xml file
. . .
That listener class implemented both ContextMenuListener and Controller.
1. menuWillShow method - build the multi-level menu using Java code and add it to the 'contextMenu' using the parameter passed. You would define the actions and add IdeAction items to the menu. By getting the selection and testing for an 'instanceof ObjectNode (a datababase item) you could just NOT add to the menu unless the user clicked in an appropriate place in the nav tree.
2. handleEvent method - use 'action.getCommandId' to find out which of the actions (menu items) was clicked and dispatch to the appropriate code
Does anyone know of any examples of using the new extension framework to do a similar thing?
The new mix of actions, controllers, listeners, etc is rather confusing and a lot of the ESDK examples use a common extension.xml file that has a little of everything in it.
I have also been unable to find any freeware/shareware extension samples for the new framework to use as a template.
The ultimate goal of actually being able to use Sql Developer as a target platform in JDeveloper is on hold since it now uses version 12.1.3 of the JDeveloper which hasn't been publicly released yet.
Any links to samples would be appreciated.