Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Import from XML errors
Import from XML errors [message #157586] Tue, 30 October 2007 10:53 Go to next message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
Hi, I got to migrate a whole gui designer based on emf/gmf to the latest
versions of these plugins and eclipse. What are the correct steps to
import my very very large XSD model to my up-to date eclipse environment?
I'm behind porting an application with several custom palette items and
views and a lot of distributed code all nested into my model, and I got
big troubles in generating a new ecore-genmodel from the XSD i have.

Basically, what I believe I've got to do is this (just to let you see if
I'm doin noob mistakes):
a) start a new gmf project under an up-to-date eclipse environment;
b) create an emf project loading old version xsd file; c) try to
import/migrate the gmftool & gmfgraph friends hoping I won't have to
rebulid by hand all the nesting child/nodes stuff.
d) "combine" them in the .gmfmap (via gmf dashboard) and generate the
final .diagram code.

The problem is that as soon as I try to import my old version xsd and I
let eclipse "generate all" from .genmodel, what I get is only
mistake-filled projects parts. Missing references, missing classes, wrong
visibilities.. all on the generated part of the code so I really don't
have a clue on what to do.
This make me ask you what I am doing wrong, and if is this the correct way
to migrate my project in order to use/implement the new features of latest
gmf.
I also can't find documentation about why loading from xml make eclipse
embedding also a "ecore.ecore" model along with the one I'm actually
importing, indeed errors seem coming from this.
I'm trying to avoid to rewrite everything by hand starting from scratch...
besides our develeopement teams need to keep working around this xsd
import thing (new widgets we will develop etc).
Thanks for your help!
Re: Import from XML errors [message #157636 is a reply to message #157586] Tue, 30 October 2007 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Paolo,

You asked this same question on the XSD newsgroup. If you must post to
multiple newsgroups please use a single posting to all the groups so
that my answer to the EMF parts of this question would have appeared on
this newsgroup as well. Below is what I said on the XSD newsgroup:


Paolo RUssian wrote:
> Paolo,
>
> This is more an EMF question and it includes GMF aspects I might not
> be able to answer.
>
> Paolo RUssian wrote:
>> Hi, I got to migrate a whole gui designer based on emf/gmf to the
>> latest versions of these plugins and eclipse. What are the correct
>> steps to import my very very large XSD model to my up-to date eclipse
>> environment?
> In terms of EMF, there should be no need to repeat the import steps
> unless the XSD itself has changed. In that case, right clicking on
> the .genmodel file invoking "Reload..." or opening it and doing the
> same things from via "Generator->Reload..." on the menubar will allow
> you to repeat the import steps again. This will preserve all your
> existing GenModel's settings.
>> I'm behind porting an application with several custom palette items
>> and views and a lot of distributed code all nested into my model, and
>> I got big troubles in generating a new ecore-genmodel from the XSD i
>> have.
>>
>> Basically, what I believe I've got to do is this (just to let you see
>> if I'm doin noob mistakes):
>> a) start a new gmf project under an up-to-date eclipse environment;
> Gosh, I would hope you don't need to start any new projects if you
> have existing projects.
>> b) create an emf project loading old version xsd file;
> If you have an existing EMF project with a .genmodel file, you can
> simply reload it and regenerate it in place.
>> c) try to import/migrate the gmftool & gmfgraph friends hoping I
>> won't have to rebulid by hand all the nesting child/nodes stuff.
> I'm not so familiar with what you need to do with GMF, but I imagine
> it has similar reloading support.
>> d) "combine" them in the .gmfmap (via gmf dashboard) and generate the
>> final .diagram code.
>>
>> The problem is that as soon as I try to import my old version xsd and
>> I let eclipse "generate all" from .genmodel, what I get is only
>> mistake-filled projects parts. Missing references, missing classes,
>> wrong visibilities.. all on the generated part of the code so I
>> really don't have a clue on what to do.
> I would expect that only parts of the model that have changed will
> regenerate. Perhaps you didn't use Reload... but rather created a new
> GenModel? Are you migrating from EMF 2.2 to 2.3? Are you trying to
> take advantage of Java 5.0 support? By default with EMF 2.3, I would
> expect your existing GenModel to continue to generate code that works
> with the 2.2 runtime.
>> This make me ask you what I am doing wrong, and if is this the
>> correct way to migrate my project in order to use/implement the new
>> features of latest gmf.
>> I'm trying to avoid to rewrite everything by hand starting from
>> scratch... besides our develeopement teams need to keep working
>> around this xsd import thing (new widgets we will develop etc).
> Yes, having to repeat the steps of hand written code would be
> unacceptable. Now however that I can only answer the EMF parts of the
> questions and that using the GMF newsgroup for the GMF parts would be
> better. news://news.eclipse.org/eclipse.modeling.gmf
>
> Thanks for your help!
Re: Import from XML errors [message #157775 is a reply to message #157586] Tue, 30 October 2007 19:23 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Paolo,

> a) start a new gmf project under an up-to-date eclipse environment;
As Ed correctly mentioned, you don't need to create new project - you can
load al the existing files and most of the changes (ideally all the changes
;-)) should be done for you automatically buy GMF.

The main problem is custom code + templates - generator was significantly
changes since 2.0, so you will probably spend some time on migrating custom
code/templates to GMF 2.0

-----------------
Alex Shatalin
Re: Import from XML errors [message #157839 is a reply to message #157775] Wed, 31 October 2007 08:56 Go to previous messageGo to next message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
btw sorry for the doublepost, anyway you got the point. Later on yesterday
I tried to import just for testing the famous MindMap.xsd available on the
net, and since I got the ecore generated from that without any problem
(gmf part, I mean gmftool and gmfgraph was all messed anyway). Surprised,
I looked into this mindmap.xsd source and cross-checked with mine. I've
noticed that new gmf/emf environment give errors whenever finds xml
attributes like this (wich I have):

ecore:EString

while mindmap has

xsd:String

I tried to replace every occurrence of my EStrings in Strings, saved and
tried again... and it worked. But still.. I don't think this is the better
way to workaround the problem, I'm gonna look for and try the "regenerate"
feature right now.
Furthermore, does anyone know how to modify or update the .gmfgraph,
gmftool and .gmfgen without scrambling everything up each time? I mean:
in order to keep intact the line from initial xml to final
MyProjectName.gmfmap when someone adds a new widget I need to modify the
gmfgen and the .gmftool, then modify the .gmfmap accordingly and let
generate the diagram code .gmfgen
This process is the only correct one? Because when you're dealing with
very large toolings addons it can be very painful to recreate and
dobulecheck the nodes disposition everytime, since let eclipse derive them
automatically leads 90% of the times in a fantasy scheme (upon my several
tries at least).
Re: Import from XML errors [message #157916 is a reply to message #157839] Wed, 31 October 2007 12:38 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Paolo,

I terms of the EMF part of your question, if you use ecore:EString,
you'd need to have a import statement for importing the Ecore namespace
and point the schema location at the Ecore.xsd. Did you have that in
your schema? (I'd be surprised you use Ecore.xsd except if you have a
schema exported from EMF that was specified using Ecore's data types.)


Paolo Russian wrote:
> btw sorry for the doublepost, anyway you got the point. Later on
> yesterday I tried to import just for testing the famous MindMap.xsd
> available on the net, and since I got the ecore generated from that
> without any problem (gmf part, I mean gmftool and gmfgraph was all
> messed anyway). Surprised, I looked into this mindmap.xsd source and
> cross-checked with mine. I've noticed that new gmf/emf environment
> give errors whenever finds xml attributes like this (wich I have):
>
> ecore:EString
>
> while mindmap has
>
> xsd:String
>
> I tried to replace every occurrence of my EStrings in Strings, saved
> and tried again... and it worked. But still.. I don't think this is
> the better way to workaround the problem, I'm gonna look for and try
> the "regenerate" feature right now.
> Furthermore, does anyone know how to modify or update the .gmfgraph,
> gmftool and .gmfgen without scrambling everything up each time? I
> mean: in order to keep intact the line from initial xml to final
> MyProjectName.gmfmap when someone adds a new widget I need to modify
> the gmfgen and the .gmftool, then modify the .gmfmap accordingly and
> let generate the diagram code .gmfgen
> This process is the only correct one? Because when you're dealing with
> very large toolings addons it can be very painful to recreate and
> dobulecheck the nodes disposition everytime, since let eclipse derive
> them automatically leads 90% of the times in a fantasy scheme (upon my
> several tries at least).
>
>
Previous Topic:How to control/tweak the distance between a connection and its label?
Next Topic:Duplicate Edges across muliple views
Goto Forum:
  


Current Time: Thu Apr 25 04:46:22 GMT 2024

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

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

Back to the top