|Re: XSD for diagram file [message #1517845 is a reply to message #1517583]
||Fri, 19 December 2014 19:45
|| Nikos Margaritis
Registered: September 2014
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.
- 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
Powered by FUDForum
. Page generated in 0.01459 seconds