Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Can an attribute refer to two ecore reference objects?
Can an attribute refer to two ecore reference objects? [message #20662] Wed, 16 August 2006 08:03 Go to next message
Eclipse UserFriend
Hi,

How can i design an Ecore model to have an attribute refer to multiple
ecore objects?

For example:

<menu id="main_menu">
<choice next="#menu1"/>
<choice next="#form1"/>
</menu>

<menu id="menu1">
<choice next="#menu3"/>
<choice next="#menu4"/>
</menu>

<form id="form1">
...
...
...
</form>

I would like to represent the values of next attribute as connections in
the editor.

Is there a way to associate two references to the same attribute? What
could be the strategy to approach this problem?

Thanks in Advance
Regards,
-Balraj
Re: Can an attribute refer to two ecore reference objects? [message #20705 is a reply to message #20662] Wed, 16 August 2006 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------080601070401030605080104
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Balraj,

The schema in the EMF Library schema tutorials has references between
Books and Authors. Maybe that answers your question (which I don't
quite understand):
< http://www.eclipse.org/emf/docs.php?doc=tutorials/xlibmod/xl ibmod.html>

http://www.eclipse.org/emf/docs.php?doc=tutorials/xlibmod/xl ibmod.html

The mindmap model as similar examples of cross references.


Balraj Kannan wrote:

>
> Hi,
>
> How can i design an Ecore model to have an attribute refer to
> multiple ecore objects?
>
> For example:
>
> <menu id="main_menu">
> <choice next="#menu1"/>
> <choice next="#form1"/>
> </menu>
>
> <menu id="menu1">
> <choice next="#menu3"/>
> <choice next="#menu4"/>
> </menu>
>
> <form id="form1">
> ...
> ...
> ...
> </form>
>
> I would like to represent the values of next attribute as connections
> in the editor.
>
> Is there a way to associate two references to the same attribute? What
> could be the strategy to approach this problem?
>
> Thanks in Advance
> Regards,
> -Balraj
>


--------------080601070401030605080104
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">
Balraj,<br>
<br>
The schema in the EMF Library schema tutorials has references between
Books and Authors.
Re: Can an attribute refer to two ecore reference objects? [message #21818 is a reply to message #20705] Thu, 17 August 2006 00:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Merks,

Thanks for your reply.
My doubt was slightly different. I have an attribute say next in the
choice element. This can refer to one of the two elements say form or
menu. I am under confusion of how to link one attribute with two
references.

Any suggestions...

Thanks in Advance

Regards
Balraj
Re: Can an attribute refer to two ecore reference objects? [message #22043 is a reply to message #21818] Thu, 17 August 2006 05:15 Go to previous messageGo to next message
Eclipse UserFriend
Hi Balraj,

if form and menu share a common supertype -> no problem.
If not, they at least share EObject as common supertype.

Regards,
Jan

Balraj Kannan schrieb:
>
> Hi Merks,
>
> Thanks for your reply. My doubt was slightly different. I have an
> attribute say next in the choice element. This can refer to one of the
> two elements say form or menu. I am under confusion of how to link one
> attribute with two references.
> Any suggestions...
> Thanks in Advance
>
> Regards
> Balraj
>
Re: Can an attribute refer to two ecore reference objects? [message #22902 is a reply to message #22043] Fri, 18 August 2006 00:31 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

They share EObject as their common supertype. I am facing the problem with
the xsd. I am not sure how to refer to two elements from one attribute.


Below is the sample xsd that I have. Here I have MenuType and FormType
elements. In choice, the attribute next refers to formType element. Now I
want the same element refer to Menuutype also. Is it possible? How can I
do this?

...
...
<xsd:complexType name="formType">
....
....
</xsd:complexType>

<xsd:complexType name="menuType">
....
....
</xsd:complexType>

<xsd:complexType name="choiceType">
<xsd:attribute ecore:reference="formType" name="next">
<xsd:simpleType>
<xsd:list itemType="xsd:anyURI" />
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
...
...

Thanks & Regards
Balraj
Re: Can an attribute refer to two ecore reference objects? [message #23033 is a reply to message #22902] Fri, 18 August 2006 07:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Balraj,

To create an EReference of type EObject use ecore:reference="xsd:anyType".


Balraj Kannan wrote:
> Hi,
>
> They share EObject as their common supertype. I am facing the problem
> with the xsd. I am not sure how to refer to two elements from one
> attribute.
>
>
> Below is the sample xsd that I have. Here I have MenuType and FormType
> elements. In choice, the attribute next refers to formType element.
> Now I want the same element refer to Menuutype also. Is it possible?
> How can I do this?
>
> ...
> ...
> <xsd:complexType name="formType">
> ....
> ....
> </xsd:complexType>
> <xsd:complexType name="menuType">
> ....
> ....
> </xsd:complexType>
> <xsd:complexType name="choiceType">
> <xsd:attribute ecore:reference="formType" name="next">
> <xsd:simpleType>
> <xsd:list itemType="xsd:anyURI" />
> </xsd:simpleType>
> </xsd:attribute>
> </xsd:complexType>
> ...
> ...
>
> Thanks & Regards
> Balraj
>
>
Re: Can an attribute refer to two ecore reference objects? [message #39006 is a reply to message #23033] Tue, 05 September 2006 03:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I tried using ecore:reference="xsd:anyType" as suggested by you. But
when I try to create the link between choice and form elements the link
doesn't get created.


I am trying to view the xml model as follows on the graphical editor.

<vxml>
<menu id="1">
<choice id_ref ="#abc"/>
</menu>
<menu id="2">
</menu>
<form id="abc"/>
</vxml>


In the xsd file I have the choice element as the following:

...
...
<xsd:attribute ecore:reference="xsd:anyType" name="id_ref"
type="xsd:anyURI"/>
...
...

I want the link from choice to be created to form or menu present directly
under the root element which is vxml in my case. Choice is a child element
under the menu tag.

Please suggest... !!!!

Thanks & Regards
Balraj
Re: Can an attribute refer to two ecore reference objects? [message #39380 is a reply to message #39006] Tue, 05 September 2006 08:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Balraj,

This does produce the correct model when I tried it, i.e., an EReference
with eType EObject, so the rest of your questions is a GMF one that I
don't know the answer to.


Balraj Kannan wrote:
>
>
> Hi,
>
> I tried using ecore:reference="xsd:anyType" as suggested by you. But
> when I try to create the link between choice and form elements the
> link doesn't get created.
>
> I am trying to view the xml model as follows on the graphical editor.
>
> <vxml>
> <menu id="1">
> <choice id_ref ="#abc"/>
> </menu>
> <menu id="2">
> </menu>
> <form id="abc"/>
> </vxml>
>
>
> In the xsd file I have the choice element as the following:
>
> ...
> ...
> <xsd:attribute ecore:reference="xsd:anyType" name="id_ref"
> type="xsd:anyURI"/>
> ...
> ...
>
> I want the link from choice to be created to form or menu present
> directly under the root element which is vxml in my case. Choice is a
> child element under the menu tag.
>
> Please suggest... !!!!
>
> Thanks & Regards
> Balraj
>
>
>
>
Re: Can an attribute refer to two ecore reference objects? [message #39503 is a reply to message #39380] Tue, 05 September 2006 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Merk,

When I tried I get the same in the ecore model. But when I try to
create the link in the editor between choice and form element it fails.
for that matter I am unable to create links between any of the elements in
the editor.

What I am wondering is I am trying to create link between choice which is
under menu element and form which is under the root element. will this
cause any issue?


Thanks a lot for your support..

Regards
Balraj
Re: Can an attribute refer to two ecore reference objects? [message #39755 is a reply to message #39503] Tue, 05 September 2006 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Balraj,

If you attach your .ecore and .gmfmap file (stripped down to appropriate
elements, of course), we could try to figure out why link creation fails.

Artem

"Balraj Kannan" <balraj.kannan@hp.com> wrote in message
news:a7d9cfac5e36c664bd573e25c72f34ec$1@www.eclipse.org...
> Merk,
>
> When I tried I get the same in the ecore model. But when I try to create
> the link in the editor between choice and form element it fails. for that
> matter I am unable to create links between any of the elements in the
> editor.
>
> What I am wondering is I am trying to create link between choice which is
> under menu element and form which is under the root element. will this
> cause any issue?
>
>
> Thanks a lot for your support..
>
> Regards
> Balraj
>
Re: Can an attribute refer to two ecore reference objects? [message #40207 is a reply to message #39755] Wed, 06 September 2006 01:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi Artem,

Thanks for your reply, I use the web interface to connect to the news
group. I am behind the firewall and unable to configure the outlook
express to connect to the news group. With web interface there is no
option available to attach any files :(. May I request you to kindly
provide me with your email ID to which I can mail my gmf map and ecore
files.


Thanks in Advance,
Regards,
Balraj
Re: Can an attribute refer to two ecore reference objects? [message #40627 is a reply to message #40207] Wed, 06 September 2006 06:56 Go to previous message
Eclipse UserFriend
I believe your post "Can a link refer to two notational model in GMF?" from
Sep 05 is about the same issue, so feel free to attach the models to the
request tracking the issue,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=156223

Artem

"Balraj Kannan" <balraj.kannan@hp.com> wrote in message
news:de4cca79f1ea80aa7c88764fbc2d48a8$1@www.eclipse.org...
> Hi Artem,
>
> Thanks for your reply, I use the web interface to connect to the news
> group. I am behind the firewall and unable to configure the outlook
> express to connect to the news group. With web interface there is no
> option available to attach any files :(. May I request you to kindly
> provide me with your email ID to which I can mail my gmf map and ecore
> files.
>
>
> Thanks in Advance,
> Regards,
> Balraj
>
Previous Topic:Internal Error while generating *.gmfgen. what does it mean?
Next Topic:Limits of GMF
Goto Forum:
  


Current Time: Sat Jul 05 10:22:44 EDT 2025

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

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

Back to the top