Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » XSD for diagram file(XSD for diagram file)
XSD for diagram file [message #1517583] Fri, 19 December 2014 16:00 Go to next message
Klaus Reckefuss is currently offline Klaus ReckefussFriend
Messages: 3
Registered: November 2011
Junior Member
I created an EMF Project from XSD. Than i created a diagram Application as Graphical Editor. Than i found out that the created diagrams are stored in an XML like file. I want to read the diagrams from another application. So i would like to have a XSD File for the diagram files to generate serialization code
Re: XSD for diagram file [message #1517845 is a reply to message #1517583] Fri, 19 December 2014 19:45 Go to previous message
Nikos Margaritis is currently offline Nikos MargaritisFriend
Messages: 65
Registered: September 2014
Member

If you wish to create a new file out of the editor XML that your application will understand (specific structure) then You need to get the file that contains the XML (a good idea would be with the use of an adapter through maven), and once you have its content you can iterate through it by using the DOM and create the XSD or another XML. etc

The Workflow is the following:

  • Add a new menu item through the extension points of the maven project-->plugin.xml for the specific diagram XML file
  • When clicking this menu item trigger through the command handlers (again this takes place inside the plugin.xml) the operation in which will you read the file
  • Possibly in the operation (s.s the dedicated Class) that you will create; in its main method, create a new File of your preference, read the gmf editor file and process it either through DOM or iteratively. Finally, write in the new File the information that you wish after applying the business logic.



Note that, there are several tutorials to get you started.

Requirements

  • Install maven into your eclipse bundle
  • Possibly install tycho (based on how you will implement it)
  • Create a new maven project
  • Get started there in the plugin.xml by trying to achieve the workflow that I previously mentioned
  • Add the maven project as a dependency in the Dependencies tab (of plugin.xml) of your xxx.editor.diagram (this project is one of the projects that are created from GMF when you construct your editor)


It will take you some time in order to have results. Please consider studying the following key areas and follow some tutorials before starting.


Key areas to look at: Maven, RCP, (in a maven project) plugin.xml ->extension points, (in a maven project) plugin.xml -> contextcommands, Tycho

===========================================================

Alternatively, instead of trying to tranform the strusture of the editor XML into something that can be understood in the other app, if you wish your app to work directly with the editor file. For this you will only need to read the file that contains this information in the other app and process it either iteratively (node by node) or through DOM.

[Updated on: Fri, 19 December 2014 19:51]

Report message to a moderator

Previous Topic:Using Context Menu/Popup Menu in gmftool model
Next Topic:GMF DiagramUIRenderGlobalActionHandlerProvider could not be activated
Goto Forum:
  


Current Time: Fri Apr 19 01:55:28 GMT 2024

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

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

Back to the top