Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF Plugin] Creating a model depending an other model
[EMF Plugin] Creating a model depending an other model [message #521694] Thu, 18 March 2010 14:12 Go to next message
Nicolas  is currently offline Nicolas Friend
Messages: 2
Registered: March 2010
Junior Member
Hi all!

Before anything, please excuse my very poor English language...

So, my problem is the following :
I have created an ecore model depending on the UML2 ecore model (my "AbstractModel"), and I would like to create an other ecore model ("MyFinalModel") that depends the "AbstractModel".

I have exported my "AbstractModel" into a plugin => MY_PLUGIN_MODEL.jar.

I have created an other project with a new ecore ("MyFinalModel") that extends "AbstractModel" by selecting "Load resource" in the ecore editor, the selecting "Browse workspace" => "AbstractModel".
I've done several modifications in "MyFinalModel" then I've launched the genmodel generation.
But the AbstractModel.ecore have been copied near the MyFinalModel.genmodel, and when I generate the model, "abstractModel is also generated => I don't want that...

So I've put MY_PLUGIN_MODEL.jar in the Eclipse Ganymede dropins directory.

I've selected "Load resource" in the ecore editor (for MyFinalModel), "Browse Registered Packages", and finally "AbstractModel in "Runtime version". The package is available in "Development time version" and "Runtime version", but I can only use it in "Runtime version".

I've tried to generate the genmodel, but the following errors occured:
org.eclipse.emf.common.util.DiagnosticException: An error occurred while performing this operation.
	at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard$1.execute(Unknown Source)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Unknown Source)
	at org.eclipse.core.internal.resources.Workspace.run(Unknown Source)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(Unknown Source)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(Unknown Source)
................


followed by

java.io.IOException: PUT failed with HTTP response code 405
	at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl$1.close(Unknown Source)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(Unknown Source)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Unknown Source)
	at org.eclipse.emf.importer.ModelImporter.saveGenModelAndEPackages(Unknown Source)
	at org.eclipse.emf.importer.ui.contribution.base.ModelImporterWizard.doPerformFinish(Unknown Source)
.......................


The (few) resources I have found on the web told me to use the "Development time version"... but I can't!

Please notice that "AbstractModel" depends on the UML2 model (in "Development time version") and no problem occured when genmodel has been generated.

Do you where I'm wrong?
How can I do to depend on my "AbstractModel" in"Development time version"?

Thanks in advance for you replies...

Nico
Re: [EMF Plugin] Creating a model depending an other model [message #521714 is a reply to message #521694] Thu, 18 March 2010 14:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010502050801020701030203
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Nicolas,

Comments below.

Nicolas wrote:
> Hi all!
>
> Before anything, please excuse my very poor English language...
>
> So, my problem is the following :
> I have created an ecore model depending on the UML2 ecore model (my
> "AbstractModel"), and I would like to create an other ecore model
> ("MyFinalModel") that depends the "AbstractModel".
>
> I have exported my "AbstractModel" into a plugin => MY_PLUGIN_MODEL.jar.
>
> I have created an other project with a new ecore ("MyFinalModel") that
> extends "AbstractModel" by selecting "Load resource" in the ecore
> editor, the selecting "Browse workspace" => "AbstractModel".
> I've done several modifications in "MyFinalModel" then I've launched
> the genmodel generation.
> But the AbstractModel.ecore have been copied near the
> MyFinalModel.genmodel, and when I generate the model, "abstractModel
> is also generated => I don't want that...
In the last page of the wizard for creating or reloading the GenModel,
you need to use the bottom half of the page to locate an existing
GenModel that refers to the Ecore you'd like to reuse so you can avoid
ending up with a second copy of that.
>
> So I've put MY_PLUGIN_MODEL.jar in the Eclipse Ganymede dropins
> directory.
>
> I've selected "Load resource" in the ecore editor (for MyFinalModel),
> "Browse Registered Packages", and finally "AbstractModel in "Runtime
> version". The package is available in "Development time version" and
> "Runtime version", but I can only use it in "Runtime version".
>
> I've tried to generate the genmodel, but the following errors occured:
> org.eclipse.emf.common.util.DiagnosticException: An error occurred
> while performing this operation.
> at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverte rWizard$1.execute(Unknown
> Source)
> at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Unknow n
> Source)
> at org.eclipse.core.internal.resources.Workspace.run(Unknown Source)
> at org.eclipse.ui.actions.WorkspaceModifyOperation.run(Unknown
> Source)
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( Unknown
> Source)
What's in your plugin.xml? It should specify the location of the GenModel:

<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri="http://www.example.com/Library"
class="com.example.library.LibraryPackage"
*genModel="model/Library.genmodel"/>*
</extension>

The jar should include it because of this in the build.properties

bin.includes = .,\
model/,\

> ...............
>
>
> followed by
>
> java.io.IOException: PUT failed with HTTP response code 405
> at
> org.eclipse.emf.ecore.resource.impl.URIHandlerImpl$1.close(U nknown
> Source)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfC hangedWithMemoryBuffer(Unknown
> Source)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Unknow n
> Source)
> at
> org.eclipse.emf.importer.ModelImporter.saveGenModelAndEPacka ges(Unknown
> Source)
> at
> org.eclipse.emf.importer.ui.contribution.base.ModelImporterW izard.doPerformFinish(Unknown
> Source)
> ......................
>
> The (few) resources I have found on the web told me to use the
> "Development time version"... but I can't!
>
> Please notice that "AbstractModel" depends on the UML2 model (in
> "Development time version") and no problem occured when genmodel has
> been generated.
>
> Do you where I'm wrong?
Sounds like an issue with registration in the plugin.xml...
> How can I do to depend on my "AbstractModel" in"Development time
> version"?
>
> Thanks in advance for you replies...
>
> Nico

--------------010502050801020701030203
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Nicolas,<br>
<br>
Comments below.<br>
<br>
Nicolas wrote:
<blockquote cite="mid:hntccd$8db$1@build.eclipse.org" type="cite">Hi
all!
<br>
<br>
Before anything, please excuse my very poor English language...
<br>
<br>
So, my problem is the following :
<br>
I have created an ecore model depending on the UML2 ecore model (my
"AbstractModel"), and I would like to create an other ecore model
("MyFinalModel") that depends the "AbstractModel".
<br>
<br>
I have exported my "AbstractModel" into a plugin =&gt;
MY_PLUGIN_MODEL.jar.
<br>
<br>
I have created an other project with a new ecore ("MyFinalModel") that
extends "AbstractModel" by selecting "Load resource" in the ecore
editor, the selecting "Browse workspace" =&gt; "AbstractModel".
<br>
I've done several modifications in "MyFinalModel" then I've launched
the genmodel generation.
<br>
But the AbstractModel.ecore have been copied near the
MyFinalModel.genmodel, and when I generate the model, "abstractModel is
also generated =&gt; I don't want that...
<br>
</blockquote>
In the last page of the wizard for creating or reloading the GenModel,
you need to use the bottom half of the page to locate an existing
GenModel that refers to the Ecore you'd like to reuse so you can avoid
ending up with a second copy of that.<br>
<blockquote cite="mid:hntccd$8db$1@build.eclipse.org" type="cite"><br>
So I've put MY_PLUGIN_MODEL.jar in the Eclipse Ganymede dropins
directory.
<br>
<br>
I've selected "Load resource" in the ecore editor (for MyFinalModel),
"Browse Registered Packages", and finally "AbstractModel in "Runtime
version". The package is available in "Development time version" and
"Runtime version", but I can only use it in "Runtime version".
<br>
<br>
I've tried to generate the genmodel, but the following errors occured:
<br>
org.eclipse.emf.common.util.DiagnosticException: An error occurred
while performing this operation.
<br>
    at
org.eclipse.emf.converter.ui.contribution.base.ModelConverte rWizard$1.execute(Unknown
Source)
<br>
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Unknow n
Source)
<br>
    at org.eclipse.core.internal.resources.Workspace.run(Unknown
Source)
<br>
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(Unknown
Source)
<br>
    at
org.eclipse.jface.operation.ModalContext.runInCurrentThread( Unknown
Source)
<br>
</blockquote>
What's in your plugin.xml?  It should specify the location of the
GenModel:<br>
<br>
   &lt;extension point="org.eclipse.emf.ecore.generated_package"&gt;<br >
      &lt;package<br>
            uri=<a class="moz-txt-link-rfc2396E" href="http://www.example.com/Library">"http://www.example.com/Library"</a><br>
            class="com.example.library.LibraryPackage"<br>
            <b>genModel="model/Library.genmodel"/&gt;</b><br>
   &lt;/extension&gt;<br>
<br>
The jar should include it because of this in the build.properties<br>
<blockquote>bin.includes = .,\<br>
               model/,\<br>
</blockquote>
<blockquote cite="mid:hntccd$8db$1@build.eclipse.org" type="cite">...............
<br>
<br>
<br>
followed by
<br>
<br>
java.io.IOException: PUT failed with HTTP response code 405
<br>
    at
org.eclipse.emf.ecore.resource.impl.URIHandlerImpl$1.close(U nknown
Source)
<br>
    at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfC hangedWithMemoryBuffer(Unknown
Source)
<br>
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Unknow n
Source)
<br>
    at
org.eclipse.emf.importer.ModelImporter.saveGenModelAndEPacka ges(Unknown
Source)
<br>
    at
org.eclipse.emf.importer.ui.contribution.base.ModelImporterW izard.doPerformFinish(Unknown
Source)
<br>
.......................
<br>
<br>
The (few) resources I have found on the web told me to use the
"Development time version"... but I can't!
<br>
<br>
Please notice that "AbstractModel" depends on the UML2 model (in
"Development time version") and no problem occured when genmodel has
been generated.
<br>
<br>
Do you where I'm wrong?
<br>
</blockquote>
Sounds like an issue with registration in the plugin.xml...<br>
<blockquote cite="mid:hntccd$8db$1@build.eclipse.org" type="cite">How
can I do to depend on my "AbstractModel" in"Development time version"?
<br>
<br>
Thanks in advance for you replies...
<br>
<br>
Nico
<br>
</blockquote>
</body>
</html>

--------------010502050801020701030203--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF Plugin] Creating a model depending an other model [message #521910 is a reply to message #521694] Fri, 19 March 2010 09:20 Go to previous message
Nicolas  is currently offline Nicolas Friend
Messages: 2
Registered: March 2010
Junior Member
Hello and thanks for your help.

I've located the existing
GenModel that refers to the Ecore I wanted to reuse and now it works fine.

Thanks a lot.

Nicolas
Previous Topic:[CDO] Type for text more than 255
Next Topic:[Compare] How to compare Java Packages
Goto Forum:
  


Current Time: Fri Apr 26 02:31:02 GMT 2024

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

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

Back to the top