determining a connection's plug-in [message #658549] |
Tue, 08 March 2011 17:12  |
Eclipse User |
|
|
|
If I have an IConnectionProfile, is there any way I can discern what plug-in provided the "enablement" implementation? That is, how can I tie a particular connection model back to the plug-in extension that produced it?
I would like to determine the plug-in because different plug-ins can treat the same database differently. For example, the DTP-provided Sybase enablement plug-in's model supplies the database's catalogs and schemas; while a third-party enablement plug-in may supply only the database's schemas.
Thanks.
|
|
|
|
|
Re: determining a connection's plug-in [message #658829 is a reply to message #658815] |
Wed, 09 March 2011 18:10  |
Eclipse User |
|
|
|
So far as I know, you really don't have a way to programmatically determine that in DTP. And since the model is spread across multiple plug-ins (EMF + SQL Model + Enablement extensions), I don't know that it would get you what you were looking for anyway.
Things are so spread out between profiles and driver implementations, catalog loaders, and model additions that it would be tough to come up with any way to do this that wasn't extremely time and resource intensive.
The only route I can think to go here would be to look for the driver associated with the profile and get the driver template ID from that. You might be able to then use the TemplateDescriptor class to get the TemplateDescriptor for the driver (public static TemplateDescriptor getDriverTemplateDescriptor(String id)) and then use the element associated with it (getElement() returns IConfigurationElement) and work your way out to the namespace of the element from there...
The issue with that, as I said earlier, is that typically these enablement extensions are split up across more than one plug-in, so that may or may not be reliable.
Honestly I'm not even sure that getting the namespace would get you what you want, but that's the avenue that I'd try...
--Fitz
|
|
|
Powered by
FUDForum. Page generated in 0.04789 seconds