Clone
Randall Hauch
committed
on 26 Apr 11
MODE-1162 Added ability to expose repository metadata
After quite a bit of discussion with Brian about possible ways to implement this, we s… Show more
MODE-1162 Added ability to expose repository metadata

After quite a bit of discussion with Brian about possible ways to implement this, we settled upon the following.

GET /

will return information about each of the repositories, and in each will be a new "metadata" value with all of the JCR repository's descriptor key-value pairs. For example:

{

 "mode:repository":{

   "repository": {

     "name":"mode:repository",

     "resources":{"workspaces":"<URL>"}

     "metadata" : {

        "jcr.specification.name" : "Content Repository for Java Technology API",

        "jcr.specification.version" : "2.0",

        "jcr.repository.name" : "ModeShape JCR Repository",

        "jcr.repository.vendor.url" : "http://www.modeshape.org",

        "jcr.repository.version" : "2.6.0.FINAL",

        "option.versioning.supported" : "true",

        ... etc. ...

        }

    }

  }

}

Note the addition of the "metadata" section.

The RESTful Client API was changed to support reading these if there, and will populate an immutable Map returned by a new Repository.getMetadata() method. If the metadata is not returned by the server, this map will be empty (but not null).

These changes were made to the codebase, and several unit tests were modified to verify this behavior. The Reference Guide was also updated to reflect this change. All unit and integration tests pass.

Show less

2.5.x + 16 more