Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332961 - ODA Driver Improvements
Summary: ODA Driver Improvements
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.7.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: M5   Edit
Assignee: Kenn Hussey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 332962
  Show dependency tree
 
Reported: 2010-12-20 12:32 EST by Kenn Hussey CLA
Modified: 2011-01-21 10:08 EST (History)
4 users (show)

See Also:
Kenn.Hussey: indigo+
Ed.Merks: review+


Attachments
changes to edit.ui (16.76 KB, patch)
2010-12-20 13:57 EST, Kenn Hussey CLA
Kenn.Hussey: review?
Details | Diff
changes to oda.ecore (10.07 KB, patch)
2010-12-20 20:58 EST, Kenn Hussey CLA
no flags Details | Diff
changes to oda.ecore.ui (8.14 KB, patch)
2010-12-20 21:02 EST, Kenn Hussey CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenn Hussey CLA 2010-12-20 12:32:26 EST
Provide enhancements to the generic ODA driver (and tooling) developed in bug 330988, including the following:

- support for passing a resource set as a connection application context

- support for specifying OCL expressions as parameter defaults; these would be evaluated (using a query delegate) to determine the value(s) for the @target and class type parameters used in a data set's query

- support for registering "query delegate text viewer factories", which would create text viewers that provide assistance (e.g., syntax colouring and content assist) in editing query expressions within the data set editor
Comment 1 Kenn Hussey CLA 2010-12-20 13:57:22 EST
Created attachment 185584 [details]
changes to edit.ui

Here are changes to org.eclipse.emf.edit.ui which define a new QueryDelegateTextViewer interface with an associated factory registry and extension point.
Comment 2 Kenn Hussey CLA 2010-12-20 20:58:37 EST
Created attachment 185606 [details]
changes to oda.ecore

Here are changes to the connection implementation to add support for passing a resource set as the application context and to the query implementation to support the use of expressions to describe defaults for parameters.

Support for expressions to define parameter defaults works as follows:

- only the @target or class type parameters are supported (i.e., instances of a given Ecore class)
- you specify an expression instead of the default value of <unset> on the Parameters page of the data set editor
- in the default expression, you can make reference to any of the data type parameters that have been defined for the data source
- the context for the default expression is the type of the parameter
- if an expression returns results, all will be used for @target and the first will be used for class type parameters
- if no expression is specified (i.e., the value is the default <unset>), all instances of the parameter type (or the first one) will be used so as to enable previews for queries with complex parameters
Comment 3 Kenn Hussey CLA 2010-12-20 21:02:12 EST
Created attachment 185607 [details]
changes to oda.ecore.ui

Here are changes to the data set editor which leverage the new query delegate text viewer registry. If a factory is registered for the selected query delegate, it is asked to create a text viewer for that query delegate; otherwise, a "plain" text editor is used. In combination with the MDT OCL patch for bug 33292, this results in an embedded expression editor complete with syntax colouring and context assist (even for variables!).
Comment 4 Kenn Hussey CLA 2010-12-20 21:04:24 EST
Comment on attachment 185607 [details]
changes to oda.ecore.ui

Oops, meant to reference bug 332962.
Comment 5 Ed Merks CLA 2010-12-21 12:41:47 EST
The edit.ui parts look good.
Comment 6 Kenn Hussey CLA 2010-12-21 13:01:03 EST
(In reply to comment #5)
> The edit.ui parts look good.

Thanks, those changes have now been committed.
Comment 7 Kenn Hussey CLA 2010-12-22 10:22:01 EST
The ODA changes (with some minor improvements) have been committed to CVS.
Comment 8 Kenn Hussey CLA 2010-12-22 14:20:07 EST
An integration build containing the changes is now available.
Comment 9 Ed Willink CLA 2011-01-21 05:18:11 EST
(In reply to comment #7)
> The ODA changes (with some minor improvements) have been committed to CVS.

This has unfortunate consequences.

EMF always used to be the bottom of the Modeling stack sio youi could just install it. Attempting to install EMF bnow gets problems from a datatools depenedency.

Unforunately the EMF Downloads page build dependencies link is broken making it harder than it need be to resolve the problem.

ODA seems like just another layered EMF facility. It seems a mistake to include it in EMF core and so impose these dependencies.
Comment 10 Kenn Hussey CLA 2011-01-21 09:24:04 EST
(In reply to comment #9)
> (In reply to comment #7)
> > The ODA changes (with some minor improvements) have been committed to CVS.
> 
> This has unfortunate consequences.
> 
> EMF always used to be the bottom of the Modeling stack sio youi could just
> install it. Attempting to install EMF bnow gets problems from a datatools
> depenedency.

Only if you opt to install the ODA features...

> Unforunately the EMF Downloads page build dependencies link is broken making it
> harder than it need be to resolve the problem.

Not sure what is meant here... are you installing by download or via the software site? The all-in-one SDK probably includes the ODA stuff, but if you opt not to use it, you should not be prevented from installing/using the rest of the SDK.

> ODA seems like just another layered EMF facility. It seems a mistake to include
> it in EMF core and so impose these dependencies.

It's not included in the core; it's a separate set of features, just like the RAP stuff... not sure what you mean here by "include it in EMF core"... could you please clarify?
Comment 11 Ed Willink CLA 2011-01-21 09:35:25 EST
(In reply to comment #10)
> Only if you opt to install the ODA features...

Yes. I've now learnt to update EMF SDK rather than EMF All-In-One.
> 
> > Unforunately the EMF Downloads page build dependencies link is broken making it
> > harder than it need be to resolve the problem.
> 
> Not sure what is meant here... are you installing by download or via the
> software site? The all-in-one SDK probably includes the ODA stuff, but if you
> opt not to use it, you should not be prevented from installing/using the rest
> of the SDK.

When working with e.g. Xtext from nightlies, I like to have precise control over what I'm installing by downloading all the All-in-One ZIP update sites explicitly. (It's also much quicker if you can switch off 'contact all sites'.)

I thought I needed a datatools Update site, but it turns out I don't.

However the 'Build dependencies' on the EMF downloads page is broken. 
> 
> > ODA seems like just another layered EMF facility. It seems a mistake to include
> > it in EMF core and so impose these dependencies.
> 
> It's not included in the core; it's a separate set of features, just like the
> RAP stuff... not sure what you mean here by "include it in EMF core"... could
> you please clarify?

Once you use EMF SDK, rather than EMF All-in-One, it's not in Core, so much less of a problem.
Comment 12 Kenn Hussey CLA 2011-01-21 10:08:00 EST
(In reply to comment #11)
> However the 'Build dependencies' on the EMF downloads page is broken. 

This is a side-effect of our transition to Buckminster. We have no automated way of listing the builds against which EMF is built since Bucksminster uses sites instead of ZIPs to perform its build. :(

> Once you use EMF SDK, rather than EMF All-in-One, it's not in Core, so much
> less of a problem.

Yeah, I would recommend not using the All-in-One download unless you really do want everything. ;)