Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Mapping UI with domain models
Mapping UI with domain models [message #518910] Fri, 05 March 2010 12:20 Go to next message
walnut23  is currently offline walnut23 Friend
Messages: 23
Registered: March 2010
Junior Member
I have 2 domain models let's say Manager and Employee.I have got the ecore model for this and generated the GMF .I could create these models at runtime choosing from the palette.

My requirement here is ,
At runtime i need to select a particular domain model and the XML (domain instance)for that should be generated.

Eg. When i click on the Manager domain at runtime i need to get the XML (containing the Manager instance) .When i click both manager and employee then i need to get the XML genertaed for both instances including the relationships that is defined between Manager and Employee.

Could any body suggest a solution/approch for this please?

Thanks in advance!

[Updated on: Fri, 05 March 2010 12:20]

Report message to a moderator

Re: Mapping UI with domain models [message #518950 is a reply to message #518910] Fri, 05 March 2010 09:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
I'm not sure what you mean by "get the XML". You model instance at
runtime will contain all the data you need. They're serialized to and
from XML.

walnut23 wrote:
> I have 2 domain models let's say Manager and Employee.I have got the
> ecore model for this and generated the GMF .I could create these
> models at runtime choosing from the palette.
> My requirement here is , At runtime i need to select a particular
> domain model and the XML (domain instance)for that should be generated.
>
> Eg. When i click on the Manager domain at runtime i need to get the
> XML (containing the Manager instance) .When i click both manager and
> employee then i need to get the XML genertaed for both instances
> including the relationships that is defined between Manager and Employee.
>
> Could any body suggest a solution/approch for this please?
>
> Thanks in advance!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Mapping UI with domain models [message #518965 is a reply to message #518950] Fri, 05 March 2010 15:15 Go to previous messageGo to next message
walnut23  is currently offline walnut23 Friend
Messages: 23
Registered: March 2010
Junior Member
You are right. I mean to say that after entering the values for each of the instances , suppose that i want only the Manager instance (then i would click on that ) and have the XML extracted for Manager instance alone and sent to the downstream systems conforming to another XML Schema.

Thanks!

[Updated on: Fri, 05 March 2010 15:16]

Report message to a moderator

Re: Mapping UI with domain models [message #518977 is a reply to message #518965] Fri, 05 March 2010 15:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000003020200050006020304
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Often a snippet of XML won't conform to a schema because it won't
correspond to a root element declaration. This XMLResource save option
will be useful:

/**
* Write only the subtree starting at the specified list of EObjects,
* which must be objects contained by the resource.
*/
String OPTION_ROOT_OBJECTS = "ROOT_OBJECTS";



walnut23 wrote:
> You are right. I mean to say that after entering the values for each
> of the instances , suppose that i want only the Manager instance (then
> i would click on that ) and have the XML extracted for Manager
> instance alone and sent to the downstream systems conforming to
> another XML Schema.

--------------000003020200050006020304
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">
Often a snippet of XML won't conform to a schema because it won't
correspond to a root element declaration.  This XMLResource save option
will be useful:<small><br>
</small>
<blockquote><small>  /**</small><br>
<small>   * Write only the subtree starting at the specified list of
EObjects, </small><br>
<small>   * which must be objects contained by the resource.</small><br>
<small>   */</small><br>
<small>  String OPTION_ROOT_OBJECTS = "ROOT_OBJECTS";</small><br>
</blockquote>
<br>
<br>
walnut23 wrote:
<blockquote cite="mid:hmr778$amn$1@build.eclipse.org" type="cite">You
are right. I mean to say that after entering the values for each of the
instances , suppose that i want only the Manager instance (then i would
click on that ) and have the XML extracted for Manager instance alone
and sent to the downstream systems conforming to another XML Schema.
<br>
</blockquote>
</body>
</html>

--------------000003020200050006020304--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Mapping UI with domain models [message #519311 is a reply to message #518977] Mon, 08 March 2010 13:23 Go to previous message
walnut23  is currently offline walnut23 Friend
Messages: 23
Registered: March 2010
Junior Member
Thankyou very much for pointing out the right approach.

I have auto generated the ResourceFactoryImplementation.java and ResourceImpl.java files .

I am using the following code snippet to serialize the model instance.

ProductOfferingVersion productOfferingVersion = theUkbsstoolFactory.eInstance.createProductOfferingVersion() ;
ResourceSet resourceSet = new ResourceSetImpl();
URI fileURI =
URI.createURI("./ukbss.xml");
Resource resource = resourceSet.getResource(fileURI, true);
resource.getContents.add(productOfferingVersison);
resource.save(null);

My question here is , where should i place this piece of code so that my instances get saved ?

Thanks!
Previous Topic:Unexpected behaviour with audit rules.
Next Topic:keep connections consistent
Goto Forum:
  


Current Time: Fri Apr 26 19:34:54 GMT 2024

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

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

Back to the top