Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] import issue
[Xpand] import issue [message #765725] Wed, 14 December 2011 15:29 Go to next message
Federico Pozzoni is currently offline Federico PozzoniFriend
Messages: 16
Registered: December 2011
Junior Member
i'm trying to export my ecore to a .csv file but i've a issue with the import:
when i try to import my ecore model with «IMPORT mindmap» an error appear

Quote:
Description Resource Path Location Type
"stringLiteralExpCS"is invalid(generator:1:9:1:16: ) generator.xpt /org.eclipse.dsl.project/templates line: 1 (8 .. 16) Xpand Problem

what can i do to resolve this kind of problem?

this is my .xpt
Quote:
«IMPORT mindmap»

«DEFINE Main FOR Map»
«FILE title + ".csv"-»
«FOREACH elements.typeSelect(Topic) AS topic-»
«topic.name»,«topic.start»,«topic.end»
«ENDFOREACH»
«ENDFILE»
«ENDDEFINE»


tis is my .mwe

Quote:
<?xml version="1.0"?>
<workflow>
<property name="model"
value="platform:/resource/org.eclipse.dsl.mindmap/model/Mindmap.xmi"/>
<property name="out" value="out" />
<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value="../" />
</bean>
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="${model}" />
<modelSlot value="model" />
</component>
<!-- generate code -->
<component class="org.eclipse.xpand2.Generator">
<metaModel id="mm"
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<expand value="mindmap2csv::Main FOR model" />
<outlet path="${out}"/>
</component>
</workflow>


edit

i've try some change on the .mwe that now is

Quote:

<?xml version="1.0"?>
<workflow>
<property name="model" value="platform:/resource/org.eclipse.dsl.mindmap/model/mindmap.xmi" />
<property name="out" value="out" />

<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value=".."/>
<registerEcoreFile value="platform:/resource/org.eclipse.dsl.mindmap/model/mindmap.ecore" />
</bean>
</bean>
<bean id="mm_emf" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="${model}" />
<modelSlot value="model" />
</component>

<!-- generate code -->
<component class="org.eclipse.xpand2.Generator">
<metaModel idRef="mm_emf"/>
<expand
value="template::Template::main FOR model" />
<outlet path="${src-gen}" >
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
</outlet>
</component>
</workflow>

[Updated on: Wed, 14 December 2011 16:55]

Report message to a moderator

Re: [Xpand] import issue [message #766124 is a reply to message #765725] Thu, 15 December 2011 08:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

is the error in the Editor or if you call the workflow?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand] import issue [message #766136 is a reply to message #766124] Thu, 15 December 2011 09:09 Go to previous messageGo to next message
Federico Pozzoni is currently offline Federico PozzoniFriend
Messages: 16
Registered: December 2011
Junior Member
The error is in the editor
Re: [Xpand] import issue [message #766144 is a reply to message #766136] Thu, 15 December 2011 09:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

which metamodel contributor is enabled in your projects properties (xtend/xpand section)?
if emf => is the ecore on the classpath
if not change to emf

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand] import issue [message #766205 is a reply to message #766144] Thu, 15 December 2011 11:09 Go to previous messageGo to next message
Federico Pozzoni is currently offline Federico PozzoniFriend
Messages: 16
Registered: December 2011
Junior Member
First of all thanks for the fast reply.
in the project properties i've checked the emf metamodel
Re: [Xpand] import issue [message #766403 is a reply to message #766205] Thu, 15 December 2011 18:11 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Make sure that if the .ecore file contains platform:/resource URIs that these URIs are valid in the workspace.

Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [Xpand] import issue [message #766668 is a reply to message #766403] Fri, 16 December 2011 08:32 Go to previous messageGo to next message
Federico Pozzoni is currently offline Federico PozzoniFriend
Messages: 16
Registered: December 2011
Junior Member
i've created my .ecore with a .ecore_diagram and, i've set those informations (like you can se in this image)
Quote:

Name: mindmap
NS Prefix:mindmap
NS URI: h_t_t_p://www.eclipse.org/2008/mindmap


By valid uri what do you mean? the uri must have some kind of standard structure or i can choose something random like h_t_t_p://www.uri.com/mindmap??


  • Attachment: Immagine.bmp
    (Size: 127.24KB, Downloaded 586 times)

[Updated on: Fri, 16 December 2011 08:35]

Report message to a moderator

Re: [Xpand] import issue [message #766731 is a reply to message #766668] Fri, 16 December 2011 10:33 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

The NS URI just needs to be unique. Question is if the URIs *in* the ecore XMI are valid. Usually they are, so don't be confused so much from my post. It is just that I saw Ecore files with references where the reference URIs were not valid, which leads to such an error in the editor.

Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [Xpand] import issue [message #766740 is a reply to message #766731] Fri, 16 December 2011 10:42 Go to previous messageGo to next message
Federico Pozzoni is currently offline Federico PozzoniFriend
Messages: 16
Registered: December 2011
Junior Member
i've tried some different uri but the error remains, so i think that the error must be somewhere else.
Re: [Xpand] import issue [message #766765 is a reply to message #766731] Fri, 16 December 2011 11:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hello Karsten,

i can reproduce the problem. i dont see where the ProjectAnalyzer of
Xtend does use the EMF Registry.
if i start a runtime eclipse the analyzer does not seem to scan the bin
folder or whatever eclipse creates for the host workspace.

=> the ecore will not be found unless you copy & paste it to the
runtime eclipse

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand] import issue [message #766810 is a reply to message #766765] Fri, 16 December 2011 13:20 Go to previous messageGo to next message
Federico Pozzoni is currently offline Federico PozzoniFriend
Messages: 16
Registered: December 2011
Junior Member
i apologize for the silly question but, how i do this?

Quote:
the ecore will not be found unless you copy & paste it to the
runtime eclipse
Re: [Xpand] import issue [message #766831 is a reply to message #766810] Fri, 16 December 2011 13:58 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

just take the .ecore file and copy it next to the xpand file

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[Acceleo] Bug when accessing abstract UML metaclasses
Next Topic:[Acceleo] disable java starter generation.
Goto Forum:
  


Current Time: Thu Apr 18 22:10:16 GMT 2024

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

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

Back to the top