The new registry rest service uses the JDAS project which is here: http://code.google.com/p/jdas/ . This project has object models generated from the relaxng schema files and thus has an easy to use model that follows the structure of the documents. These objects also have JAXB2 annotations that enables the immediate use of more standard Java libraries like spring REST and the Jackson library.

To make a json request you can for example make a request to http://www.dasregistry.org/das/sources after setting the “accept” header in the request to “application/json”. A simple REST client can be downloaded for free from here:

Putting this configuration into my spring res-mvc-config.xml changed the json responses so that null properties are not written. To make this changes have an effect you have to get rid of any mvc:annotation-driven element as this stops the overriding having an effect. no errors will be thrown, so it’s not easy to see what is going on or not going on 😉

I have a directory with some schema files in that I wanted to list for people to see. The old tomcat would list them if you went to the directory e.g. http://www.dasregistry.org/validation1.6/ there were a few forums where various answers to how to do this came up top in google, but they weren’t very simple. The simplest being to create a servlet to redirect to the jsp from your desired urls, simple but not very quick. I knew there had to be a quicker way as jsps are compiled into servlets anyway!

Note that because relaxng is much more descriptive than xsd conflicts and approximations may occur. We removed interleave elements from the rng schemas for generating our java classes so that we didn’t have to test for different types when using the generated java classes. this is because interleave means the classes don’t know if the list of child elements is going to contain a specific type of object as the objects can occur in any order – thus generating a for example getMaintanerOrCoodinate() method. We want seperat getMaintainer() and getCoordinate() methods and removing interleave does that. In the DAS specification it doesn’t specify whether the child elements should be returned in order, however the official W3C xml core data model characterizes element children as: