Closed istvanrath closed 12 years ago
Well, the EPackages are collected from the EPackage Registry and on my machine the wizard could fine the mentioned package. However, the example repository's head version contains an eiqgen file inside the school.incquery project whose content is commented out.
"the EPackages are collected form the EPackage Registry" --> this is the problem. The genmodel refenreces inside the eiqgen file should also be taken into account. Note: since the eiqgen file is empty (or non-existent? @ujhelyiz ) when a new project has just been created, I will change the order of steps in the cheat sheet to have the eiqgen creation before the creation of a new query definition.
Make sure that
Instead of manually opening the .eiqgen files, you could use the IMetamodelProvider injectable service is used to provide the available EPackages to the editor (both from the EPackage registry and the eiqgen files - if they exist). However, this metamodelprovider assumes that an IncQuery project is present.
Currently, it returns an IScope instance (used by Xtext scoping), but that is possible to traverse to get all EPackages.
@ujhelyiz Can you provide me some information about obtaining those EPackages? The IMetamodelProvider service requires an EObject instance. Which EObject is needed here? How to access it?
The service is extremely similar to the IEiqGenmodelProvider interface - you need to give it an EObject from the Resource of the eiq - it does not matter which one. It is only used to determine the context/project where the result will be present.
Maybe I'm wrong but I don't understand it. The eiq does not exist at that time, the wizard is used to create it.
The service is extremely similar to the IEiqGenmodelProvider interface - you need to give it an EObject from the Resource of the eiq - it does not matter which one. It is only used to determine the context/project where the result will be present.
Reply to this email directly or view it on GitHub: https://github.com/ujhelyiz/EMF-IncQuery/issues/245#issuecomment-7137470
Ok, I see the issue. Either you can move the creation a bit forward in time (e.g. when opening the second page, and then removing the file if cancel is pressed), or the metamodelprovider service should be extended with an alternative IProject parameter.
@ujhelyiz I checked the MetamodelProviderService impementation and it is very confusing for me that the context EObject is not even used in the getAllMetamodelObjects method. I wanted to add the required getAllMetamodelObjects(IProject) method, but could not find the way to do it.
I am sorry - I did not say everything related to this issue. There are two different implementations for IMetamodelProviderService - the one you checked only uses the EPackage.Registry to calculate all packages, but there is another one, that first looks a projects eiqgen file, and then reverts to the other MetamodelServiceImplementation (if needed).
The other implementation do uses this parameter, as it is needed to find an .eiqgen implementation first, then loading all indirectly referenced EPackages.
If it is not clear, how to implement that functionality in these two implementations, I will find some try to do it - but probably next week.
@ujhelyiz If you have time, please add an getAllMetamodelObjects(IProject) method because I think it would be the better solution, rather than creating and deleting the file (if cancel is pressed).
As adding IProject to the IMetamodelProviderService would introduce a new dependency on org.eclipse.core.resources plug-in on the emf language project, I added the new method to the IEiqGenmodelProvider service. It is available now.
I have added the appropriate method calls to include the EPackages from the eiqgen files too, but for the school example the IEiqGenmodelProvider does not find the school package.
There were indeed some issues with the package provider service, but it always contained the http://school.ecore reference if it was included in the .eiqgen file. The issues seem to be fixed.
Additionally, this method, similarly to other methods return all EPackages available, including the ones from the Package registry.
Well, maybe my workspace is misconfigured, but it never (this time neither) appears for me. Am I right that you are also trying this with the school projects omitted from the run cofiguration?
Yes, and a .eiqgen file configured to have a line like that:
genmodel "platform:/resource/school/model/school.genmodel"
It is exactly the same for me and the school package never appears.
On Tue, Jul 24, 2012 at 1:15 PM, Zoltán Ujhelyi < reply@reply.github.com
wrote:
Yes, and a .eiqgen file configured to have a line like that:
genmodel "platform:/resource/school/model/school.genmodel"
Reply to this email directly or view it on GitHub: https://github.com/ujhelyiz/EMF-IncQuery/issues/245#issuecomment-7204263
Sorry, but I don't have any idea what might have gone wrong. It should be either working, or failing loudly (i.e. with an exception).
It works for me, so I'm closing this issue.
I have tested this with the school example: it refers to the http://school.ecore through the eiqgen (genmodel), and the New Query Definition Wizard's second screen (Add EPackage) does not offer this epackage in the list.