Thursday, November 09, 2006

XML Extension Points ( Reports )


Hopefully, some people came to the presentation at openworld. In the presentation I showed how with just XML and "a couple" lines of java the tool can be extended. After getting settled in and the first EA of sqldev out, I got the "couple" lines out so it's now really simple to have things like shared reports, editors, navigator extensions, context menu actions.


Xml Prefs


I'll do a blog on each of these options. This preference pane now takes the place of some of the command line flag which were being used in 1.0 and adds some new ones.





Now I'm sure everyone knows about the SQL Developer Exchange since Sue mentioned it before. So now let's add the reports everyone has defined in the exchange. In the exchange if you navigate to the My Folders page there's a download link under the list of folder.


Exchange Reports


Now save the link which the Download leads to and we'll need that in the next step which is to tell SQL Developer where to get the reports. In the preferences there's a Database->User Defined Extensions. After clicking the add row button there's a drop list of type to pick from, for this we'll choose reports. Then just put in the url we copied into the Location. This location can be any url or file location. For example /Users/klrice/reports.xml or on windows Z:\myshared\folder\reports.xml


Xml Exchange Reports


The preference doesn't yet warn that a restart is needed but it will before it gets stamped production. However, now that you know it needs a restart. Restart SQL Developer. Once it's restarted take a look at the Reports and you should see something that looks quite like the structure from the exchange under shared reports.


Shared Reports


Now that my report is listed I can run it and see that I can save some space by issuing the command listed.


Space Report


While the exchange was used in this example. The same could apply to simply exporting some reports created and hosting the resulting xml file internally or on the public net. For those who will look and I know there's some, I'll explain how the xml in the reports changed in a later blog.


Now the last thing to mention on this is for people who are writing extension there's a java call to register reports also and it's about as easy:



ReportAddin.registerReport(URL);

No comments: