Advise for the use of Sapphire with present schema file [message #1060124] |
Thu, 23 May 2013 04:05  |
Eclipse User |
|
|
|
Hey,
I'm suppose to build an editor for some a xml file that also has a corresponding schema file. I started with some multi page editor and was looking for some problem on StackOverflow, as I found Sapphire. I had a look on the examples, that basically consist of some Java interfaces (responsible for the model that implies the mapping to the xml files) and some xml files that do the arrangement of the UI elements (I hope, I got this right). I'm impressed and it really seams to speed up UI development!
As the creation of my visual editor would take at least two/three weeks, I would like to try Sapphire on this task. How should I start? I already have a schema file for the xml content. The schema is complicated and consists of a long hierarchy. An example for the xml hierarchy would be A -> B -> C. To make this process more convenient, I would like to hide some of the xml hierarchy, e.g. skip B and let the user provide directly A -> C. Is this possible?
I have read the introduction and also tried the examples. Is there a way I could automate the creation of the interfaces/annotations from my schema files? Or do I have to start from scratch?
Thank you!
Kon
|
|
|
|
Re: Advise for the use of Sapphire with present schema file [message #1060242 is a reply to message #1060124] |
Thu, 23 May 2013 12:24   |
Eclipse User |
|
|
|
Quote:basically consist of some Java interfaces (responsible for the model that implies the mapping to the xml files) and some xml files that do the arrangement of the UI elements (I hope, I got this right).
Yep. You got it right.
Quote:To make this process more convenient, I would like to hide some of the xml hierarchy, e.g. skip B and let the user provide directly A -> C. Is this possible?
Sure. The various XML binding annotations support path notation, so you could for instance say @XmlBinding( path = "Name/First" ) and @XmlBinding( path = "Name/Last" ) in your model if an explicit Name element in your model and UI would not be useful.
Quote:Is there a way I could automate the creation of the interfaces/annotations from my schema files?
Sapphire does not provide a tool for generating a model from an XML schema, since XML schema is a specification of syntax rather than semantics. Automatically generating a model from an XML schema would result in a bloated model that would not produce a good UI. No automation can look at XML Schema and differentiate elements that are relevant to the semantics of the data from those that serve as syntactic sugar.
The quality of the model directly corresponds to the quality of Sapphire UI. I recommend an iterative approach. Add a property at a time to the model and sdef file after you've understood its semantics from XML Schema, docs, relevant experts, etc.
- Konstantin
[Updated on: Thu, 23 May 2013 12:25] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04300 seconds