Community
Participate
Working Groups
The following extension point is used to manage the DSE content. <extension point="org.eclipse.ui.navigator.navigatorContent"> <navigatorContent name="Database_Explorer_Oracle_Content_Extension" priority="high" activeByDefault="true" contentProvider="oracle.dbtools.connectivity.ui.explorer.providers.ServerExplorerContentProvider" labelProvider="oracle.dbtools.connectivity.ui.explorer.providers.label.ServerExplorerlabelProvider" id="oracle.dbtools.connectivity.ui.explorer.providers.ServerExplorerContentProvider"> <commonSorter id ="oracle.dbtools.connectivity.ui.explorer.providers.Sorter" class="oracle.dbtools.connectivity.ui.explorer.providers.Sorter"> </commonSorter> <triggerPoints> <or> <instanceof value="org.eclipse.datatools.modelbase.sql.schema.Schema" /> <instanceof value="oracle.dbtools.modelbase.db.ComposedType" /> </or> </triggerPoints> <possibleChildren> <or> <instanceof value="org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.virtual.IVirtualNode" /> <instanceof value="oracle.dbtools.modelbase.db.MaterializedView" /> <instanceof value="oracle.dbtools.modelbase.db.ComposedType" /> </or> </possibleChildren> </navigatorContent> </extension> oracle.dbtools.connectivity.ui.explorer.providers.Sorter.compare(..) is invoked, when navigating into a Schema, for folders created by the plugin but not for the generic folders like Tables, Views, Stored Procedures etc. So currently it is not possible to sort all the folders in any order.
No estimate at this time. Brian, please investigate whether or not this is a navigator framework issue or if we just need to figure out the proper settings in the extension point.
I suspect that the reason the sorter isn't working is that the other nodes are being sorted by the ExplorerSorterProvider in *.connectivity.sqm.core.ui. The sorter framework in the 3.2 navigator doesn't have a way to simply override an existing sorter. If your content provider doesn't provide the content to those nodes, you can't sort them. We could ask the navigator folks to provide a way to override a sorter in a particular context, but I'm not sure how they'd manage it with the way the sorters are currently implemented.
Anthos, can you try something in regards to this sorter issue? Can you try using "enablement" instead of "triggerPoints"? And if that doesn't work, can you have both an enablement and triggerPoints section? I'm just curious as to whether the nav framework is looking at these two (enablement/triggerPoints) differently as far as the sorter goes.
Anthos, after digging into this more, I'm confused. Is it that you make a mix of framework and your nodes and they're always out of order? I've seen this with some Sybase profiles we're developing with the Catalogs folder being added after I add my own nodes beneath the Database object. Is something similar happening? Can you attach some screens? Or describe the behavior you're seeing?
Also, can you try adding the following to your sorter tag in the example you provided? I discovered the "parentExpression" tag for sorters and it may provide more clues into why the sorter isn't being triggered for the nodes you've mentioned. <commonSorter class="oracle.dbtools.connectivity.ui.explorer.providers.Sorter" id="oracle.dbtools.connectivity.ui.explorer.providers.ServerExplorerContentProvider"> <parentExpression> <instanceof value="org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.virtual.IVirtualNode"/> </parentExpression> </commonSorter>
(In reply to comment #4) > Anthos, after digging into this more, I'm confused. Is it that you make a mix > of framework and your nodes and they're always out of order? I've seen this > with some Sybase profiles we're developing with the Catalogs folder being added > after I add my own nodes beneath the Database object. Is something similar > happening? Can you attach some screens? Or describe the behavior you're seeing? > What is the recommended way of doing this ?
(In reply to comment #5) > Also, can you try adding the following to your sorter tag in the example you > provided? I discovered the "parentExpression" tag for sorters and it may > provide more clues into why the sorter isn't being triggered for the nodes > you've mentioned. > > <commonSorter > > class="oracle.dbtools.connectivity.ui.explorer.providers.Sorter" > > id="oracle.dbtools.connectivity.ui.explorer.providers.ServerExplorerContentProvider"> > <parentExpression> > <instanceof > value="org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.virtual.IVirtualNode"/> > </parentExpression> > </commonSorter> > I tried this; with this change the oracle.dbtools.connectivity.ui.explorer.providers.Sorter's compare method did NOT get called and all the elements were sorted alphabetically. See the screen shot attachments with and without the parentExpression element.
Created attachment 51390 [details] DSE without parentExpression in the navigatorContent.commonSorter
Created attachment 51391 [details] DSE with parentExpression in the navigatorContent.commonSorter
Yes. Unfortunately, that's pretty much what I've found to be the case also. At least we're getting the sorter to be triggered for our content with the parentElement piece in there. I will have to check a few more things with the navigator framework folks to see what we can do about this. It should be using one sorter per level in the tree I would think. But that doesn't seem to be the case, as evidenced by your screen shots. Looks like I have more digging to do. Thanks for the additional information. I just had to make sure we were both seeing the same behavior before I went back to the Platform folks.
Received some new information from the platform team: "The sorting algorithm checks for the source of a given element; if the source of two elements is the same, then the contributing extension gets to order them (extension A contributes a, a', a'', ... then A's sorter is used to sort them), and uses the relative priority of the contributing extensions of two elements if they originated from different extensions (so extension A adds a, extension B adds b, then a and b are sorted based on the order of the priorities of A and B). If the priorities match, then the elements are sorted alphabetically by their labels. If the elements were viewer.add()ed to the tree, then the framework has no notion of source (it doesn't know what extension added them), so the "source" is determined from the possibleChildren expressions, taking the highest priority extension it finds that declares it might have contributed an element like the current one." So, since the navigator framework is working as designed, we're going to have to come up with a slightly different approach to sorting items in the DSE. More information to come. Anthos, I believe I can fix this issue for you pretty easily now that I understand it a bit better, but it's going to involve an API change (hopefully low impact) to the DSE for your profile. I'll have more details shortly.
Since we anticipate many different contributions to the DSE in the form of navigator content extensions, and we want those contributions to be consistently sorted when presented in the DSE, we need a slightly different solution to this problem. What I propose is this... We override the default sorter in the DSE (which extends the CommonNavigator) to use our own custom sorter. We'll call it: org.eclipse.datatools.connectivity.ui.dse.DSESorter.java This sorter will use the label provider for the view, which gets its labels from the various content extensions to the navigator. The sorter will use the ICU code to get a locale-specific collator and sort the entries appropriately. I have tested this locally and it is a simple solution to this problem. Anthos, do you seeany issues with sorting everything in the DSE consistently? The only issue I can possibly see is where someone wants to override the sort order to do something other than a basic alphabetical sort. This simple solution to override the default sorter will not allow that sort of custom sorting to occur.
the sorting of the DSE content MUST BE left to the content provider, thereby to the extension provider, since the provider may wish to have the view in some particular order that is consistent with their other products.
Still investigating with the Platform team.
Created platform bug 162330 for sorters in the navigator framework.
Currently working with the platform team to see if this is a DTP issue or a navigator framework issue.
Still working with the platform team. Moving off to Ganymede.
Hey Anil... Is this still an issue and something we should pursue with the platform team?
I'm going to assume this problem is fixed with platform Bug 121724. You can reopen if the problem still exists.