Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Use resource as GMF input
[Texo] Use resource as GMF input [message #1401140] Tue, 15 July 2014 07:25 Go to next message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi Martin,

this might be more of an EMF question, but maybe you (or anyone else) has already experenced this situation.
In my project I created a GMF editor and wanted it to use the Texo component as a direct input. Here are the steps for setting it as the editor input.

1. I create a local diagram file as a direct input for the editor. It references the content with an URI.

2. I tried to create the referencing URI by calling EcoreUtil.getURI(model). This returns: http://localhost:8080/texo/jsonws#test|TestModel||1. If this URI is used as the reference, the server throws an IllegalArgument Exception with Service path null not supported. So I don't use this URI, but set a string that looks like that: http://localhost:8080/texo/jsonws/test|TestModel/1#. This won't cause an IllegalArgumentException.

3. Setting this as the URIEditorInput the GMF component starts without complaining.

4. Unfortunately, nothing is drawn, but dropping GMF elements on the drawing area I can see, the server is contacted.

I saw this post: https://www.eclipse.org/forums/index.php/t/505043/ on the same topic. So I wonder, if you have any hints on this topic. If you need more information on this just tell me.

Best regards
Bastian
Re: [Texo] Use resource as GMF input [message #1401326 is a reply to message #1401140] Tue, 15 July 2014 12:57 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi Martin,

I fixed this. I just did not register the protocol correctly. Now, the model ist loaded correctly. That leads to errors while trying to drop new objects into the model. Since org.eclipse.gmf.runtime.emf.core.util.Util.getProxyID(EObject proxy) tries to retrieve an URI fragment, which is not available, because the object is not persisted at this moment. So a NPE is thrown. I don't know, if it's a standard by EMF to always return a fragment or not, but the TexoResource does not set a fragment for a non-saved object. Does the object has to be persisted at first, or should the resource just return a fragment?

Best regards
Bastian
Re: [Texo] Use resource as GMF input [message #1402296 is a reply to message #1401326] Wed, 16 July 2014 20:43 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Bastian,
I am somewhat in doubt on what to do. It is not difficult probably to set a dummy proxy id. But I am somewhat surprised
that this happens, new objects to a resource are generally not a proxy, so they don't have a proxy uri set. Or do they
in the case of gmf?

gr. Martin

On 15-07-14 14:57, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I fixed this. I just did not register the protocol correctly. Now, the model ist loaded correctly. That leads to errors
> while trying to drop new objects into the model. Since org.eclipse.gmf.runtime.emf.core.util.Util.getProxyID(EObject
> proxy) tries to retrieve an URI fragment, which is not available, because the object is not persisted at this moment. So
> a NPE is thrown. I don't know, if it's a standard by EMF to always return a fragment or not, but the TexoResource does
> not set a fragment for a non-saved object. Does the object has to be persisted at first, or should the resource just
> return a fragment?
>
> Best regards
> Bastian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] Use resource as GMF input [message #1403690 is a reply to message #1402296] Fri, 25 July 2014 11:10 Go to previous message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi Martin,

sorry for that late reply. I don't know exactly, why GMF is looking for a proxy id. And I don't think an id is much relevant at this place. I also think it would be no problem, if the returned id is empty, but the main thing is it seems not allowed to be empty.
Nevertheless I "solved" this by just adding the newly created object to the resource. This is an acceptable behaviour at this place.

Now, it works fine. Thank you for your fast help.

Best regards
Bastian
Previous Topic:Howto setup EMFstore to only use my production server
Next Topic:Disable logging information of Teneo/Hibernate
Goto Forum:
  


Current Time: Tue Mar 02 05:41:52 GMT 2021

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

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

Back to the top