Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Reference to an external Ecore model (inside a plugin)
Reference to an external Ecore model (inside a plugin) [message #694879] Sun, 10 July 2011 04:36 Go to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

I have a plugin that exports an EMF package (that is the plugin fragment)

   <extension point="org.eclipse.emf.ecore.generated_package">
      <package
            uri="http://www.eclipse.org/amalgam/tutorials/xtext/Droid"
            class="org.eclipse.amalgam.tutorials.emf.droid.DroidPackage"
            genModel="model/Droid.genmodel"/>
   </extension>


So, looking at the forum I found some alternatives to configure an Xtext project (1.0 version) to use the .ecore and .genmodel files contained in the plugin. I have already deployed the plugin and installed it in my running Eclipse.

At the .xtext file, I added the line:
import "http://www.eclipse.org/amalgam/tutorials/xtext/Droid"


But when I tried to run the MWE2 file, I got the following error message:
1882 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems instantiating module org.eclipse.amalgam.tutorials.xtext.Droid: java.lang.reflect.InvocationTargetException
[...]
Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/eclipse/amalgam/tutorials/xtext/Droid.xtext':[XtextLinkingDiagnostic: null:18 Couldn't resolve reference to EPackage 'http://www.eclipse.org/amalgam/tutorials/xtext/Droid'., XtextLinkingDiagnostic: null:45 [...]


So I made some research in the forums and found some suggestions (none of them worked):

First try:
Add a referenceGenModels to the ecore.EcoreGeneratorFragment
// generates Java API for the generated EPackages 
fragment = ecore.EcoreGeneratorFragment {
	referencedGenModels = "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel"
}


Second Try
Use an uriMap to map the plugin genmodel and ecore to a resource URI
bean = StandaloneSetup {
	platformUri = "${runtimeProject}/.."
		
	uriMap = {
		from	= " platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel "
		to 	= " platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel "
	}

	uriMap = {
		from	= " platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore "
		to 	= " platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore "
	}

}


// generates Java API for the generated EPackages 
fragment = ecore.EcoreGeneratorFragment {
	referencedGenModels = "platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel"
}



What is wrong? Why the Ecore metamodel can be imported (import "http://www.eclipse.org/emf/2002/Ecore" as ecore) and works like magic?

Thank you!
Re: Reference to an external Ecore model (inside a plugin) [message #694965 is a reply to message #694879] Sun, 10 July 2011 12:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14718
Registered: July 2009
Senior Member
Hi,

did you try to map the plugin uri to a classpath uri? you may have to add a savemapping too

http://www.eclipse.org/forums/index.php/mv/msg/215739/689007/#msg_689007

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sun, 10 July 2011 12:43]

Report message to a moderator

Re: Reference to an external Ecore model (inside a plugin) [message #694997 is a reply to message #694965] Sun, 10 July 2011 16:45 Go to previous messageGo to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

This didn't work:

Workflow {
    bean = StandaloneSetup {
		platformUri = "${runtimeProject}/.."
		
		uriMap = {
			from	= "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel"
			to 		= "classpath:/model/Droid.genmodel"
		}
		
		uriMap = {
			from	= "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore"
			to 		= "classpath:/model/Droid.ecore"
		}
		
	}

[...]
			// generates Java API for the generated EPackages 
			fragment = ecore.EcoreGeneratorFragment {
				referencedGenModels = "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel"

				saveMapping = {
					to		= "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel"
					from 	= "classpath:/model/Droid.genmodel"
				}
				
				saveMapping = {
					to		= "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore"
					from 	= "classpath:/model/Droid.ecore"
				}

			}



I made a few tries in the Xtext grammar file too:
import "http://www.eclipse.org/amalgam/tutorials/xtext/Droid"
and
import "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore"


Didn't work.

Let me explain what I'm trying to do: I made some tutorials about the EMF DSL tools (Xtext, Acceleo, EEF, etc) and they all share the same metamodel. I choosed to use Xtext to create the ecore metamodel, and now I'm trying to extract this metamodel to its own eclipse plugin, and use this plugin as a dependency to the other tutorials.
Re: Reference to an external Ecore model (inside a plugin) [message #695001 is a reply to message #694997] Sun, 10 July 2011 16:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14718
Registered: July 2009
Senior Member
Hi,

can you be a bit more precise on: This didn't work.
Did you set the plugin deps? what is the error message you get?
if you have control on the metamodel plugin why don't letg it be part of the workspace and use
import "platform:/resource/..." in your xtext file

and make sure you map from the right from to the right to


~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sun, 10 July 2011 17:04]

Report message to a moderator

Re: Reference to an external Ecore model (inside a plugin) [message #695011 is a reply to message #695001] Sun, 10 July 2011 17:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14718
Registered: July 2009
Senior Member
Btw, the following works like a charm for me (Xtext 1.0.x) - using no genmodels nor platform/plugin stuff at all

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

import "http://www.example.com/test"

Model:
	elements+=Element*;
	
Element:
	'element' name=ID;


module org.xtext.example.mydsl.MyDsl

import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var grammarURI = "classpath:/org/xtext/example/mydsl/MyDsl.xtext"
var file.extensions = "mydsl"
var projectName = "org.xtext.example.mydsl"
var runtimeProject = "../${projectName}"

Workflow {
    bean = StandaloneSetup {
		platformUri = "${runtimeProject}/.."
		registerGeneratedEPackage = "test.TestPackage"
	}

	component = DirectoryCleaner {
		directory = "${runtimeProject}/src-gen"
	}

	component = DirectoryCleaner {
		directory = "${runtimeProject}.ui/src-gen"
	}

	component = Generator {
		pathRtProject = runtimeProject
		pathUiProject = "${runtimeProject}.ui"
		projectNameRt = projectName
		projectNameUi = "${projectName}.ui"
		language = {
			uri = grammarURI
			fileExtensions = file.extensions

			// Java API to access grammar elements (required by several other fragments)
			fragment = grammarAccess.GrammarAccessFragment {}

			// generates Java API for the generated EPackages 
			fragment = ecore.EcoreGeneratorFragment {
			// referencedGenModels = "uri to genmodel, uri to next genmodel"
			}

			// the serialization component
			fragment = parseTreeConstructor.ParseTreeConstructorFragment {}

			// a custom ResourceFactory for use with EMF 
			fragment = resourceFactory.ResourceFactoryFragment {
				fileExtensions = file.extensions
			}

			// The antlr parser generator fragment.
			fragment = parser.antlr.XtextAntlrGeneratorFragment {
			//  options = {
			//		backtrack = true
			//	}
			}

			// java-based API for validation 
			fragment = validation.JavaValidatorFragment {
				composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
				composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
				// registerForImportedPackages = true
			}

			// scoping and exporting API
			// fragment = scoping.ImportURIScopingFragment {}
			// fragment = exporting.SimpleNamesFragment {}

			// scoping and exporting API 
			fragment = scoping.ImportNamespacesScopingFragment {}
			fragment = exporting.QualifiedNamesFragment {}
			fragment = builder.BuilderIntegrationFragment {}

			// formatter API 
			fragment = formatting.FormatterFragment {}

			// labeling API 
			fragment = labeling.LabelProviderFragment {}

			// outline API 
			fragment = outline.TransformerFragment {}
			fragment = outline.OutlineNodeAdapterFactoryFragment {}
			fragment = outline.QuickOutlineFragment {}

			// quickfix API 
			fragment = quickfix.QuickfixProviderFragment {}

			// content assist API  
			fragment = contentAssist.JavaBasedContentAssistFragment {}

			// generates a more lightweight Antlr parser and lexer tailored for content assist  
			fragment = parser.antlr.XtextAntlrUiGeneratorFragment {}

			// project wizard (optional) 
			// fragment = projectWizard.SimpleProjectWizardFragment {
			// 		generatorProjectName = "${projectName}.generator" 
			//		modelFileExtension = file.extensions
			// }
		}
	}
}


~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sun, 10 July 2011 17:24]

Report message to a moderator

Re: Reference to an external Ecore model (inside a plugin) [message #695110 is a reply to message #695011] Mon, 11 July 2011 02:25 Go to previous messageGo to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

Thank you for your help. I guess I'm missing something. Let me clarify the things. That is my project repository: https://github.com/eclipse-soc/amalgamation-examples

I started with the Xtext plugins[1]. Now I want to extract the generated .ecore to its own plugin. I want to do this for two reasons: first, I want to have the .ecore file in just one place, and add a dependency to it where it is needed; second, I want to investigate this task and include it in the tutorial.

So I created a EMF project, copied the .ecore and generated a new .genmodel, created the editor and modified it to use EEF. The result are the EMF plugins[2].

What I did:

0) Exported and installed the EMF plugin (org.eclipse.amalgam.tutorials.emf)

1) In the Xtext plugin (org.eclipse.amalgam.tutorials.xtext) I added a dependency to the EMF plugin and enabled the "Reexport this dependency" option

2) In the Xtext plugin I removed the defined extension (I wanted to make this plugin reexport the genmodel from the EMF plugin:
  <extension point="org.eclipse.emf.ecore.generated_package">
    <package 
       uri = "http://www.eclipse.org/amalgam/tutorials/xtext/Droid" 
       class = "org.eclipse.amalgam.tutorials.xtext.droid.DroidPackage"
       genModel = "org/eclipse/amalgam/tutorials/xtext/Droid.genmodel" /> 
	
  </extension>



3) In the Droid.xtext file, I changed
generate droid "http://www.eclipse.org/amalgam/tutorials/xtext/Droid"
to
import "http://www.eclipse.org/amalgam/tutorials/emf/Droid"

At this point I got no error (in the Editor). But when I ran the MWE2 Workflow I got an error message [3]


4) Made some tries as reported in my first post [4]:

First Try:
Added a referencedGenModels to the ecore.EcoreGeneratorFragment
referencedGenModels = "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel"


Result: Same error [3]

Second Try:
Added two URI maps to the StandaloneSetup :
	
	uriMap = {
		from	= " platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel "
		to 	= " platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel "
	}

	uriMap = {
		from	= " platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore "
		to 	= " platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore "
	}

}


and changed the referencedGenModels to the mapped URI
referencedGenModels = "platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel"


Result: Same error, just a different beggining:
0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri '/Users/juniorz/GSoC/gsoc-amalgamation-examples/xtext/plugins'
98   [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding URI mapping from 'platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel' to 'platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.genmodel'
99   [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding URI mapping from 'platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore' to 'platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore'



Third Try:
Tried your suggestion [5] as stated in my last post, and got the same error [3]
Result: the same error [3].

For all the experiments I tried to use both
import "platform:/resource/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore"
and
import "platform:/plugin/org.eclipse.amalgam.tutorials.emf/model/Droid.ecore"
in the .xtext. Got no error from the editor, but got the same error [3] from the generator.


References:
1 - https://github.com/eclipse-soc/amalgamation-examples/tree/master/xtext/plugins
2 - https://github.com/eclipse-soc/amalgamation-examples/tree/master/emf/plugins
3 - The error message was:
0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri '/Users/juniorz/GSoC/gsoc-amalgamation-examples/xtext/plugins'
1873 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems instantiating module org.eclipse.amalgam.tutorials.xtext.Droid: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module org.eclipse.amalgam.tutorials.xtext.Droid: java.lang.reflect.InvocationTargetException
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
	at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:127)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:272)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:272)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:272)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:272)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:71)
	... 3 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
	... 36 more
Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/eclipse/amalgam/tutorials/xtext/Droid.xtext':[XtextLinkingDiagnostic: null:19 Couldn't resolve reference to EPackage 'http://www.eclipse.org/amalgam/tutorials/emf/Droid'., XtextLinkingDiagnostic: null:48 Couldn't resolve reference to EClassifier 'ApplicationUsesSDK'., XtextLinkingDiagnostic: null:70 Couldn't resolve reference to EClassifier 'Layout'., XtextLinkingDiagnostic: null:80 Couldn't resolve reference to EClassifier 'Layout'., XtextLinkingDiagnostic: null:96 Couldn't resolve reference to EClassifier 'Layout'., XtextLinkingDiagnostic: null:99 Couldn't resolve reference to EClassifier 'Layout'., XtextLinkingDiagnostic: null:109 Couldn't resolve reference to EClassifier 'Layout'., XtextLinkingDiagnostic: null:124 Couldn't resolve reference to EClassifier 'Activity'., XtextLinkingDiagnostic: null:125 Couldn't resolve reference to EClassifier 'Layout'., XtextLinkingDiagnostic: null:155 Couldn't resolve reference to EClassifier 'Layout'., XtextLinkingDiagnostic: null:159 Couldn't resolve reference to EClassifier 'Activity'., XtextLinkingDiagnostic: null:177 Couldn't resolve reference to EClassifier 'LinearLayout'., XtextLinkingDiagnostic: null:184 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:185 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:186 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:187 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:223 Couldn't resolve reference to EClassifier 'RelativeLayout'., XtextLinkingDiagnostic: null:230 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:231 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:232 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:233 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:271 Couldn't resolve reference to EClassifier 'TabHost'., XtextLinkingDiagnostic: null:277 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:278 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:279 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:280 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:316 Couldn't resolve reference to EClassifier 'TabWidget'., XtextLinkingDiagnostic: null:322 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:323 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:324 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:325 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:371 Couldn't resolve reference to EClassifier 'FrameLayout'., XtextLinkingDiagnostic: null:377 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:378 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:379 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:380 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:416 Couldn't resolve reference to EClassifier 'LayoutParams'., XtextLinkingDiagnostic: null:429 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:430 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:431 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:432 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:437 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:439 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:443 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:444 Couldn't resolve reference to EClassifier 'View'., XtextLinkingDiagnostic: null:523 Couldn't resolve reference to EClassifier 'Activity'., XtextLinkingDiagnostic: null:544 Couldn't resolve reference to EClassifier 'Spinner'., XtextLinkingDiagnostic: null:566 Couldn't resolve reference to EClassifier 'EditText'., XtextLinkingDiagnostic: null:773 Couldn't resolve reference to EClassifier 'BitmapDrawableResource'., XtextLinkingDiagnostic: null:778 Couldn't resolve reference to EClassifier 'TransitionDrawableResource'., XtextLinkingDiagnostic: null:779 Couldn't resolve reference to EClassifier 'BitmapDrawableResource'., XtextLinkingDiagnostic: null:779 Couldn't resolve reference to EClassifier 'BitmapDrawableResource'., XtextLinkingDiagnostic: null:789 Couldn't resolve reference to EClassifier 'MenuResource'., XtextLinkingDiagnostic: null:795 Couldn't resolve reference to EClassifier 'MenuItem'., XtextLinkingDiagnostic: null:801 Couldn't resolve reference to EClassifier 'MenuGroup'., XtextLinkingDiagnostic: null:807 Couldn't resolve reference to EClassifier 'SubMenu'., XtextLinkingDiagnostic: null:914 Couldn't resolve reference to EClassifier 'StringResource'., XtextLinkingDiagnostic: null:919 Couldn't resolve reference to EClassifier 'IntegerResource'., XtextLinkingDiagnostic: null:924 Couldn't resolve reference to EClassifier 'BooleanResource'., XtextLinkingDiagnostic: null:929 Couldn't resolve reference to EClassifier 'ColorResource'., XtextLinkingDiagnostic: null:934 Couldn't resolve reference to EClassifier 'DimensionResource'., XtextLinkingDiagnostic: null:947 Couldn't resolve reference to EClassifier 'DrawableResource'., XtextLinkingDiagnostic: null:952 Couldn't resolve reference to EClassifier 'AnimationResource'., XtextLinkingDiagnostic: null:1015 Couldn't resolve reference to EClassifier 'RadioButton'., TransformationDiagnostic: null:37 Cannot create type for Application because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:47 Cannot create type for ApplicationUsesSDK because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:56 Cannot create type for Resource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:60 Cannot create type for Layout because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:69 Cannot create type for AbstractActivity because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:73 Cannot create type for Activity because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:77 Cannot create type for GenericActivity because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:87 Cannot create type for ViewCollection because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:92 Cannot create type for ListActivity because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:106 Cannot create type for TabActivity because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:119 Cannot create type for Tab because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:136 Cannot create type for ActionSet because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:141 Cannot create type for Action because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:150 Cannot create type for GoToURLAction because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:154 Cannot create type for ShowLayoutAction because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:158 Cannot create type for InvokeActivityAction because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:164 Cannot create type for AbstractLinearLayout because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:168 Cannot create type for AbstractView because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:172 Cannot create type for View because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:176 Cannot create type for LinearLayout because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:222 Cannot create type for RelativeLayout because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:270 Cannot create type for TabHost because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:315 Cannot create type for TabWidget because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:370 Cannot create type for FrameLayout because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:415 Cannot create type for LayoutParams because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:453 Cannot create type for Widget because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:457 Cannot create type for AbstractTextView because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:461 Cannot create type for TextView because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:500 Cannot create type for ImageView because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:520 Cannot create type for Button because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:543 Cannot create type for Spinner because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:565 Cannot create type for EditText because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:606 Cannot create type for ValueAccess because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:615 Cannot create type for StringVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:620 Cannot create type for IntegerVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:626 Cannot create type for BooleanVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:631 Cannot create type for ColorVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:636 Cannot create type for DimensionVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:642 Cannot create type for LayoutDimensionVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:648 Cannot create type for AnyDrawableVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:651 Cannot create type for DrawableVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:655 Cannot create type for AnimationVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:660 Cannot create type for InterpolatorVA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:669 Cannot create type for ValueDefinition because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:674 Cannot create type for StringVD because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:677 Cannot create type for IntegerVD because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:680 Cannot create type for BooleanVD because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:683 Cannot create type for ColorVD because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:686 Cannot create type for DimensionVD because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:706 Cannot create type for ValueResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:712 Cannot create type for StringResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:716 Cannot create type for IntegerResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:720 Cannot create type for BooleanResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:724 Cannot create type for ColorResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:728 Cannot create type for DimensionResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:736 Cannot create type for ArrayResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:741 Cannot create type for IntegerArrayResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:748 Cannot create type for StringArrayResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:756 Cannot create type for TypedArrayResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:767 Cannot create type for DrawableResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:772 Cannot create type for BitmapDrawableResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:777 Cannot create type for TransitionDrawableResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:788 Cannot create type for MenuResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:794 Cannot create type for MenuItem because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:800 Cannot create type for MenuItemGroup because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:806 Cannot create type for SubMenu because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:817 Cannot create type for AnimationResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:821 Cannot create type for FrameAnimationElement because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:825 Cannot create type for TerminalAnimationElements because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:829 Cannot create type for TerminalAnimationSet because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:837 Cannot create type for AlphaAnimation because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:845 Cannot create type for ScaleAnimation because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:853 Cannot create type for TranslateAnimation because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:861 Cannot create type for RotateAnimation because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:870 Cannot create type for TweenAnimationResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:876 Cannot create type for FrameAnimationResource because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:882 Cannot create type for AnimationFrame because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:904 Cannot create type for AbstractResourceAccess because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:907 Cannot create type for ResourceAccess because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:912 Cannot create type for StringRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:917 Cannot create type for IntegerRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:922 Cannot create type for BooleanRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:927 Cannot create type for ColorRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:932 Cannot create type for DimensionRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:945 Cannot create type for DrawableRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:950 Cannot create type for AnimationRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:955 Cannot create type for InterpolatorRA because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:964 Cannot create type for CheckBox because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1003 Cannot create type for RadioButton because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1012 Cannot create type for RadioGroup because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1028 Cannot create type for BuiltInPermissionType because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1147 Cannot create type for InterpolatorsKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1159 Cannot create type for LayoutDimensionKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1163 Cannot create type for LayoutGravityKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1170 Cannot create type for LayoutOrientationKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1174 Cannot create type for LayoutVisibilityKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1178 Cannot create type for TypefaceKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1182 Cannot create type for TextStyleKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1186 Cannot create type for AutoLinkKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias), TransformationDiagnostic: null:1190 Cannot create type for CapitalizeKind because its MetaModel is unknown. (ErrorCode: UnknownMetaModelAlias)]
	at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:112)
	... 41 more

4 - http://www.eclipse.org/forums/index.php/mv/msg/219530/694879/#msg_694879
5 - http://www.eclipse.org/forums/index.php/mv/msg/219530/694965/#msg_694965
Re: Reference to an external Ecore model (inside a plugin) [message #695131 is a reply to message #695110] Mon, 11 July 2011 05:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14718
Registered: July 2009
Senior Member
Hi,

import "http://www.eclipse.org/amalgam/tutorials/emf/Droid"


and

    bean = StandaloneSetup {
		platformUri = "${runtimeProject}/.."
		registerGeneratedEPackage="org.eclipse.amalgam.tutorials.emf.droid.DroidPackage"
	}


works for me. guess you don't need this genmodel stuff if you just want to use the imported metamodel and do not generate any metamodel by xtext at all.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Reference to an external Ecore model (inside a plugin) [message #695341 is a reply to message #695131] Mon, 11 July 2011 14:32 Go to previous message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

Thank you! Thats is SO simple! Thank you again!
Previous Topic:Content assistant for Datatypes
Next Topic:How to import existing UML metamodel with Xtext2?
Goto Forum:
  


Current Time: Thu Sep 26 10:59:51 GMT 2024

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

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

Back to the top