Skip to main content



      Home
Home » Modeling » EMF » Load Resources
Load Resources [message #1858274] Sun, 26 March 2023 11:04 Go to next message
Eclipse UserFriend
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 11:12] by Moderator

Re: Load Resources [message #1858275 is a reply to message #1858274] Sun, 26 March 2023 12:15 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Best practice for metamodels under development
Next Topic:[CDO] Delete EObjects and BLOBs
Goto Forum:
  


Current Time: Sun Jul 13 10:31:39 EDT 2025

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

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

Back to the top