[x3d-public] JAXB and X3DJSAIL

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Sun Apr 21 21:19:28 PDT 2019


We did a bunch of work with JAXB about a decade ago.

I liked how it created data structures from XML Schema but it had a LOT of options and was difficult to maintain accessor code in those early years.

X3DJSAIL provides everything you might want from a schema-based approach for X3D.  So we don't need it.

Someone might want to do JAXB with X3D Schema at some point.  Caveat: my experience is dated here, not aware of what features it might currently have.

Interestingly (for some Java programmers) all of the Java Enterprise Edition work is being taken over by Eclipse Foundation.

"Java roadmap: Eclipse’s Jakarta EE enterprise Java takes shape" by Paul Krill, 14 May 2018.
The Eclipse Foundation outlines the 39 projects that will make up the new cloud-native, microservices-friendly enterprise Java effort, and how GlassFish will evolve.
https://www.infoworld.com/article/3269210/java-roadmap-eclipses-jakarta-ee-enterprise-java-takes-shape.html

On 4/19/2019 7:12 PM, John Carlson wrote:
> JAXB is moving to Jakarta EE.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Friday, April 19, 2019 9:05 PM
> *To: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *RE: JAXB and X3DJSAIL
> 
> Never mind.  JAXB is slated for removal.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Friday, April 19, 2019 8:46 PM
> *To: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *JAXB and X3DJSAIL
> 
> Would anyone like to discuss the use of JAXB/Jackson/Moxy/resteasy to  externalize forms of X3D, like JSON and XML?  Specifically, would we like to use JAXB/Jackson/Moxy/resteasy to import/export JSON and XML from a JAXB’ized Java scenegraph—X3DJSAIL (requires annotations, I think)?  Can we implement other encodings with these frameworks?
> 
> https://stackoverflow.com/questions/38789307/how-to-serialize-jaxb-object-to-json-with-jaxb-reference-implementation.
> 
> Thanks,
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Friday, April 19, 2019 8:27 PM
> *To: *Brutzman, Donald (Don) (CIV) <mailto:brutzman at nps.edu>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Cc: *X3D Graphics Working Group <mailto:x3d at web3d.org>
> *Subject: *RE: [x3d] X3D agenda 19 APR 2019: tracking X3Dv4 implementationprogress
> 
> X3DJSONLD has been mostly in stasis since primary effort has been on X3DPSAIL.  I can offer an alternate XML (DOM) to JSON translation for the second implementation.   JavaScript version JSON -> DOM implemented in both X3DOM and X_ITE.  Need to run through a standards check with X3DOM and X_ITE.  C++ version of JSON -> DOM found in X3DJSONLD source code, but it’s not exactly clear where to find the implementation (somewhere under src/main/cpp).  C++ Code design currently only in a short running JSON -> XML conversion.  Looking for volunteers to work on the C++ version, choose appropriate JSON and XML libraries etc.  Java version found on sourceforge tree under x3d-code/www.web3d.org/x3d/stylesheets/java/src/net.
> 
> Other possible tasks: ProtoExpander written for/with XSLT/XML for maximum portability to XML/DOM implementation for X3DOM.
> 
> Need to compromise/implement similar JSON loading SAI interface between X3DOM, X_ITE, X3DJSAIL and other browsers.  All current versions translate to DOM from the JSON.  It may be desirable to implement JSON -> scenegraph or JSON -> SAI versions for performance reasons, but I am unfamiliar with the browser interfaces to the scenegraph.  Please discuss JSON import build on top of SAI, interesting subject.  Weigh alternatives between SAI and DOM for performance, validation, long term sustainability, standardization, etc.  Consider writing library to convert DOM to SAI—Done in X3DJSAIL?   Do we want JSON to SAI, but not DOM as an intermediary?  Maybe look at VRML implementations as an example?   Consider using a serializer to convert JSON to SAI.  ThreeSerializer.js may be a good place to start.  Also, DOM loader in X3DJSAIL.
> 
> _X3DOM version JSON interface:_
> 
> x3dom.Runtime.prototype.replaceWorld = function(scene) {
> 
> x3d_element = x3dom.Runtime.prototype.createX3DFromJS = function(jsobject, optionalURL) {
> 
> x3d_element = x3dom.Runtime.prototype.createX3DFromString = function(jsonOrXML, optionalURL) {
> 
> promise(x3d_element) = x3dom.Runtime.prototype.createX3DFromURLPromise = function(url, optionalURL) {
> 
> x3dom.Runtime.prototype.loadURL = function(url, optionalURL) {
> 
> _X_ITE version JSON interface:_
> 
> X3DBrowser.importJS(json_object)
> 
> _X3DJSAIL JavaScript/Java JSON interface _(X3DJSAIL has JSON a loader already!).__
> 
> var X3DJSONLD = Java.type("net.coderextreme.X3DJSONLD")
> 
> var loader = new X3DJSONLD();
> 
> var jsobj = loader.readJsonFile(new File("./examples/Nashorn.json"));
> 
> var document = loader.loadJsonIntoDocument(jsobj);
> 
> var string = loader.serializeDOM(loader.getX3DVersion(jsobj), document);
> 
> See: x3d-code/www.web3d.org/x3d/stylesheets/java/nashorn/examples/Nashorn.js Must currently translate JSON -> DOM in Java (uses Java DOM from X3DJSAIL).  Some further testing is required for roundtrip examples.
> 
> Where are the JavaScript SAI implementations?  Thanks!
> 
> Do we want both SAI -> DOM and DOM -> SAI in addition to JSON -> SAI?
> 
> Do we want to use proxies and JavaScript properties for events instead of X3D/DOM events?
> 
> Discuss patterns for converting JSON to SAI, please.   Do we really need SAI when we have DOM?   Can DOM take over some of the operations of SAI?  Which ones?
> 
> John
> 
> ========================================================================================
> 
> d. JSON file encoding for X3D
> 
> - http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding
> 
> - Build outputs now in version control, available at
> 
>            http://www.web3d.org/x3d/content/examples/build.json.all.log.txt
> 
> - X3DJSONLD summary, status needed from John Carlson
> 
> - JSON Schema update
> 
>            https://json-schema.org still at draft-07
> 
>            JSON Schema is a vocabulary that allows you to annotate and validate JSON documents.
> 
> "Update as of 31 March 2019.  You may be wondering what in the world is going on with this draft? The short version is: we are entering the home stretch. There are some ideas for simplifying $id that we are considering, and then there will be a final review period for feedback on overall flow and clarity. [...] We expect to publish a new round of drafts (Core, Validation, Hyper-Schema, Relative JSON Pointer) in the next month or two" [...]
> 
> - TODO: update X3D JSON schema to match next version, then autogenerate from X3DUOM
> 
> - TODO: create X3D JSON specification
> 
> - As time permits we may proceed with an X3D JSON Schema update even if draft-07 isn't 100% complete.
> 
> - TODO a second supporting implementation (X3DJSAIL has stylesheet export, will add loader).


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman


More information about the x3d-public mailing list