Updated existing unit tests to use setBasePath. Added extra assertion to setBasePath to guard against sending in a URI with a protocol.
Original pull request: #178.
Extracted groups of dependencies into auto-activated profiles to make more visible which dependencies belong to which store. Simplified dependency setup where possible.
General polishing in the test cases added.
Added configuration for setting up an EmbeddedSolrServer instance within a temporary directory. We use a temporary test folder created by JUnit where we copy the required configuration to. The directory will also hold all index data and will be deleted afterwards.
Original pull request: #156.
This commit adds the support to expose additional resources that serve ALPS [0] resources to document the available state transitions and representations. The exposure is enabled by default and can be customized using the RepositoryRestConfiguration.metadataConfiguration() object.
Currently the set of descriptors exposed includes:
- A descriptor for the representation of the domain type. Linkable associations are represented as safe descriptors, ones that are not linked are semantic descriptors.
- Descriptors for each supported HTTP method for both the collection and item resources to indicate the ability to update, create, delete etc.
- Safe descriptors (e.g. to access the collection or item resource) get potentially available customizations (pagination, projections) attached through nested descriptors.
Documentation
An ALPS descriptor contains a doc attribute to carry semantic information for the end user or a potential client to display. The information can be described in two ways: the first one is the @Description annotation that captures the plain text information one wants to get listed. It is supported in @RepositoryRestResource, on query methods, projection interfaces and accessors etc.
The preferred approach however is to use a resource bundle rest-messages.properties. For each descriptor we will resolve a key starting with rest.description followed by a dot path into the resource. By default, doc attributes are only rendered if the resource bundle contains an entry for the relevant key. You can enforce displaying unresolved keys by configuring MetadataConfiguration.omitUnresolvableDescriptionKeys(…).
For representation descriptors and and the parameter list of query method descriptors we will display enum values by default as comma-separated list. The list is also available as message resolution argument, so that you can refer to the list in your description message via the {0} placeholder.
TODOs:
- Improve descriptors for associations (indicate ability to update etc.)
[0] ALPS - http://alps.io
We now support PATCH request with application/json-patch+json [0] and application/merge-patch+json media types. The support is based on some customized usage of the FGE JSON Patch library [2].
As we need to apply the patch to an existing object, we need translate the JSON Patch remove operation into a replace operation setting the value to null so that out entity processing component registers the request for removal. Same applies to requests for merge-patch+json.
From an implementation point of view the handling of the media type has moved from the controller into PersistentEntityResourceHandlerMethodArgumentResolver and its delegates, n particular JsonPatchHandler. The application of the changes to the existing domain object is handled in the newly introduced DomainObjectReader.
Related ticket: DATAREST-345.
[0] http://tools.ietf.org/html/rfc6902
[1] http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch
[2] https://github.com/fge/json-patch
Added explicit dependency to jackson-annotations as a library previously declared might pull in that one in a different version which might cause conflicts.
Upgraded to Spring Data RC modules, Spring HATEOAS 0.9.0.RELEASE and Spring Plugin 1.0.0.RELEASE. Removed placeholder for Jackson 2 version as it's in the parent build pom now. Switched to milestone repository.