Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Load Resources
Load Resources [message #1858274] Sun, 26 March 2023 15:04 Go to next message
John Henbergs is currently offline John HenbergsFriend
Messages: 239
Registered: October 2020
Senior Member
Hi,

1. I have defined an Xtext grammar "University" and I have generated an Ecore metamodel. The metamodel has a class named "Building" with a non containment reference "source" and Type "EPackage".
2. I launch a new runtime instance and inside a Java project named "ModelProject" I create a model instance "UniversityInstance" where I want to load a resource because I want to be able to add it as a value for the reference "source". The resource is located inside a jar file in the "Downloads" folder.
3. What I did was to create a new Java project named "Resource" in the eclipse workspace, unzip the jar file and add it in the java project. Then, I opened the runtime instance, and I right click on the "ModelProject" -> Configure Build Path -> Libraries -> Classpath -> Add External Class Folder and I choose the "Resource" folder in the workspace.

However, when I open the "UniversityInstance" textual editor and I try to reference the resource, it says it cannot resolve it. Am I doing something wrong? What would be the steps to properly be able to load the resource?

For clarification:
The structure of the "Resource" folder is as follows:
Resource
-src
-JRE System Library
-META INF
-org.eclipse.uml2.uml .... (contains)
--META INF
--org
--schema
--model (contains)
---UML.ecore (the resource I want to load).

Thank you for any help.

[Updated on: Sun, 26 March 2023 15:12]

Report message to a moderator

Re: Load Resources [message #1858275 is a reply to message #1858274] Sun, 26 March 2023 16:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
It sounds kind of strange to reference an EPackage. In any case, this involves Xtext and I have no idea what things you have all generated and specialized to enable looking up Ecore models from the classpath. Probably it's better to ask on the Xtext forum:

https://www.eclipse.org/forums/index.php?t=thread&frm_id=27

Include information about what the reference actually looks like and what you've done in terms of scoping.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Best practice for metamodels under development
Next Topic:[CDO] Delete EObjects and BLOBs
Goto Forum:
  


Current Time: Wed May 01 23:13:22 GMT 2024

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

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

Back to the top