Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » getting additional resources via customized reflective editor
getting additional resources via customized reflective editor [message #423121] Tue, 23 September 2008 14:48 Go to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 445
Registered: July 2009
Senior Member
Hi
I am working on an custom EMF reflective editor where we the user will be
able to see models in "box mode" where he can navigate in each compartment

My plugin works good but i have a problem when a user do a "load resource"
in his model.

When i get Elements referenced i got proxy elements where the eResource
method returns null.

when i do a EcoreUtil.resolveAll(myRootObject) i can see additional
resources but i can't see contents and when i do load on these i have a
filenotfoundException :'(
the additional resources' URI format are "filename.extension" withno
platform information ...

if anybody can help me to obtain EObjects through the proxy it could be
very nice :)




Re: getting additional resources via customized reflective editor [message #423125 is a reply to message #423121] Tue, 23 September 2008 15:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31162
Registered: July 2009
Senior Member
Tristan,

The key to these kinds of proxy issues always turns out to involve me
asking the same basic questions. What is the URI of the resource being
loaded? What is the URI of the proxy within that resource? Then I
point out that the URI of the resource being loaded should be absolute,
i.e., file:/c:/..., http://..., platform:/resource/project/... and
remind folks that the relative URI within the resource will be resolved
against the absolute URI used to load that resource. I'll also ask what
the URI of each resource in the resource set looks like. The probably
look wrong...


Tristan FAURE wrote:
> Hi
> I am working on an custom EMF reflective editor where we the user will
> be able to see models in "box mode" where he can navigate in each
> compartment
>
> My plugin works good but i have a problem when a user do a "load
> resource" in his model.
>
> When i get Elements referenced i got proxy elements where the
> eResource method returns null.
>
> when i do a EcoreUtil.resolveAll(myRootObject) i can see additional
> resources but i can't see contents and when i do load on these i have
> a filenotfoundException :'(
> the additional resources' URI format are "filename.extension" withno
> platform information ...
>
> if anybody can help me to obtain EObjects through the proxy it could
> be very nice :)
>
Re: getting additional resources via customized reflective editor [message #423126 is a reply to message #423125] Tue, 23 September 2008 15:11 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 445
Registered: July 2009
Senior Member
Sorry i understand
so i'm working in a workspace
myRootObject.eResource().getURI() : "/test/test.uml"
EcoreUtil.getURI(myProxyObject) : "child.uml"

-ResourceSet before EcoreUtil.resolveAll(myRootObject) :
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@7614d6
resources=[org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1262c96
uri='/test/Test.uml']

-after resolveAll
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@7614d6
resources=[org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1262c96
uri='/test/Test.uml',
org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1cd468c
uri='child.uml'

Ed Merks wrote:

> Tristan,

> The key to these kinds of proxy issues always turns out to involve me
> asking the same basic questions. What is the URI of the resource being
> loaded? What is the URI of the proxy within that resource? Then I
> point out that the URI of the resource being loaded should be absolute,
> i.e., file:/c:/..., http://..., platform:/resource/project/... and
> remind folks that the relative URI within the resource will be resolved
> against the absolute URI used to load that resource. I'll also ask what
> the URI of each resource in the resource set looks like. The probably
> look wrong...


> Tristan FAURE wrote:
>> Hi
>> I am working on an custom EMF reflective editor where we the user will
>> be able to see models in "box mode" where he can navigate in each
>> compartment
>>
>> My plugin works good but i have a problem when a user do a "load
>> resource" in his model.
>>
>> When i get Elements referenced i got proxy elements where the
>> eResource method returns null.
>>
>> when i do a EcoreUtil.resolveAll(myRootObject) i can see additional
>> resources but i can't see contents and when i do load on these i have
>> a filenotfoundException :'(
>> the additional resources' URI format are "filename.extension" withno
>> platform information ...
>>
>> if anybody can help me to obtain EObjects through the proxy it could
>> be very nice :)
>>
]




Re: getting additional resources via customized reflective editor [message #423127 is a reply to message #423126] Tue, 23 September 2008 15:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31162
Registered: July 2009
Senior Member
Tristan,

Comments below.

Tristan FAURE wrote:
> Sorry i understand so i'm working in a workspace
> myRootObject.eResource().getURI() : "/test/test.uml"
This looks bad already. Use
URI.createPlatformResourceURI(iResource.getFullPath().toStri ng()) so
that you end with with platform:/resource/test/test.uml instead.
> EcoreUtil.getURI(myProxyObject) : "child.uml"
>
> -ResourceSet before EcoreUtil.resolveAll(myRootObject) :
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@7614d6
> resources=[org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1262c96
> uri='/test/Test.uml']
>
> -after resolveAll
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@7614d6
> resources=[org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1262c96
> uri='/test/Test.uml',
> org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1cd468c
> uri='child.uml'
>
> Ed Merks wrote:
>
>> Tristan,
>
>> The key to these kinds of proxy issues always turns out to involve me
>> asking the same basic questions. What is the URI of the resource
>> being loaded? What is the URI of the proxy within that resource?
>> Then I point out that the URI of the resource being loaded should be
>> absolute, i.e., file:/c:/..., http://...,
>> platform:/resource/project/... and remind folks that the relative URI
>> within the resource will be resolved against the absolute URI used to
>> load that resource. I'll also ask what the URI of each resource in
>> the resource set looks like. The probably look wrong...
>
>
>> Tristan FAURE wrote:
>>> Hi
>>> I am working on an custom EMF reflective editor where we the user
>>> will be able to see models in "box mode" where he can navigate in
>>> each compartment
>>>
>>> My plugin works good but i have a problem when a user do a "load
>>> resource" in his model.
>>>
>>> When i get Elements referenced i got proxy elements where the
>>> eResource method returns null.
>>>
>>> when i do a EcoreUtil.resolveAll(myRootObject) i can see additional
>>> resources but i can't see contents and when i do load on these i
>>> have a filenotfoundException :'(
>>> the additional resources' URI format are "filename.extension" withno
>>> platform information ...
>>>
>>> if anybody can help me to obtain EObjects through the proxy it could
>>> be very nice :)
>>>
> ]
>
Re: getting additional resources via customized reflective editor [message #423129 is a reply to message #423127] Tue, 23 September 2008 15:34 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 445
Registered: July 2009
Senior Member
Thank you so much it was a problem when i loaded my model

Ed Merks wrote:

> Tristan,

> Comments below.

> Tristan FAURE wrote:
>> Sorry i understand so i'm working in a workspace
>> myRootObject.eResource().getURI() : "/test/test.uml"
> This looks bad already. Use
> URI.createPlatformResourceURI(iResource.getFullPath().toStri ng()) so
> that you end with with platform:/resource/test/test.uml instead.
>> EcoreUtil.getURI(myProxyObject) : "child.uml"
>>
>> -ResourceSet before EcoreUtil.resolveAll(myRootObject) :
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@7614d6
>> resources=[org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1262c96
>> uri='/test/Test.uml']
>>
>> -after resolveAll
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@7614d6
>> resources=[org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1262c96
>> uri='/test/Test.uml',
>> org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@1cd468c
>> uri='child.uml'
>>
>> Ed Merks wrote:
>>
>>> Tristan,
>>
>>> The key to these kinds of proxy issues always turns out to involve me
>>> asking the same basic questions. What is the URI of the resource
>>> being loaded? What is the URI of the proxy within that resource?
>>> Then I point out that the URI of the resource being loaded should be
>>> absolute, i.e., file:/c:/..., http://...,
>>> platform:/resource/project/... and remind folks that the relative URI
>>> within the resource will be resolved against the absolute URI used to
>>> load that resource. I'll also ask what the URI of each resource in
>>> the resource set looks like. The probably look wrong...
>>
>>
>>> Tristan FAURE wrote:
>>>> Hi
>>>> I am working on an custom EMF reflective editor where we the user
>>>> will be able to see models in "box mode" where he can navigate in
>>>> each compartment
>>>>
>>>> My plugin works good but i have a problem when a user do a "load
>>>> resource" in his model.
>>>>
>>>> When i get Elements referenced i got proxy elements where the
>>>> eResource method returns null.
>>>>
>>>> when i do a EcoreUtil.resolveAll(myRootObject) i can see additional
>>>> resources but i can't see contents and when i do load on these i
>>>> have a filenotfoundException :'(
>>>> the additional resources' URI format are "filename.extension" withno
>>>> platform information ...
>>>>
>>>> if anybody can help me to obtain EObjects through the proxy it could
>>>> be very nice :)
>>>>
>> ]
>>




Previous Topic:Does ID property have to be unique in the whole Resource?
Next Topic:EMF and Maps
Goto Forum:
  


Current Time: Fri Jun 05 07:06:05 GMT 2020

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

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

Back to the top