Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] Metamodels list "reloading" in QVTo plugin(How to reload a list of metamodels seen by QVTo plugin ?)
[QVTo] Metamodels list "reloading" in QVTo plugin [message #724691] Mon, 12 September 2011 20:22 Go to next message
Piotr  aj?czkowski is currently offline Piotr aj?czkowski
Messages: 8
Registered: June 2011
Junior Member

Hi !

I would like to know, how can I (from my own plugin or - better - automatically) refresh the list of metamodels seen by QVTo plugin ?

What do I mean ? Here is an example scenario:
1. My plugin creates a dynamic metamodels and registers them in the Registry
2. This registration action is activated by option in file popup-menu (cause it depends on which file you choose)
3. QVT code uses these recently registered metamodels
4. Now is the problem:
- when QVT editor with file (which uses these metamodels) was opened before user chose to register the metamodels (popup-menu), the QVTo plugin do not see
index.php/fa/3939/0/
these metamodels, even if they are in Registry (only closing the editor and then restarting the Eclipse works)
- when no QVT editor was opened and user chose to register the metamodels and THEN opened the QVT file which uses these metamodels - everything works perfectly
index.php/fa/3938/0/

Maybe I use some bad methodology ? But I can't figure out how could I register metamodels that are dynamically generated - with some parameters save in a file (in a project/workspace there can be many files with different options) in the other way that this popup-menu action.

Please help Smile

Thanks in advance Smile

Piotr Zajączkowski

[Updated on: Mon, 12 September 2011 20:23]

Report message to a moderator

Re: [QVTo] Metamodels list "reloading" in QVTo plugin [message #725144 is a reply to message #724691] Wed, 14 September 2011 05:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
Hi

Dynamic modification of the global registry is strongly discouraged; for
this reason amongst others.

If you really want to register then make sure you use a plugin
registration of the plugin start method.

Better to use QVTo's model registration page.

Regards

Ed Willink


On 12/09/2011 21:22, Piotr aj?czkowski wrote:
> Hi !
>
> I would like to know, how can I (from my own plugin or - better - automatically) refresh the list of metamodels seen by QVTo plugin ?
>
> What do I mean ? Here is an example scenario:
> 1. My plugin creates a dynamic metamodels and registers them in the Registry
> 2. This registration action is activated by option in file popup-menu (cause it depends on which file you choose)
> 3. QVT code uses these recently registered metamodels
> 4. Now is the problem:
> - when QVT editor with file (which uses these metamodels) was opened before user chose to register the metamodels (popup-menu), the QVTo plugin do not see () these metamodels, even if they are in Registry (only closing the editor and then restarting the Eclipse works)
> - when no QVT editor was opened and user chose to register the metamodels and THEN opened the QVT file which uses these metamodels - everythink works perfectly ()
>
> Maybe I use some bad methodology ? But I can't figure out how could I register metamodels that are dynamically generated - with some parameters save in a file (in a project/workspace there can be many files with different options) in the other way that this popup-menu action.
>
> Please help :)
>
> Thanks in advance :)
>
> Piotr ZajÄ…czkowski
Re: [QVTo] Metamodels list "reloading" in QVTo plugin [message #726115 is a reply to message #724691] Fri, 16 September 2011 15:42 Go to previous messageGo to next message
Piotr  aj?czkowski is currently offline Piotr aj?czkowski
Messages: 8
Registered: June 2011
Junior Member

Hi,
Thank you for answering my question.

You wrote that the best method for registering metamodels is to register them on plugin start up. But how can I register metamodels that are dynamically created - as I wrote, the concrete form of these metamodels depends on some settings stored in my own files in workspace. Ok, I can iterate through all files in workspace on plugin start up and register all metamodels from them. But what should I do when user creates new file with new metamodel ? If I should not touch the registry in runtime, I can't see any other method for using these dynamically generated metamodels. Of course, I can store them in files in workspace but I would like not to do this. Enforcing to register them "as plugins" and running the new instance of Eclipse is also not acceptable.

Maybe it is possible to make my own files to be seen as metamodels by Qvto ? I mean - when Qvto plugin search the workspace for metamodels when resolving them, it calls some method which gives it a metamodel per each my file with dynamic metamodel settings.

Or maybe there is a lot simpler solution ?

Thanks in advance.

Piotr Zajaczkowski
Re: [QVTo] Metamodels list "reloading" in QVTo plugin [message #726208 is a reply to message #726115] Fri, 16 September 2011 19:52 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
Hi

Some tools search the workspace for models. Sometimes this is helpful,
usually it is inefficient and often confusing.

Other tools like QVTo expect you to identify the models.

If you want to do this dynamically put the relevant entries in the
ResourceSet's package registry that you share with QVTo.

Regards

Ed Willink

On 16/09/2011 16:42, Piotr Zajaczkowski wrote:
> Hi,
> Thank you for answering my question.
> You wrote that the best method for registering metamodels is to
> register them on plugin start up. But how can I register metamodels
> that are dynamically created - as I wrote, the concrete form of these
> metamodels depends on some settings stored in my own files in
> workspace. Ok, I can iterate through all files in workspace on plugin
> start up and register all metamodels from them. But what should I do
> when user creates new file with new metamodel ? If I should not touch
> the registry in runtime, I can't see any other method for using these
> dynamically generated metamodels. Of course, I can store them in files
> in workspace but I would like not to do this. Enforcing to register
> them "as plugins" and running the new instance of Eclipse is also not
> acceptable.
>
> Maybe it is possible to make my own files to be seen as metamodels by
> Qvto ? I mean - when Qvto plugin search the workspace for metamodels
> when resolving them, it calls some method which gives it a metamodel
> per each my file with dynamic metamodel settings.
>
> Or maybe there is a lot simpler solution ?
>
> Thanks in advance.
>
> Piotr Zajaczkowski
Previous Topic:ATL launch error
Next Topic:[QVT] result of allSubobjects on sets
Goto Forum:
  


Current Time: Sun Oct 26 00:30:03 GMT 2014

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

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