Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 203158

Summary: Need strict separation between UI and non-UI enablement plug-ins
Product: [Tools] Data Tools Reporter: Larry Dunnell <ledunnel>
Component: EnablementAssignee: Larry Dunnell <ledunnel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bfitzpat, hung.hsi
Version: 1.6   
Target Milestone: 1.6M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposal
none
Final version
none
Final version
none
Patch for DB2 enablement refactoring
none
Patch for Informix refactoring
none
Patch for Oracle refactoring
none
Patch for sqlserver refactoring
none
First part of Derby refactoring
none
Patch refactoring out the driver property editor UI dependency from the driver template extension
none
Patch for derby migration to new extension point splitting out driver property editors
none
Patch for MySQL refactoring
none
Refactored PostgreSQL plug-ins
none
Patch for HSQLDB refactoring none

Description Larry Dunnell CLA 2007-09-12 17:39:13 EDT
The main purpose of the attached proposal is to provide a means to fulfill the following requirement:

There needs to be a strict separation between plug-ins with UI dependencies and non-UI dependencies.  Adopters have the need to access core functionality such as connection profiles, driver templates, connection management, DDL generators and catalog loaders from command-line tooling or without the UI components installed in the product.  Some of the use-cases include programmatically creating a connection to a database, browsing the catalog metadata, generating DDL and executing DDL.

See the attached document for the specific details.
Comment 1 Larry Dunnell CLA 2007-09-12 17:40:50 EDT
Created attachment 78235 [details]
Proposal
Comment 2 Brian Fitzpatrick CLA 2007-09-19 17:49:24 EDT
I approve this, with a few suggestions... 

In section 1, we need some better examples… for instance, what would it look like for IBM’s products, which would use more of the naming standard: 
	org.eclipse.datatools.enablement.ibm.db2.iseries.dbdefinition

Also in section 2, an IBM example would better illustrate the full use of the standard:
	org.eclipse.datatools.enablement.ibm.db2.iseries

And in section 3, an IBM example would better illustrate the full use of the standard:
	org.eclipse.datatools.enablement.ibm.db2.iseries.ui

But great work. This should help make our DTP contributions much more uniform and easier to adopt for both non-UI and UI users.

--Fitz
Comment 3 John Graham CLA 2007-09-21 15:25:41 EDT
+1

I agree with Brian's comments, and think this is good proposal for best practices.
Comment 4 Hung Hsi CLA 2007-09-24 17:31:16 EDT
+1, and I agreed w/ Brian's suggestions.
-- Hung Hsi
Comment 5 Larry Dunnell CLA 2007-10-04 16:02:18 EDT
Created attachment 79770 [details]
Final version

Updated the guidelines with suggested changes.
Comment 6 Larry Dunnell CLA 2007-10-04 16:04:43 EDT
Created attachment 79771 [details]
Final version

Re-uploaded file with proper mime type.
Comment 7 Larry Dunnell CLA 2007-10-04 19:42:36 EDT
Created attachment 79782 [details]
Patch for DB2 enablement refactoring
Comment 8 Larry Dunnell CLA 2007-10-04 21:00:18 EDT
Created attachment 79783 [details]
Patch for Informix refactoring
Comment 9 Larry Dunnell CLA 2007-10-04 21:42:52 EDT
Created attachment 79784 [details]
Patch for Oracle refactoring
Comment 10 Larry Dunnell CLA 2007-10-05 20:44:28 EDT
Created attachment 79840 [details]
Patch for sqlserver refactoring
Comment 11 Larry Dunnell CLA 2007-10-11 16:17:13 EDT
Created attachment 80178 [details]
First part of Derby refactoring
Comment 12 Brian Fitzpatrick CLA 2007-10-12 13:44:32 EDT
Created attachment 80254 [details]
Patch refactoring out the driver property editor UI dependency from the driver template extension

Hey Larry... Here's the patch that refactors out the driver property editor UI dependency from the driverTemplate extension. It will deprecate the customPropertyDescriptor attribute for driverTemplate properties and override properties, which will be done when this patch is delivered.

An example is with the Derby implementation... 

The password property for the Derby driver template (in the plugin.xml for org.eclipse.datatools.connectivity.db.derby) goes from this:

            <property
                  customPropertyDescriptor="org.eclipse.datatools.connectivity.ui.PasswordTextPropertyDescriptor"
                  generated="false"
                  id="org.eclipse.datatools.connectivity.db.password"
                  name="%PASSWORD_PROPERTY_NAME"
                  required="false"
                  visible="true"/>

To this:

            <property
                  generated="false"
                  id="org.eclipse.datatools.connectivity.db.password"
                  name="%PASSWORD_PROPERTY_NAME"
                  required="false"
                  visible="true"/>

And then in the UI plug-in for Derby you add this:

   <extension
         point="org.eclipse.datatools.connectivity.ui.driverPropertyEditor">
      <propertyEditor
            customPropertyDescriptor="org.eclipse.datatools.connectivity.ui.PasswordTextPropertyDescriptor"
            driverPropertyID="org.eclipse.datatools.connectivity.db.password"
            driverTemplateID="org.eclipse.datatools.connectivity.db.derby101.genericDriverTemplate"
            id="org.eclipse.datatools.connectivity.derby.ui.propertyEditor.password">
      </propertyEditor>
   </extension>

So as you can see the new property editor extension point is tied to a driver template by template ID/property ID so we don't accidentally override something we shouldn't.

The code also handles the old way of doing things (since we're just deprecating the customPropertyDescriptor attribute for 1.6, not removing it). So we shouldn't break anyone.

Let me know what you think.
--Fitz
Comment 13 Larry Dunnell CLA 2007-10-12 14:17:45 EDT
Brian,

The patch looks good.  However, you may want to rename MySafeRunnable to something more descriptive such as DriverPropertyEditorDescriptorRunnable or DriversRunnable.
Comment 14 Brian Fitzpatrick CLA 2007-10-12 14:32:25 EDT
Thanks Larry. I'll make that change and get this delivered. Once you're done with the rest of the refactoring, I'll work my way through the driver templates and update drivers to split out the property editors to the UI plug-ins.
Comment 15 Brian Fitzpatrick CLA 2007-10-12 14:42:58 EDT
Delivered and will get you the Derby modifications in just a bit. Thanks for reviewing it Larry.
Comment 16 Brian Fitzpatrick CLA 2007-10-12 15:03:50 EDT
Created attachment 80269 [details]
Patch for derby migration to new extension point splitting out driver property editors

Hey Larry...

Here's the patch for the Derby changes... You'll have to do some manipulation, but it's pretty straightforward... Wherever you added the driver templates for Derby, just remove the customPropertyDescriptor attribute and then add the extra extension point to the derby UI plugin.

Hope it helps.
--Fitz
Comment 17 Brian Fitzpatrick CLA 2007-10-12 15:04:36 EDT
One other note... I tested all the derby templates locally and the passwords were masked correctly in the Edit Driver dialog. 
Comment 18 Larry Dunnell CLA 2007-10-17 16:35:29 EDT
Created attachment 80612 [details]
Patch for MySQL refactoring
Comment 19 Larry Dunnell CLA 2007-10-17 16:49:09 EDT
Created attachment 80613 [details]
Refactored PostgreSQL plug-ins
Comment 20 Brian Fitzpatrick CLA 2007-11-02 14:46:55 EDT
Larry, I updated the UI plugins for each of the enablement profiles and added a new UI plugin for MySQL... in each case, I added the password text descriptor to each driver so the password would be masked when editing the driver definition.  The only one I didn't do was the Sybase one, as it didn't appear to have been refactored yet. 
Comment 21 Larry Dunnell CLA 2007-12-18 19:04:06 EST
The work has been completed for all connectivity and enablement plug-ins except for one vendor which requires special care due to adopter impact.  https://bugs.eclipse.org/bugs/show_bug.cgi?id=213390 has been opened to track the remaining work.
Comment 22 Larry Dunnell CLA 2008-01-18 14:45:18 EST
Created attachment 87290 [details]
Patch for HSQLDB refactoring
Comment 23 Brian Fitzpatrick CLA 2008-07-01 17:40:41 EDT
Closing bugs