Possible to reference a xml simple type`? [message #431665] |
Tue, 21 July 2009 10:46 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
I'm just wondering if it is possible to import anyhow the xml simple
types. I mean I don't want to create them in my metamodel but rather
want to use them in my generated editor as references. In the ecore
diagram editor I tried to load resources... but I only can load ecore
models in the workspace or filesystem and not in the registry. Is it
possible anyhow?
|
|
|
|
Re: Possible to reference a xml simple type`? [message #431701 is a reply to message #431678] |
Wed, 22 July 2009 10:23 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Ed Merks wrote:
> XMLTypePackage has EDataTypes for the XML Schema built-in simple types...
found it
> Perhaps if you use the Sample Ecore Editor to load it and make your
> first reference to it, after that the diagram editor will let you work
> with it...
Ok so it works. If you add a reference in the sample editor first you
can work with the imported package in the ecore diagram editor as well.
But now I have another problem. In my genmodel the imported package
appears as well - understandable. The generation of the editor worked
fine except an error in one test class. For now I commented the line out
where a not existent method is to be invoked. But in the new eclipse
instance, where I want to work with my editor, I get the following error
when starting the creation wizard:
Plug-in "myplugin.editor" was unable to instantiate class
"myplugin.presentation.ModelWizard".
Could not initialize class myplugin.MyModelPackage
that's caused by the following line in the init method of my package impl:
TypePackageImpl theTypePackage =
(TypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(Typ ePackage.eNS_URI)
instanceof TypePackageImpl ?
EPackage.Registry.INSTANCE.getEPackage(TypePackage.eNS_URI) :
TypePackage.eINSTANCE);
and by the following line in my imported TypePackageImpl:
XMLTypePackage theXMLTypePackage =
(XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTy pePackage.eNS_URI);
What can I do to avoid this?
|
|
|
Re: Possible to reference a xml simple type`? [message #431705 is a reply to message #431701] |
Wed, 22 July 2009 11:24 |
Ed Merks Messages: 33136 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------020309040302040608060207
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Gilbert,
How exactly do those lines cause a problem? The XMLTypePackage does
exist. When you created your GenModel, did you choose the existing
GenModel for XMLTypePackage in the final wizard or create a new
GenPackage for it?
Gilbert Mirenque wrote:
> Ed Merks wrote:
>
>> XMLTypePackage has EDataTypes for the XML Schema built-in simple types...
>>
> found it
>
>
>> Perhaps if you use the Sample Ecore Editor to load it and make your
>> first reference to it, after that the diagram editor will let you work
>> with it...
>>
> Ok so it works. If you add a reference in the sample editor first you
> can work with the imported package in the ecore diagram editor as well.
> But now I have another problem. In my genmodel the imported package
> appears as well - understandable. The generation of the editor worked
> fine except an error in one test class. For now I commented the line out
> where a not existent method is to be invoked. But in the new eclipse
> instance, where I want to work with my editor, I get the following error
> when starting the creation wizard:
>
> Plug-in "myplugin.editor" was unable to instantiate class
> "myplugin.presentation.ModelWizard".
> Could not initialize class myplugin.MyModelPackage
>
> that's caused by the following line in the init method of my package impl:
>
> TypePackageImpl theTypePackage =
> (TypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(Typ ePackage.eNS_URI)
> instanceof TypePackageImpl ?
> EPackage.Registry.INSTANCE.getEPackage(TypePackage.eNS_URI) :
> TypePackage.eINSTANCE);
>
> and by the following line in my imported TypePackageImpl:
> XMLTypePackage theXMLTypePackage =
> (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTy pePackage.eNS_URI);
>
>
> What can I do to avoid this?
>
--------------020309040302040608060207
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">
Gilbert,<br>
<br>
How exactly do those lines cause a problem? The XMLTypePackage does
exist. When you created your GenModel, did you choose the existing
GenModel for XMLTypePackage in the final wizard or create a new
GenPackage for it? <br>
<br>
<br>
Gilbert Mirenque wrote:
<blockquote cite="mid:h46pa9$fpk$1@build.eclipse.org" type="cite">
<pre wrap="">Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">XMLTypePackage has EDataTypes for the XML Schema built-in simple types...
</pre>
</blockquote>
<pre wrap=""><!---->found it
</pre>
<blockquote type="cite">
<pre wrap="">Perhaps if you use the Sample Ecore Editor to load it and make your
first reference to it, after that the diagram editor will let you work
with it...
</pre>
</blockquote>
<pre wrap=""><!---->Ok so it works. If you add a reference in the sample editor first you
can work with the imported package in the ecore diagram editor as well.
But now I have another problem. In my genmodel the imported package
appears as well - understandable. The generation of the editor worked
fine except an error in one test class. For now I commented the line out
where a not existent method is to be invoked. But in the new eclipse
instance, where I want to work with my editor, I get the following error
when starting the creation wizard:
Plug-in "myplugin.editor" was unable to instantiate class
"myplugin.presentation.ModelWizard".
Could not initialize class myplugin.MyModelPackage
that's caused by the following line in the init method of my package impl:
TypePackageImpl theTypePackage =
(TypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(Typ ePackage.eNS_URI)
instanceof TypePackageImpl ?
EPackage.Registry.INSTANCE.getEPackage(TypePackage.eNS_URI) :
TypePackage.eINSTANCE);
and by the following line in my imported TypePackageImpl:
XMLTypePackage theXMLTypePackage =
(XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTy pePackage.eNS_URI);
What can I do to avoid this?
</pre>
</blockquote>
</body>
</html>
--------------020309040302040608060207--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Possible to reference a xml simple type`? [message #431713 is a reply to message #431705] |
Wed, 22 July 2009 14:58 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Ed Merks wrote:
> Gilbert,
>
> How exactly do those lines cause a problem? The XMLTypePackage does
> exist. When you created your GenModel, did you choose the existing
> GenModel for XMLTypePackage in the final wizard or create a new
> GenPackage for it?
In my genmodel appeared a new package for the XMLTypePackage
automatically when adding references to it in my metamodel. How can I
specify to choose an existing genmodel and where do I find it?
|
|
|
|
Re: Possible to reference a xml simple type`? [message #431778 is a reply to message #431743] |
Sat, 25 July 2009 12:47 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Ed Merks wrote:
> Gilbert,
>
> The bottom 1/2 of the wizard should support that. Have a look at how a
> model generated from an XSD looks and try to make it look like that...
>
Ok, it works in that way if you delete the genmodel and generate it
again. But you can't reference the other genmodel if your own genmodel
already exists - or I didn't find it.
But I think my explanation from my first post was a little bit
underinformed (nice word ;) ). I try to explain in other words what I
want to do:
I start from behind. With the generated editor I want to create a model
for my domain. In this domain I need datatypes as well. My idea was that
it would be nice if one can reference existing XML simple datatypes such
as xs:string for example. Or one has the option to create special types
and reference those. That's why I thought that I can create a class
(AbstractDatatype) in my metamodel inheriting from a root class of the
XMLTypes package. I thought there is a class from which all simple xml
types inherit, which I can use as parent class for my AbstractDatatype.
Furthermore my idea was that now I simply can reference the parent class
of all simple XML types in my metamodel. I thought that by that I can
then reference all XML simple types or an own special type (inheriting
from the parent XML simple type). That means I don't want to use the
metaelements from the XMLTypes package and the concrete types in my
generated editor or alternatively some special types. Is it
udnerstandable? And the more important question: is it possible?
best regards,
Gilbert
|
|
|
Re: Possible to reference a xml simple type`? [message #431779 is a reply to message #431778] |
Sat, 25 July 2009 13:00 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
I have another idea. Maybe the following scenario is possible:
in the second Eclipse instance where the generated editor is available:
- create a new XML schema
- create an instance of my metamodel with the generated editor
- in that instance load the created xml schema as resource
- in that instance reference a type contained in the xml schema
Is that possible or is it to freaky?
|
|
|
|
Re: Possible to reference a xml simple type`? [message #431879 is a reply to message #431743] |
Tue, 28 July 2009 15:44 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
I'm interested in how to reference an existing genmodel in my own
existing genmodel? If I load a resource in the ecore file I can add
references to the loaded model. But by that my genmodel won't contain a
reference to the genmodel from which the model was loaded. I have real
packages. How do I do this when my genmodel already exists? How do I
reference a genmodel from the emf registry?
|
|
|
|
Re: Possible to reference a xml simple type`? [message #431895 is a reply to message #431886] |
Tue, 28 July 2009 19:08 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Ed Merks wrote:
> The last page of the wizard should allow you to locate GenModels for any
> packages being loaded.
This is right - but the wizard can only be used when I want to create a
new genmodel. My genmodel exists already so I can't use it :/
|
|
|
Re: Possible to reference a xml simple type`? [message #431897 is a reply to message #431895] |
Tue, 28 July 2009 23:04 |
Ed Merks Messages: 33136 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------010309040502030107050409
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Gilbert,
Reload... uses the same wizard.
Gilbert Mirenque wrote:
> Ed Merks wrote:
>
>> The last page of the wizard should allow you to locate GenModels for any
>> packages being loaded.
>>
> This is right - but the wizard can only be used when I want to create a
> new genmodel. My genmodel exists already so I can't use it :/
>
--------------010309040502030107050409
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!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">
Gilbert,<br>
<br>
Reload... uses the same wizard.<br>
<br>
Gilbert Mirenque wrote:
<blockquote cite="mid:h4nibi$4qd$1@build.eclipse.org" type="cite">
<pre wrap="">Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">The last page of the wizard should allow you to locate GenModels for any
packages being loaded.
</pre>
</blockquote>
<pre wrap=""><!---->This is right - but the wizard can only be used when I want to create a
new genmodel. My genmodel exists already so I can't use it :/
</pre>
</blockquote>
</body>
</html>
--------------010309040502030107050409--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04325 seconds