Jim - request

Jim, I’m ready to test at least the unmarshalling. Can you point me to:

  1. A full JalviewModel XML object.

  2. The link to that code branch so that I can check it out and test it on that.

Thanks,

Bob

···

Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr

If nature does not answer first what we want,
it is better to take what answer we get.

– Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

relevant issue:

https://issues.jalview.org/browse/JAL-3063

Branch is feature/JAL-3063JAXB

The example project file is here:

http://www.jalview.org/examples/exampleFile_2_7.jar

That covers most aspects of the XML - its missing states for VARNA and CDS/Protein (and of course Chimera). Of course - ideally you’d run our Jalview2XML test suite to check all is working - but lets not go there…

Jim.

···

On 27/09/2018 02:40, Robert Hanson wrote:

-- 
-------------------------------------------------------------------
Dr JB Procter, Jalview Coordinator, The Barton Group
Division of Computational Biology, School of Life Sciences
University of Dundee, Dundee DD1 5EH, UK.
+44 1382 388734 | [www.jalview.org](http://www.jalview.org) | [www.compbio.dundee.ac.uk](http://www.compbio.dundee.ac.uk)

JalviewModel – right, sorry. I knew that. I was thinking there was a full XML for an entire “state” but, right, there’s a ZIP file that contains the parts that go into the state. OK.

I need the GIT repository import URL for both Jalview 2.7 and this new branch. Somehow my repository got completely disconnected.

Here is what we need to reproduce in JavaScript, from JalviewModel$UserColours.class:

// Compiled from JalviewModel.java (version 1.8 : 52.0, super bit)
@javax.xml.bind.annotation.XmlAccessorType(value=javax.xml.bind.annotation.XmlAccessType.FIELD)
@javax.xml.bind.annotation.XmlType(name="",
propOrder={“userColourScheme”})
public static class jalview.xml.binding.jalview.JalviewModel$UserColours {

// Field descriptor #6 Ljava/lang/Object;
@javax.xml.bind.annotation.XmlElement(name=“UserColourScheme”,
namespace=“www.jalview.org”,
required=true)
protected java.lang.Object userColourScheme;

// Field descriptor #16 Ljava/lang/String;
@javax.xml.bind.annotation.XmlAttribute(name=“id”)
protected java.lang.String id;

···

Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr

If nature does not answer first what we want,
it is better to take what answer we get.

– Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

OK, the transpiler is reading all the annotations. (It always has been, since J2S has its own annotation options.)

Here are some System.out calls from the transpiler I added. I think that’s all of them:

org.eclipse.jdt.core.dom.SingleMemberAnnotation @XmlAccessorType(XmlAccessType.FIELD)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlType(name=“JalviewModel”,namespace=“www.jalview.org”,propOrder=
{“creationDate”,“version”,“vamsasModel”,“jSeq”,“jGroup”,“viewport”,“userColours”,“tree”,“featureSettings”})

org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(required=true)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlSchemaType(name=“dateTime”)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(required=true)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(required=true)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(name=“JSeq”)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(name=“JGroup”)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(name=“Viewport”)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(name=“UserColours”)
org.eclipse.jdt.core.dom.NormalAnnotation @XmlElement(name=“FeatureSettings”)

It’s just a matter of:

a) building those into the JavaScript that is executed by the runtime

b) integrating that information into a schema in order to

  1. generate proper XML and
  2. convert types properly when reading the XML

Since a schema is XML, and HTML5 natively creates XML documents using DOM2, it’s totally doable.
I don’t think we need any special additional Java classes for parsing XML. If we had a class that could take an XML schema document and use that, it would be good.

Or do you think everything that is needed is in the class file already?

Q: Does the JVM have access to the schemas? Maybe not…

Bob

···

Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr

If nature does not answer first what we want,
it is better to take what answer we get.

– Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900