Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » determining a connection's plug-in
determining a connection's plug-in [message #658549] Tue, 08 March 2011 22:12 Go to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
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 #658776 is a reply to message #658549] Wed, 09 March 2011 18:28 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
Look for Plug-in Spy directions and when you create the new connection profile, figure out what plug-in is providing the driver UI on the New Connection Profile wizard when you specify driver details (URL, uid/pwd, etc.).
Re: determining a connection's plug-in [message #658815 is a reply to message #658776] Wed, 09 March 2011 21:44 Go to previous messageGo to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
Thanks for the reply, but I was looking for something programmatic, not UI-oriented.

If I call the following

ProfileManager.getInstance().getProfileByName("foo")

How can I determine which plug-in supplied the returned IConnectionProfile's model etc?

Thanks.
Re: determining a connection's plug-in [message #658829 is a reply to message #658815] Wed, 09 March 2011 23:10 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
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
Previous Topic:NullPointerException while getting the ConnectionInfo
Next Topic:New Connection Profile Type
Goto Forum:
  


Current Time: Fri Apr 26 01:36:09 GMT 2024

Powered by FUDForum. Page generated in 0.03134 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top