Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] import issue
[Xpand] import issue [message #765725] Wed, 14 December 2011 10:29 Go to next message
Eclipse UserFriend
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 11:55] by Moderator

Re: [Xpand] import issue [message #766124 is a reply to message #765725] Thu, 15 December 2011 03:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

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

~Christian
Re: [Xpand] import issue [message #766136 is a reply to message #766124] Thu, 15 December 2011 04:09 Go to previous messageGo to next message
Eclipse UserFriend
The error is in the editor
Re: [Xpand] import issue [message #766144 is a reply to message #766136] Thu, 15 December 2011 04:22 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: [Xpand] import issue [message #766205 is a reply to message #766144] Thu, 15 December 2011 06:09 Go to previous messageGo to next message
Eclipse UserFriend
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 13:11 Go to previous messageGo to next message
Eclipse UserFriend
Make sure that if the .ecore file contains platform:/resource URIs that these URIs are valid in the workspace.
Re: [Xpand] import issue [message #766668 is a reply to message #766403] Fri, 16 December 2011 03:32 Go to previous messageGo to next message
Eclipse UserFriend
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 690 times)

[Updated on: Fri, 16 December 2011 03:35] by Moderator

Re: [Xpand] import issue [message #766731 is a reply to message #766668] Fri, 16 December 2011 05:33 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: [Xpand] import issue [message #766740 is a reply to message #766731] Fri, 16 December 2011 05:42 Go to previous messageGo to next message
Eclipse UserFriend
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 06:35 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: [Xpand] import issue [message #766810 is a reply to message #766765] Fri, 16 December 2011 08:20 Go to previous messageGo to next message
Eclipse UserFriend
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 08:58 Go to previous message
Eclipse UserFriend
Hi,

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

~Christian
Previous Topic:[Acceleo] Bug when accessing abstract UML metaclasses
Next Topic:[Acceleo] disable java starter generation.
Goto Forum:
  


Current Time: Wed Jul 02 18:00:00 EDT 2025

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

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

Back to the top