Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Using Sample Reflective Ecore Model Editor on our XMI files
Using Sample Reflective Ecore Model Editor on our XMI files [message #426128] Wed, 17 December 2008 03:04 Go to next message
Andrew H is currently offline Andrew HFriend
Messages: 117
Registered: July 2009
Senior Member
When we save our models as XMI and then load them in the Sample Reflective
Ecore Model Editor it fails to find the ecore models.

We've set some options to get it to save the schema location but it only
populates it with the namespace uri not the file uri.

What is the trick to get this to work without having to edit each file?

Note we are not a plug in.

Interestingly, the meta model explorer finds all our models so if only it
could tell the editor about them we'd be set.
Re: Using Sample Reflective Ecore Model Editor on our XMI files [message #426161 is a reply to message #426128] Wed, 17 December 2008 14:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000706050304010102090008
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Andrew,

Comments below.

Andrew H wrote:
> When we save our models as XMI and then load them in the Sample
> Reflective Ecore Model Editor it fails to find the ecore models.
>
> We've set some options to get it to save the schema location but it
> only populates it with the namespace uri not the file uri.
The schema location will be saved only if the ePackage.getNsURI() is not
the same as ePackage.eResource().getURI().
>
> What is the trick to get this to work without having to edit each file?
>
> Note we are not a plug in.
>
> Interestingly, the meta model explorer finds all our models so if only
> it could tell the editor about them we'd be set.
I'm not quite sure if you have a generated model or not. If you do, you
can specialize the XyzPackageImpl like this to ignore the uri, which by
default will be the nsURI and instead use some other physical location.

@Override
protected Resource createResource(String uri)
{
return super.createResource("<location>");
}



--------------000706050304010102090008
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Andrew,<br>
<br>
Comments below.<br>
<br>
Andrew H wrote:
<blockquote
cite="mid:915d59d8742e721d13a88d36b1bec755$1@www.eclipse.org"
type="cite">When we save our models as XMI and then load them in the
Sample Reflective Ecore Model Editor it fails to find the ecore models.
<br>
<br>
We've set some options to get it to save the schema location but it
only populates it with the namespace uri not the file uri.
<br>
</blockquote>
The schema location will be saved only if the ePackage.getNsURI() is
not the same as ePackage.eResource().getURI().<br>
<blockquote
cite="mid:915d59d8742e721d13a88d36b1bec755$1@www.eclipse.org"
type="cite"><br>
What is the trick to get this to work without having to edit each file?
<br>
<br>
Note we are not a plug in.
<br>
<br>
Interestingly, the meta model explorer finds all our models so if only
it could tell the editor about them we'd be set.
<br>
</blockquote>
I'm not quite sure if you have a generated model or not.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using Sample Reflective Ecore Model Editor on our XMI files [message #426173 is a reply to message #426161] Thu, 18 December 2008 02:32 Go to previous messageGo to next message
Andrew H is currently offline Andrew HFriend
Messages: 117
Registered: July 2009
Senior Member
Thanks Ed

Adding the following to our root package did the trick.
@Override
protected Resource createResource(String uri)
{
return
super.createResource("platform:/resource/<path>/ourmodel.ecore ");
}

Thanks for all your help throughout the year. So far our EMF work has been
very positive. Its enabling us to take a step change improvement in how we
do things. Its a very impressive framework.

cheers

Andrew

Ed Merks wrote:

> Andrew,

> Comments below.

> Andrew H wrote:
>> When we save our models as XMI and then load them in the Sample
>> Reflective Ecore Model Editor it fails to find the ecore models.
>>
>> We've set some options to get it to save the schema location but it
>> only populates it with the namespace uri not the file uri.
> The schema location will be saved only if the ePackage.getNsURI() is not
> the same as ePackage.eResource().getURI().
>>
>> What is the trick to get this to work without having to edit each file?
>>
>> Note we are not a plug in.
>>
>> Interestingly, the meta model explorer finds all our models so if only
>> it could tell the editor about them we'd be set.
> I'm not quite sure if you have a generated model or not. If you do, you
> can specialize the XyzPackageImpl like this to ignore the uri, which by
> default will be the nsURI and instead use some other physical location.

> @Override
> protected Resource createResource(String uri)
> {
> return super.createResource("<location>");
> }
Re: Using Sample Reflective Ecore Model Editor on our XMI files [message #426186 is a reply to message #426173] Thu, 18 December 2008 14:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Andrew,

I'm glad you like it. It's evolved over the last 6 years specifically
to address real world needs in a bottom up fashion. I'm always happy to
help people get past any roadblocks...


Andrew H wrote:
> Thanks Ed
>
> Adding the following to our root package did the trick. @Override
> protected Resource createResource(String uri)
> {
> return
> super.createResource("platform:/resource/<path>/ourmodel.ecore ");
> }
>
> Thanks for all your help throughout the year. So far our EMF work has
> been very positive. Its enabling us to take a step change improvement
> in how we do things. Its a very impressive framework.
>
> cheers
>
> Andrew
>
> Ed Merks wrote:
>
>> Andrew,
>
>> Comments below.
>
>> Andrew H wrote:
>>> When we save our models as XMI and then load them in the Sample
>>> Reflective Ecore Model Editor it fails to find the ecore models.
>>>
>>> We've set some options to get it to save the schema location but it
>>> only populates it with the namespace uri not the file uri.
>> The schema location will be saved only if the ePackage.getNsURI() is
>> not the same as ePackage.eResource().getURI().
>>>
>>> What is the trick to get this to work without having to edit each file?
>>>
>>> Note we are not a plug in.
>>>
>>> Interestingly, the meta model explorer finds all our models so if
>>> only it could tell the editor about them we'd be set.
>> I'm not quite sure if you have a generated model or not. If you do,
>> you can specialize the XyzPackageImpl like this to ignore the uri,
>> which by default will be the nsURI and instead use some other
>> physical location.
>
>> @Override
>> protected Resource createResource(String uri)
>> {
>> return super.createResource("<location>");
>> }
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO]: CDOViewImpl#getResource on resource that does not exist throws InvalidURIException
Next Topic:problem using external jar files
Goto Forum:
  


Current Time: Wed Apr 24 16:30:59 GMT 2024

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

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

Back to the top