Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Loading EMF Model from plugin-directory
icon5.gif  Loading EMF Model from plugin-directory [message #641467] Thu, 25 November 2010 15:22 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: November 2010
Junior Member
Hi guys,
I'm quite new to Eclipse plugin development and EMF and I'm heading a probably silly problem:

I've made an EMF model that shall serve as dictionary. I created an instance and added the dictionary entries that I need, and serialized it to XMI. So I have my dictionary as serialized EMF-instance in a file now, laying in the development-eclipse-workspace.

My problem is now: I need the dictionary in the target-eclipse-workspace. But if I want to deserialize/load the EMF-instance from the file, I can't access it, because it lays in the development-eclipse-workspace which I can't access. And I also cannot put the file in the target-workspace.

Therefore I need to somehow load the XMI during the plugin intialization! Can u please help me how to do that?

Thanks in advance and greetings!
Re: Loading EMF Model from plugin-directory [message #641482 is a reply to message #641467] Thu, 25 November 2010 15:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Norbert,

Comments below.

Norbert.Fuerst@gmx.de wrote:
> Hi guys,
> I'm quite new to Eclipse plugin development and EMF and I'm heading a
> probably silly problem:
>
> I've made an EMF model that shall serve as dictionary. I created an
> instance and added the dictionary entries that I need, and serialized
> it to XMI. So I have my dictionary as serialized EMF-instance in a
> file now, laying in the development-eclipse-workspace.
>
> My problem is now: I need the dictionary in the
> target-eclipse-workspace. But if I want to deserialize/load the
> EMF-instance from the file, I can't access it, because it lays in the
> development-eclipse-workspace which I can't access. And I also cannot
> put the file in the target-workspace.
>
> Therefore I need to somehow load the XMI during the plugin
> intialization! Can u please help me how to do that?
I'm not sure it makes sense to assume the workspace has specific files
in it. You'd use platform:/resource/<project>/<path-in-project> to load
things in the workspace. You can use
platform:/plugin/<bundle-id>/<path-in-bundle> to load things from the
installed bundles themselves.
>
> Thanks in advance and greetings!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Loading EMF Model from plugin-directory [message #641548 is a reply to message #641467] Fri, 26 November 2010 02:09 Go to previous messageGo to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Hi,

This is very nice blog on various types of URIs possible to load and save resources.
http://lmap.blogspot.com/2008/03/platform-scheme-uri.html

The plugin type URI is also explained there.

Regards,
Ashwani Kr Sharma
Re: Loading EMF Model from plugin-directory [message #641670 is a reply to message #641467] Fri, 26 November 2010 16:07 Go to previous message
No real name is currently offline No real nameFriend
Messages: 2
Registered: November 2010
Junior Member
Cool, thanks a lot Ed and Ashwani, platform:/plugin/ should be the solution I need Smile
Previous Topic:How to get value of an EAttribute?
Next Topic:Super linear memory growth with Ecore
Goto Forum:
  


Current Time: Fri Apr 26 15:17:16 GMT 2024

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

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

Back to the top