Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362191 - [Restructuring] Query mechanism for eFacet2
Summary: [Restructuring] Query mechanism for eFacet2
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EMF-Facet (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nicolas Bros CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 365726 361813
  Show dependency tree
 
Reported: 2011-10-27 09:25 EDT by Nicolas Bros CLA
Modified: 2020-05-01 11:27 EDT (History)
2 users (show)

See Also:
gdupe: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2011-10-27 09:25:14 EDT
We must adapt the query mechanism for the new eFacet2 metamodel.
Comment 1 Nicolas Bros CLA 2011-11-02 10:54:57 EDT
I committed a first implementation with one unit test in revision 1050.

I'm leaving this open for now because there are more unit tests that need to be written.
Comment 2 Gregoire Dupe CLA 2011-11-08 08:03:12 EST
In org.eclipse.emf.facet.util.emf.core.internal.catalog.CatalogSetManager.getBundleByResource(Resource), if the parameter is null an IllegalArgumentException should be thrown. And this as to be documented.
Comment 3 Nicolas Bros CLA 2011-11-16 11:08:01 EST
In revision 1094 I refactored IQueryEvaluator to IDerivedTypedElementEvaluator :
  * the methods in IDerivedTypedElementEvaluator take DerivedTypedElements instead of Queries
  * The "queryEvaluatorRegistration2" extension point becomes "derivedTypedElementEvaluatorRegistration".
  * "IQueryManager" becomes "IDerivedTypedElementManager"
  * Query*Exception become DerivedTypedElement*Exception
  * IQuery2EvaluatorFactory becomes IDerivedTypedElementEvaluatorFactory.java
- IDerivedTypedElementManager
  * added typed (and type-checked) versions of the APIs
  * added APIs to evaluate on several sources at once

I have added unit tests for the IDerivedTypedElementEvaluator in revision 1096.

In revision 1097, I have handled the case where a query is not defined in a bundle, and CatalogSetManager#getBundleByResource now throws an exception if its parameter is null.
Comment 4 Nicolas Bros CLA 2011-11-17 11:07:08 EST
In revision 1098 I implemented multiple evaluation: I added IDerivedTypedElementCollectionEvaluator, a sub-interface of IDerivedTypedElementEvaluator. The implementor of an evaluator can choose to implement this interface to optimize query evaluation on multiple source elements at once. Otherwise, the framework performs the multiple evaluation by calling the single evaluation multiple times.
I added many tests for IDerivedTypedElementManager, and I fixed the bugs I discovered through the tests.
Comment 5 Nicolas Bros CLA 2011-11-18 05:43:20 EST
In revision 1099, I handled exceptions in the evaluation of derived typed elements, and I added unit tests that check the behaviors with exceptions.

I'm marking this bug as fixed.
Comment 6 Nicolas Bros CLA 2011-11-22 09:48:47 EST
In revision 1124, I refactored "IDerivedTypedElementEvaluator" to "IDerivedTypedElementImplementation" (and the associated factory, extension point, existing usages, etc.).
And I added a "setValue" method in the interface in order to be able to implement in the future the planned feature to set the value of a derived typed element through a query.

Since there is implementation for this at the moment, I'm reopening this bug.
Comment 7 Gregoire Dupe CLA 2011-11-23 11:59:33 EST
I've a warning on a line committed in revision 1094 : 

QueryImpl extends non-API type DocumentedElementImpl
QueryImpl.java
/org.eclipse.emf.facet.efacet2.metamodel/src/org/eclipse/emf/facet/efacet2/metamodel/efacet/extensible/impl
line 53
API Usage Problem
Comment 8 Gregoire Dupe CLA 2011-11-28 08:42:14 EST
I've improved an error message in org.eclipse.emf.facet.query.java.core.internal.evaluator.JavaQueryDerivedTypedElementImplementationFactory.

Committed revision 1158.
Comment 9 Gregoire Dupe CLA 2011-11-29 05:20:18 EST
I’ve fixed the warning described in Comment 7 by removing an inheritance between Query and DocumentElement. This inheritance was false and was causing the warning.

Committed revision 1166.
Comment 10 Gregoire Dupe CLA 2011-11-29 05:29:46 EST
The declaration of Query has been updated. (cf. Comment 9)
The dummyQuery meta-model and the javaQuery meta-model have then to be updated.

Committed revision 1168.
Committed revision 1169.
Comment 11 Gregoire Dupe CLA 2011-11-29 07:56:27 EST
Something gets wrong in the last update of efacet2.genmodel (dependencies to Ecore disappeared).
I Fixed that and I disabled all warnings on the project org.eclipse.emf.facet.facet2.metamodel.

Committed revision 1174.
Comment 12 Gregoire Dupe CLA 2011-11-29 12:01:23 EST
The API of the plug-in org.eclipse.emf.facet.query.java.core use types provided by the API of the plug-ins org.eclipse.emf.facet.efacet.core. I've then mark as reexported the used plug-in must be reexported.

Committed revision 1181.
Comment 13 Nicolas Bros CLA 2012-04-17 11:07:45 EDT
I deprecated the following (not yet released) public interfaces as part of Bug 376941:
- org.eclipse.emf.facet.efacet.core.query.IDerivedTypedElementCollectionImplementation
- org.eclipse.emf.facet.efacet.core.query.IDerivedTypedElementImplementation
- org.eclipse.emf.facet.efacet.core.query.IDerivedTypedElementImplementationFactory
Comment 14 Gregoire Dupe CLA 2012-05-31 08:01:02 EDT
(In reply to comment #6)
> And I added a "setValue" method in the interface in order to be able to
> implement in the future the planned feature to set the value of a derived typed
> element through a query.
> 
> Since there is implementation for this at the moment, I'm reopening this bug.

The "setValue" subject is tracked by the bug 365726. We can then close this bug.