Home » Modeling » GMF (Graphical Modeling Framework) » GMF Modelling Beginner question
GMF Modelling Beginner question [message #55786] |
Tue, 26 September 2006 09:06  |
Eclipse User |
|
|
|
Originally posted by: achitre.megawareinc.com
Hi,
I have just started looking at GMF and have succesfully copleted the
Mindmap tutorial. Now I am trying to create my own model by defining a
simple schema. The schema has a top level element PurchaseOrder which
contains a collection of Item elements, as shown below.
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://www.poexample.com/gmf/poexample"
elementFormDefault="qualified"
xmlns:po="http://www.poexample.com/gmf/poexample"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<xs:element name="purchaseorder" type="po:PurchaseOrder"/>
<xs:complexType name="PurchaseOrder">
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="items"
type="po:Item" minOccurs="1" maxOccurs="unbounded"
ecore:reference="po:Item"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string" />
<xs:attribute name="shippingAddress" type="xs:string" />
<xs:attribute name="billingAddress" type="xs:string" />
</xs:complexType>
<xs:complexType name="Item" ecore:reference="po:PurchaseOrder">
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="id" type="xs:string" />
<xs:attribute name="quantity" type="xs:string" />
<xs:attribute name="price" type="xs:float" />
</xs:complexType>
</xs:schema>
I created a new EMF Model from the XSD, then generate the model code and the
Edit Code. After that when I create .gmfgraph, in the Graphical Definition
dialog I can only see DocumentRoot, Item, and PurchaseOrder. There are no
attributes under Item. Continuing further when I generate the diagram code I
get the following error.
The method setnull(DocumentRoot) is undefined for the type DocumentRoot.
Thanks & Regards,
Aniruddh
|
|
| |
Re: GMF Modelling Beginner question [message #56269 is a reply to message #56029] |
Wed, 27 September 2006 08:58   |
Eclipse User |
|
|
|
Originally posted by: achitre.megawareinc.com
Hi,
I have modified the schema as follows.
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://www.poexample.com/gmf/poexample"
elementFormDefault="qualified"
xmlns:po="http://www.poexample.com/gmf/poexample"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<xsd:element name="purchaseorder" type="po:Orders" />
<xsd:complexType name="Orders">
<xsd:sequence>
<xsd:element name="purchaseorders" type="po:PurchaseOrder"
maxOccurs="unbounded" minOccurs="0">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="PurchaseOrder">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element name="items" type="po:Item" minOccurs="1"
maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="shippingAddress" type="xsd:string" />
<xsd:attribute name="billingAddress" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="Item">
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="quantity" type="xsd:string" />
<xsd:attribute name="price" type="xsd:float" />
</xsd:complexType>
</xsd:schema>
When I generate the gmfgraph and select Orders as the Diagram Element it
does not show any links. A screen shot of the Graphical Definiton dialog is
attached.
Regards,
Aniruddh
"Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
news:efbooj$h6h$1@utils.eclipse.org...
> You need either choose PurchaseOrder as a top item or introduce another
> container, e.g. Orders. DocumentRoot can't be used as an element of domain
> model
>
> Artem
>
> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
> news:efb8kc$epd$1@utils.eclipse.org...
>> Hi,
>> I have just started looking at GMF and have succesfully copleted the
>> Mindmap tutorial. Now I am trying to create my own model by defining a
>> simple schema. The schema has a top level element PurchaseOrder which
>> contains a collection of Item elements, as shown below.
>>
>> <?xml version="1.0" encoding="utf-8" ?>
>> <xs:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>> elementFormDefault="qualified"
>> xmlns:po="http://www.poexample.com/gmf/poexample"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>
>> <xs:element name="purchaseorder" type="po:PurchaseOrder"/>
>>
>> <xs:complexType name="PurchaseOrder">
>> <xs:sequence minOccurs="1" maxOccurs="1">
>> <xs:element name="items"
>> type="po:Item" minOccurs="1" maxOccurs="unbounded"
>> ecore:reference="po:Item"/>
>> </xs:sequence>
>> <xs:attribute name="id" type="xs:string" />
>> <xs:attribute name="shippingAddress" type="xs:string" />
>> <xs:attribute name="billingAddress" type="xs:string" />
>> </xs:complexType>
>>
>> <xs:complexType name="Item" ecore:reference="po:PurchaseOrder">
>> <xs:attribute name="name" type="xs:string" />
>> <xs:attribute name="id" type="xs:string" />
>> <xs:attribute name="quantity" type="xs:string" />
>> <xs:attribute name="price" type="xs:float" />
>> </xs:complexType>
>> </xs:schema>
>>
>> I created a new EMF Model from the XSD, then generate the model code and
>> the Edit Code. After that when I create .gmfgraph, in the Graphical
>> Definition dialog I can only see DocumentRoot, Item, and PurchaseOrder.
>> There are no attributes under Item. Continuing further when I generate
>> the
>> diagram code I get the following error.
>> The method setnull(DocumentRoot) is undefined for the type DocumentRoot.
>>
>> Thanks & Regards,
>> Aniruddh
>>
>>
>>
>>
>
>
|
|
|
Re: GMF Modelling Beginner question [message #56426 is a reply to message #56269] |
Wed, 27 September 2006 12:49   |
Eclipse User |
|
|
|
Originally posted by: 5d5.mail.ru
References were not recognized as links since they are containments; I
could suggest to use GMF 2.0 or simply add link figures and tools by
hand (I mean using editors generated by EMF).
Aniuddh Chitre wrote:
> Hi,
> I have modified the schema as follows.
> <?xml version="1.0" encoding="utf-8" ?>
> <xsd:schema targetNamespace="http://www.poexample.com/gmf/poexample"
> elementFormDefault="qualified"
> xmlns:po="http://www.poexample.com/gmf/poexample"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>
> <xsd:element name="purchaseorder" type="po:Orders" />
>
> <xsd:complexType name="Orders">
> <xsd:sequence>
> <xsd:element name="purchaseorders" type="po:PurchaseOrder"
> maxOccurs="unbounded" minOccurs="0">
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:complexType name="PurchaseOrder">
> <xsd:sequence minOccurs="1" maxOccurs="1">
> <xsd:element name="items" type="po:Item" minOccurs="1"
> maxOccurs="unbounded" />
> </xsd:sequence>
> <xsd:attribute name="id" type="xsd:string" />
> <xsd:attribute name="shippingAddress" type="xsd:string" />
> <xsd:attribute name="billingAddress" type="xsd:string" />
> </xsd:complexType>
>
> <xsd:complexType name="Item">
> <xsd:attribute name="name" type="xsd:string" />
> <xsd:attribute name="id" type="xsd:string" />
> <xsd:attribute name="quantity" type="xsd:string" />
> <xsd:attribute name="price" type="xsd:float" />
> </xsd:complexType>
> </xsd:schema>
>
> When I generate the gmfgraph and select Orders as the Diagram Element it
> does not show any links. A screen shot of the Graphical Definiton dialog is
> attached.
>
> Regards,
> Aniruddh
>
>
> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
> news:efbooj$h6h$1@utils.eclipse.org...
>> You need either choose PurchaseOrder as a top item or introduce another
>> container, e.g. Orders. DocumentRoot can't be used as an element of domain
>> model
>>
>> Artem
>>
>> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
>> news:efb8kc$epd$1@utils.eclipse.org...
>>> Hi,
>>> I have just started looking at GMF and have succesfully copleted the
>>> Mindmap tutorial. Now I am trying to create my own model by defining a
>>> simple schema. The schema has a top level element PurchaseOrder which
>>> contains a collection of Item elements, as shown below.
>>>
>>> <?xml version="1.0" encoding="utf-8" ?>
>>> <xs:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>> elementFormDefault="qualified"
>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>
>>> <xs:element name="purchaseorder" type="po:PurchaseOrder"/>
>>>
>>> <xs:complexType name="PurchaseOrder">
>>> <xs:sequence minOccurs="1" maxOccurs="1">
>>> <xs:element name="items"
>>> type="po:Item" minOccurs="1" maxOccurs="unbounded"
>>> ecore:reference="po:Item"/>
>>> </xs:sequence>
>>> <xs:attribute name="id" type="xs:string" />
>>> <xs:attribute name="shippingAddress" type="xs:string" />
>>> <xs:attribute name="billingAddress" type="xs:string" />
>>> </xs:complexType>
>>>
>>> <xs:complexType name="Item" ecore:reference="po:PurchaseOrder">
>>> <xs:attribute name="name" type="xs:string" />
>>> <xs:attribute name="id" type="xs:string" />
>>> <xs:attribute name="quantity" type="xs:string" />
>>> <xs:attribute name="price" type="xs:float" />
>>> </xs:complexType>
>>> </xs:schema>
>>>
>>> I created a new EMF Model from the XSD, then generate the model code and
>>> the Edit Code. After that when I create .gmfgraph, in the Graphical
>>> Definition dialog I can only see DocumentRoot, Item, and PurchaseOrder.
>>> There are no attributes under Item. Continuing further when I generate
>>> the
>>> diagram code I get the following error.
>>> The method setnull(DocumentRoot) is undefined for the type DocumentRoot.
>>>
>>> Thanks & Regards,
>>> Aniruddh
>>>
>>>
>>>
>>>
>>
>
>
|
|
|
Re: GMF Modelling Beginner question [message #57478 is a reply to message #56426] |
Fri, 29 September 2006 07:47   |
Eclipse User |
|
|
|
Originally posted by: achitre.megawareinc.com
Hi,
I added a Ployline Connection, a Connection, and a Compartment in the
..gmfgraph. Now when I create the generator model it gives me an error saying
that the targetmetafeature has not been set. I saw a a similar problem
reported in this group. In my gmfmaps link mapping the Target Feature is
empty. What should it be set to? In the mindmap example the Target Feature
shows EReference's in the model. In my case its only showing the attributes.
A screen shot is attached. Can someone tell me the significance of this
property and how to make sure that it has the proper value.
Thanks & Regards,
Aniruddh
"Dmitry Stadnik" <5d5@mail.ru> wrote in message
news:efea35$jr9$1@utils.eclipse.org...
> References were not recognized as links since they are containments; I
> could suggest to use GMF 2.0 or simply add link figures and tools by
> hand (I mean using editors generated by EMF).
>
> Aniuddh Chitre wrote:
>> Hi,
>> I have modified the schema as follows.
>> <?xml version="1.0" encoding="utf-8" ?>
>> <xsd:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>> elementFormDefault="qualified"
>> xmlns:po="http://www.poexample.com/gmf/poexample"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>
>> <xsd:element name="purchaseorder" type="po:Orders" />
>>
>> <xsd:complexType name="Orders">
>> <xsd:sequence>
>> <xsd:element name="purchaseorders" type="po:PurchaseOrder"
>> maxOccurs="unbounded" minOccurs="0">
>> </xsd:element>
>> </xsd:sequence>
>> </xsd:complexType>
>>
>> <xsd:complexType name="PurchaseOrder">
>> <xsd:sequence minOccurs="1" maxOccurs="1">
>> <xsd:element name="items" type="po:Item" minOccurs="1"
>> maxOccurs="unbounded" />
>> </xsd:sequence>
>> <xsd:attribute name="id" type="xsd:string" />
>> <xsd:attribute name="shippingAddress" type="xsd:string" />
>> <xsd:attribute name="billingAddress" type="xsd:string" />
>> </xsd:complexType>
>>
>> <xsd:complexType name="Item">
>> <xsd:attribute name="name" type="xsd:string" />
>> <xsd:attribute name="id" type="xsd:string" />
>> <xsd:attribute name="quantity" type="xsd:string" />
>> <xsd:attribute name="price" type="xsd:float" />
>> </xsd:complexType>
>> </xsd:schema>
>>
>> When I generate the gmfgraph and select Orders as the Diagram Element it
>> does not show any links. A screen shot of the Graphical Definiton dialog
>> is
>> attached.
>>
>> Regards,
>> Aniruddh
>>
>>
>> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
>> news:efbooj$h6h$1@utils.eclipse.org...
>>> You need either choose PurchaseOrder as a top item or introduce another
>>> container, e.g. Orders. DocumentRoot can't be used as an element of
>>> domain
>>> model
>>>
>>> Artem
>>>
>>> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
>>> news:efb8kc$epd$1@utils.eclipse.org...
>>>> Hi,
>>>> I have just started looking at GMF and have succesfully copleted the
>>>> Mindmap tutorial. Now I am trying to create my own model by defining a
>>>> simple schema. The schema has a top level element PurchaseOrder which
>>>> contains a collection of Item elements, as shown below.
>>>>
>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>> <xs:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>>> elementFormDefault="qualified"
>>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>>
>>>> <xs:element name="purchaseorder" type="po:PurchaseOrder"/>
>>>>
>>>> <xs:complexType name="PurchaseOrder">
>>>> <xs:sequence minOccurs="1" maxOccurs="1">
>>>> <xs:element name="items"
>>>> type="po:Item" minOccurs="1" maxOccurs="unbounded"
>>>> ecore:reference="po:Item"/>
>>>> </xs:sequence>
>>>> <xs:attribute name="id" type="xs:string" />
>>>> <xs:attribute name="shippingAddress" type="xs:string" />
>>>> <xs:attribute name="billingAddress" type="xs:string" />
>>>> </xs:complexType>
>>>>
>>>> <xs:complexType name="Item" ecore:reference="po:PurchaseOrder">
>>>> <xs:attribute name="name" type="xs:string" />
>>>> <xs:attribute name="id" type="xs:string" />
>>>> <xs:attribute name="quantity" type="xs:string" />
>>>> <xs:attribute name="price" type="xs:float" />
>>>> </xs:complexType>
>>>> </xs:schema>
>>>>
>>>> I created a new EMF Model from the XSD, then generate the model code
>>>> and
>>>> the Edit Code. After that when I create .gmfgraph, in the Graphical
>>>> Definition dialog I can only see DocumentRoot, Item, and PurchaseOrder.
>>>> There are no attributes under Item. Continuing further when I generate
>>>> the
>>>> diagram code I get the following error.
>>>> The method setnull(DocumentRoot) is undefined for the type
>>>> DocumentRoot.
>>>>
>>>> Thanks & Regards,
>>>> Aniruddh
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
|
|
|
Re: GMF Modelling Beginner question [message #57581 is a reply to message #57478] |
Fri, 29 September 2006 09:00   |
Eclipse User |
|
|
|
Your screenshot shows you are trying to use Item as a link (often referred
to "link as class"). What you need to do is to have another top level node
mapping for item, and for the link mapping, leave containment and element
fields blank and put 'items' reference as target metafeature.
Artem
"Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
news:efj14p$g6h$1@utils.eclipse.org...
> Hi,
> I added a Ployline Connection, a Connection, and a Compartment in the
> .gmfgraph. Now when I create the generator model it gives me an error
> saying that the targetmetafeature has not been set. I saw a a similar
> problem reported in this group. In my gmfmaps link mapping the Target
> Feature is empty. What should it be set to? In the mindmap example the
> Target Feature shows EReference's in the model. In my case its only
> showing the attributes. A screen shot is attached. Can someone tell me the
> significance of this property and how to make sure that it has the proper
> value.
>
> Thanks & Regards,
> Aniruddh
>
>
> "Dmitry Stadnik" <5d5@mail.ru> wrote in message
> news:efea35$jr9$1@utils.eclipse.org...
>> References were not recognized as links since they are containments; I
>> could suggest to use GMF 2.0 or simply add link figures and tools by
>> hand (I mean using editors generated by EMF).
>>
>> Aniuddh Chitre wrote:
>>> Hi,
>>> I have modified the schema as follows.
>>> <?xml version="1.0" encoding="utf-8" ?>
>>> <xsd:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>> elementFormDefault="qualified"
>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>
>>> <xsd:element name="purchaseorder" type="po:Orders" />
>>>
>>> <xsd:complexType name="Orders">
>>> <xsd:sequence>
>>> <xsd:element name="purchaseorders" type="po:PurchaseOrder"
>>> maxOccurs="unbounded" minOccurs="0">
>>> </xsd:element>
>>> </xsd:sequence>
>>> </xsd:complexType>
>>>
>>> <xsd:complexType name="PurchaseOrder">
>>> <xsd:sequence minOccurs="1" maxOccurs="1">
>>> <xsd:element name="items" type="po:Item" minOccurs="1"
>>> maxOccurs="unbounded" />
>>> </xsd:sequence>
>>> <xsd:attribute name="id" type="xsd:string" />
>>> <xsd:attribute name="shippingAddress" type="xsd:string" />
>>> <xsd:attribute name="billingAddress" type="xsd:string" />
>>> </xsd:complexType>
>>>
>>> <xsd:complexType name="Item">
>>> <xsd:attribute name="name" type="xsd:string" />
>>> <xsd:attribute name="id" type="xsd:string" />
>>> <xsd:attribute name="quantity" type="xsd:string" />
>>> <xsd:attribute name="price" type="xsd:float" />
>>> </xsd:complexType>
>>> </xsd:schema>
>>>
>>> When I generate the gmfgraph and select Orders as the Diagram Element it
>>> does not show any links. A screen shot of the Graphical Definiton dialog
>>> is
>>> attached.
>>>
>>> Regards,
>>> Aniruddh
>>>
>>>
>>> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
>>> news:efbooj$h6h$1@utils.eclipse.org...
>>>> You need either choose PurchaseOrder as a top item or introduce another
>>>> container, e.g. Orders. DocumentRoot can't be used as an element of
>>>> domain
>>>> model
>>>>
>>>> Artem
>>>>
>>>> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
>>>> news:efb8kc$epd$1@utils.eclipse.org...
>>>>> Hi,
>>>>> I have just started looking at GMF and have succesfully copleted the
>>>>> Mindmap tutorial. Now I am trying to create my own model by defining a
>>>>> simple schema. The schema has a top level element PurchaseOrder which
>>>>> contains a collection of Item elements, as shown below.
>>>>>
>>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>>> <xs:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>>>> elementFormDefault="qualified"
>>>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>>>
>>>>> <xs:element name="purchaseorder" type="po:PurchaseOrder"/>
>>>>>
>>>>> <xs:complexType name="PurchaseOrder">
>>>>> <xs:sequence minOccurs="1" maxOccurs="1">
>>>>> <xs:element name="items"
>>>>> type="po:Item" minOccurs="1" maxOccurs="unbounded"
>>>>> ecore:reference="po:Item"/>
>>>>> </xs:sequence>
>>>>> <xs:attribute name="id" type="xs:string" />
>>>>> <xs:attribute name="shippingAddress" type="xs:string" />
>>>>> <xs:attribute name="billingAddress" type="xs:string" />
>>>>> </xs:complexType>
>>>>>
>>>>> <xs:complexType name="Item" ecore:reference="po:PurchaseOrder">
>>>>> <xs:attribute name="name" type="xs:string" />
>>>>> <xs:attribute name="id" type="xs:string" />
>>>>> <xs:attribute name="quantity" type="xs:string" />
>>>>> <xs:attribute name="price" type="xs:float" />
>>>>> </xs:complexType>
>>>>> </xs:schema>
>>>>>
>>>>> I created a new EMF Model from the XSD, then generate the model code
>>>>> and
>>>>> the Edit Code. After that when I create .gmfgraph, in the Graphical
>>>>> Definition dialog I can only see DocumentRoot, Item, and
>>>>> PurchaseOrder.
>>>>> There are no attributes under Item. Continuing further when I generate
>>>>> the
>>>>> diagram code I get the following error.
>>>>> The method setnull(DocumentRoot) is undefined for the type
>>>>> DocumentRoot.
>>>>>
>>>>> Thanks & Regards,
>>>>> Aniruddh
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>
>
>
|
|
|
Re: GMF Modelling Beginner question [message #58635 is a reply to message #57581] |
Tue, 03 October 2006 07:47   |
Eclipse User |
|
|
|
Originally posted by: achitre.megawareinc.com
Hi,
I am not sure how to have a top level node mapping for item. Do I need to
do this in the ecore model or in the gmfgraph.
Thanks & Regards,
Aniruddh
"Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
news:efj57b$7p8$1@utils.eclipse.org...
> Your screenshot shows you are trying to use Item as a link (often referred
> to "link as class"). What you need to do is to have another top level node
> mapping for item, and for the link mapping, leave containment and element
> fields blank and put 'items' reference as target metafeature.
>
> Artem
>
> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
> news:efj14p$g6h$1@utils.eclipse.org...
>> Hi,
>> I added a Ployline Connection, a Connection, and a Compartment in the
>> .gmfgraph. Now when I create the generator model it gives me an error
>> saying that the targetmetafeature has not been set. I saw a a similar
>> problem reported in this group. In my gmfmaps link mapping the Target
>> Feature is empty. What should it be set to? In the mindmap example the
>> Target Feature shows EReference's in the model. In my case its only
>> showing the attributes. A screen shot is attached. Can someone tell me
>> the significance of this property and how to make sure that it has the
>> proper value.
>>
>> Thanks & Regards,
>> Aniruddh
>>
>>
>> "Dmitry Stadnik" <5d5@mail.ru> wrote in message
>> news:efea35$jr9$1@utils.eclipse.org...
>>> References were not recognized as links since they are containments; I
>>> could suggest to use GMF 2.0 or simply add link figures and tools by
>>> hand (I mean using editors generated by EMF).
>>>
>>> Aniuddh Chitre wrote:
>>>> Hi,
>>>> I have modified the schema as follows.
>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>> <xsd:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>>> elementFormDefault="qualified"
>>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>>
>>>> <xsd:element name="purchaseorder" type="po:Orders" />
>>>>
>>>> <xsd:complexType name="Orders">
>>>> <xsd:sequence>
>>>> <xsd:element name="purchaseorders" type="po:PurchaseOrder"
>>>> maxOccurs="unbounded" minOccurs="0">
>>>> </xsd:element>
>>>> </xsd:sequence>
>>>> </xsd:complexType>
>>>>
>>>> <xsd:complexType name="PurchaseOrder">
>>>> <xsd:sequence minOccurs="1" maxOccurs="1">
>>>> <xsd:element name="items" type="po:Item" minOccurs="1"
>>>> maxOccurs="unbounded" />
>>>> </xsd:sequence>
>>>> <xsd:attribute name="id" type="xsd:string" />
>>>> <xsd:attribute name="shippingAddress" type="xsd:string" />
>>>> <xsd:attribute name="billingAddress" type="xsd:string" />
>>>> </xsd:complexType>
>>>>
>>>> <xsd:complexType name="Item">
>>>> <xsd:attribute name="name" type="xsd:string" />
>>>> <xsd:attribute name="id" type="xsd:string" />
>>>> <xsd:attribute name="quantity" type="xsd:string" />
>>>> <xsd:attribute name="price" type="xsd:float" />
>>>> </xsd:complexType>
>>>> </xsd:schema>
>>>>
>>>> When I generate the gmfgraph and select Orders as the Diagram Element
>>>> it
>>>> does not show any links. A screen shot of the Graphical Definiton
>>>> dialog is
>>>> attached.
>>>>
>>>> Regards,
>>>> Aniruddh
>>>>
>>>>
>>>> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
>>>> news:efbooj$h6h$1@utils.eclipse.org...
>>>>> You need either choose PurchaseOrder as a top item or introduce
>>>>> another
>>>>> container, e.g. Orders. DocumentRoot can't be used as an element of
>>>>> domain
>>>>> model
>>>>>
>>>>> Artem
>>>>>
>>>>> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
>>>>> news:efb8kc$epd$1@utils.eclipse.org...
>>>>>> Hi,
>>>>>> I have just started looking at GMF and have succesfully copleted
>>>>>> the
>>>>>> Mindmap tutorial. Now I am trying to create my own model by defining
>>>>>> a
>>>>>> simple schema. The schema has a top level element PurchaseOrder which
>>>>>> contains a collection of Item elements, as shown below.
>>>>>>
>>>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>>>> <xs:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>>>>> elementFormDefault="qualified"
>>>>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>>>>
>>>>>> <xs:element name="purchaseorder" type="po:PurchaseOrder"/>
>>>>>>
>>>>>> <xs:complexType name="PurchaseOrder">
>>>>>> <xs:sequence minOccurs="1" maxOccurs="1">
>>>>>> <xs:element name="items"
>>>>>> type="po:Item" minOccurs="1" maxOccurs="unbounded"
>>>>>> ecore:reference="po:Item"/>
>>>>>> </xs:sequence>
>>>>>> <xs:attribute name="id" type="xs:string" />
>>>>>> <xs:attribute name="shippingAddress" type="xs:string" />
>>>>>> <xs:attribute name="billingAddress" type="xs:string" />
>>>>>> </xs:complexType>
>>>>>>
>>>>>> <xs:complexType name="Item" ecore:reference="po:PurchaseOrder">
>>>>>> <xs:attribute name="name" type="xs:string" />
>>>>>> <xs:attribute name="id" type="xs:string" />
>>>>>> <xs:attribute name="quantity" type="xs:string" />
>>>>>> <xs:attribute name="price" type="xs:float" />
>>>>>> </xs:complexType>
>>>>>> </xs:schema>
>>>>>>
>>>>>> I created a new EMF Model from the XSD, then generate the model code
>>>>>> and
>>>>>> the Edit Code. After that when I create .gmfgraph, in the Graphical
>>>>>> Definition dialog I can only see DocumentRoot, Item, and
>>>>>> PurchaseOrder.
>>>>>> There are no attributes under Item. Continuing further when I
>>>>>> generate
>>>>>> the
>>>>>> diagram code I get the following error.
>>>>>> The method setnull(DocumentRoot) is undefined for the type
>>>>>> DocumentRoot.
>>>>>>
>>>>>> Thanks & Regards,
>>>>>> Aniruddh
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>
>>
>>
>
>
|
|
|
Re: GMF Modelling Beginner question [message #59469 is a reply to message #58635] |
Thu, 05 October 2006 08:14  |
Eclipse User |
|
|
|
You've got top level node for the 'PurchaseOrder', and I suggested to have
similar one for 'Item' domain element. We are talking about changes to
..gmfmap file, which is the model that actually describes what's link and
what's node in your domain.
Artem
"Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
news:eftijp$7aq$1@utils.eclipse.org...
> Hi,
> I am not sure how to have a top level node mapping for item. Do I need
> to do this in the ecore model or in the gmfgraph.
>
> Thanks & Regards,
> Aniruddh
>
> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
> news:efj57b$7p8$1@utils.eclipse.org...
>> Your screenshot shows you are trying to use Item as a link (often
>> referred to "link as class"). What you need to do is to have another top
>> level node mapping for item, and for the link mapping, leave containment
>> and element fields blank and put 'items' reference as target metafeature.
>>
>> Artem
>>
>> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
>> news:efj14p$g6h$1@utils.eclipse.org...
>>> Hi,
>>> I added a Ployline Connection, a Connection, and a Compartment in the
>>> .gmfgraph. Now when I create the generator model it gives me an error
>>> saying that the targetmetafeature has not been set. I saw a a similar
>>> problem reported in this group. In my gmfmaps link mapping the Target
>>> Feature is empty. What should it be set to? In the mindmap example the
>>> Target Feature shows EReference's in the model. In my case its only
>>> showing the attributes. A screen shot is attached. Can someone tell me
>>> the significance of this property and how to make sure that it has the
>>> proper value.
>>>
>>> Thanks & Regards,
>>> Aniruddh
>>>
>>>
>>> "Dmitry Stadnik" <5d5@mail.ru> wrote in message
>>> news:efea35$jr9$1@utils.eclipse.org...
>>>> References were not recognized as links since they are containments; I
>>>> could suggest to use GMF 2.0 or simply add link figures and tools by
>>>> hand (I mean using editors generated by EMF).
>>>>
>>>> Aniuddh Chitre wrote:
>>>>> Hi,
>>>>> I have modified the schema as follows.
>>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>>> <xsd:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>>>> elementFormDefault="qualified"
>>>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>>>
>>>>> <xsd:element name="purchaseorder" type="po:Orders" />
>>>>>
>>>>> <xsd:complexType name="Orders">
>>>>> <xsd:sequence>
>>>>> <xsd:element name="purchaseorders" type="po:PurchaseOrder"
>>>>> maxOccurs="unbounded" minOccurs="0">
>>>>> </xsd:element>
>>>>> </xsd:sequence>
>>>>> </xsd:complexType>
>>>>>
>>>>> <xsd:complexType name="PurchaseOrder">
>>>>> <xsd:sequence minOccurs="1" maxOccurs="1">
>>>>> <xsd:element name="items" type="po:Item" minOccurs="1"
>>>>> maxOccurs="unbounded" />
>>>>> </xsd:sequence>
>>>>> <xsd:attribute name="id" type="xsd:string" />
>>>>> <xsd:attribute name="shippingAddress" type="xsd:string" />
>>>>> <xsd:attribute name="billingAddress" type="xsd:string" />
>>>>> </xsd:complexType>
>>>>>
>>>>> <xsd:complexType name="Item">
>>>>> <xsd:attribute name="name" type="xsd:string" />
>>>>> <xsd:attribute name="id" type="xsd:string" />
>>>>> <xsd:attribute name="quantity" type="xsd:string" />
>>>>> <xsd:attribute name="price" type="xsd:float" />
>>>>> </xsd:complexType>
>>>>> </xsd:schema>
>>>>>
>>>>> When I generate the gmfgraph and select Orders as the Diagram Element
>>>>> it
>>>>> does not show any links. A screen shot of the Graphical Definiton
>>>>> dialog is
>>>>> attached.
>>>>>
>>>>> Regards,
>>>>> Aniruddh
>>>>>
>>>>>
>>>>> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
>>>>> news:efbooj$h6h$1@utils.eclipse.org...
>>>>>> You need either choose PurchaseOrder as a top item or introduce
>>>>>> another
>>>>>> container, e.g. Orders. DocumentRoot can't be used as an element of
>>>>>> domain
>>>>>> model
>>>>>>
>>>>>> Artem
>>>>>>
>>>>>> "Aniuddh Chitre" <achitre@megawareinc.com> wrote in message
>>>>>> news:efb8kc$epd$1@utils.eclipse.org...
>>>>>>> Hi,
>>>>>>> I have just started looking at GMF and have succesfully copleted
>>>>>>> the
>>>>>>> Mindmap tutorial. Now I am trying to create my own model by defining
>>>>>>> a
>>>>>>> simple schema. The schema has a top level element PurchaseOrder
>>>>>>> which
>>>>>>> contains a collection of Item elements, as shown below.
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>>>>> <xs:schema targetNamespace="http://www.poexample.com/gmf/poexample"
>>>>>>> elementFormDefault="qualified"
>>>>>>> xmlns:po="http://www.poexample.com/gmf/poexample"
>>>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>>>>>>>
>>>>>>> <xs:element name="purchaseorder" type="po:PurchaseOrder"/>
>>>>>>>
>>>>>>> <xs:complexType name="PurchaseOrder">
>>>>>>> <xs:sequence minOccurs="1" maxOccurs="1">
>>>>>>> <xs:element name="items"
>>>>>>> type="po:Item" minOccurs="1" maxOccurs="unbounded"
>>>>>>> ecore:reference="po:Item"/>
>>>>>>> </xs:sequence>
>>>>>>> <xs:attribute name="id" type="xs:string" />
>>>>>>> <xs:attribute name="shippingAddress" type="xs:string" />
>>>>>>> <xs:attribute name="billingAddress" type="xs:string" />
>>>>>>> </xs:complexType>
>>>>>>>
>>>>>>> <xs:complexType name="Item" ecore:reference="po:PurchaseOrder">
>>>>>>> <xs:attribute name="name" type="xs:string" />
>>>>>>> <xs:attribute name="id" type="xs:string" />
>>>>>>> <xs:attribute name="quantity" type="xs:string" />
>>>>>>> <xs:attribute name="price" type="xs:float" />
>>>>>>> </xs:complexType>
>>>>>>> </xs:schema>
>>>>>>>
>>>>>>> I created a new EMF Model from the XSD, then generate the model code
>>>>>>> and
>>>>>>> the Edit Code. After that when I create .gmfgraph, in the Graphical
>>>>>>> Definition dialog I can only see DocumentRoot, Item, and
>>>>>>> PurchaseOrder.
>>>>>>> There are no attributes under Item. Continuing further when I
>>>>>>> generate
>>>>>>> the
>>>>>>> diagram code I get the following error.
>>>>>>> The method setnull(DocumentRoot) is undefined for the type
>>>>>>> DocumentRoot.
>>>>>>>
>>>>>>> Thanks & Regards,
>>>>>>> Aniruddh
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>
>>
>
>
|
|
|
Goto Forum:
Current Time: Thu Apr 24 01:22:31 EDT 2025
Powered by FUDForum. Page generated in 0.05472 seconds
|