Commit Graph

1641 Commits

Author SHA1 Message Date
Oliver Gierke
c4e978cd55 DATAREST-418 - Updated changelog. 2014-12-01 11:33:24 +01:00
Oliver Gierke
a32d1867b4 DATAREST-160 - Polished support for ETag headers based on version properties.
Introduced a dedicated value object for ETags and moved the logic of ETagValidator into it. Switched from an annotation based injection model to a type based one.

The HTTP status code for a non-matching ETag is now 412 Precondition failed as the HTTP specification suggests.

Original pull request: #148.
2014-11-28 22:23:59 +01:00
Pablo Lozano
8fe634cb0d DATAREST-160 - Added support for ETag/If-Match based on entity's version property.
Original pull request: #148.
2014-11-28 22:23:59 +01:00
Oliver Gierke
2e03e8397e DATAREST-401 - Updated changelog. 2014-11-28 12:23:15 +01:00
Oliver Gierke
4b6e5bffc3 DATAREST-417 - Adapt to type reorganization in Spring Data Commons. 2014-11-25 11:37:56 +01:00
Oliver Gierke
afd1027d36 DATAREST-416 - Switched to IdentifierAccessor API where needed.
We now use the newly introduced IdentifierAccessor API to make sure we benefit from store specific optimizations when looking up identifier values.

Added some user class lookups to make sure the projection and resource mapping lookup works if proxies types are handed around.
2014-11-24 13:25:43 +01:00
Oliver Gierke
780d674012 DATAREST-415 - Moved to PersistentPropertyAccessor API.
We now use the PersistentPropertyAccessor provided by the PersistentEntity to lookup property values to benefit from store-specific customizations. Code that relies on value conversion by using a ConversionService now explicitly uses a ConvertingPropertyAccessor.

Related tickets: DATACMNS-596.
2014-11-24 13:22:08 +01:00
Oliver Gierke
458cdfa7e8 DATAREST-409 - Port RepositoryInvoker API to Spring Data Commons.
Introduced SupportedHttpMethods abstraction to be able to test the exposure of HTTp methods based on a CrudMethods instance only. Moved ResourceType to the core module.
2014-11-14 16:49:31 +01:00
Oliver Gierke
dbeec0a5de DATAREST-227 - Renamed WebTestUtils to TestMvcClient.
Renmaed WebTestUtils to TestMvcClient, added assertions to constructor and fixed formatting of JavaDoc.

Original pull request: #149.
2014-11-10 16:54:38 +01:00
Greg Turnquist
e304e14527 DATAREST-227 - Broke up AbstractWebIntegrationTest and its subclasses.
Decouple the test machinery of this class from the barrage of common test cases used against the various data stores. This way, other test suites that use the same integration approach don't have to be a part of this class hierarchy. Also move utilities and assertion methods into separate utility classes to slim down the class hierarchy.

Original pull request: #149.
2014-11-10 16:54:35 +01:00
Oliver Gierke
8504a8837c DATAREST-384 - Fixed affordances and execution of sortable search resources.
Search resources are now considered sortable if they contain a Sort parameter. This is now reflected in MethodResourceMapping.isSortableResource().

Building on top of that, the RepositorySearchController now appends the sort template variable to links generated when listing search resources. It also now accepts resolved Sort instances to forward them to the query method execution. The controller now also uses DefaultedPageable so that request missing pagination information use the defaults configured for the PageableHandlerMethodArgumentResolver.
2014-10-15 13:30:53 +02:00
Oliver Gierke
0b5726ac41 DATAREST-385 - Projection definition configurations are now detected for super types.
Projections defined for a parent type are now also available for sub-types.
2014-10-15 11:56:39 +02:00
Oliver Gierke
08dd3c69d0 DATAREST-380 - Removed obsolete repository declaration. 2014-09-05 15:44:47 +02:00
Oliver Gierke
1e0e3f0ad4 DATAREST-381 - Improved HandlerMapping infrastructure to make sure controllers consider base URI.
Removed class-level @RequestMapping annotations as the controllers get picked up by standard Spring MVC and are exposed via the root even if a base URI is configured. Created custom @BaseUriAwareController and use that in AlpsController to make sure it doesn't get picked up by Spring MVC.
2014-09-05 15:44:47 +02:00
Oliver Gierke
40697a0e72 DATAREST-380 - After release cleanups. 2014-09-05 14:24:49 +02:00
Spring Buildmaster
648a50a2c1 DATAREST-380 - Prepare next development iteration. 2014-09-05 03:56:17 -07:00
Spring Buildmaster
31b689a566 DATAREST-380 - Release version 2.2.0.RELEASE (Evans GA). 2014-09-05 03:56:15 -07:00
Oliver Gierke
e4942c74ff DATAREST-380 - Prepare 2.2.0.RELEASE (Evans GA). 2014-09-05 12:49:12 +02:00
Oliver Gierke
5169b6a0d1 DATAREST-380 - Updated changelog. 2014-09-05 09:23:52 +02:00
Oliver Gierke
1b2f46f608 DATAREST-378 - Updated changelog. 2014-09-05 08:19:33 +02:00
Oliver Gierke
c84ab6ad44 DATAREST-374 - After release cleanups. 2014-08-13 16:33:21 +02:00
Spring Buildmaster
78ec4a8771 DATAREST-374 - Prepare next development iteration. 2014-08-13 07:27:55 -07:00
Spring Buildmaster
37a5300e87 DATAREST-374 - Release version 2.2.0.RC1 (Evans RC1). 2014-08-13 07:27:52 -07:00
Oliver Gierke
6250eabcd0 DATAREST-374 - Prepare 2.2.0.RC1 (Evans RC1). 2014-08-13 16:13:19 +02:00
Oliver Gierke
95b69967bb DATAREST-374 - Updated changelog. 2014-08-13 15:05:19 +02:00
Oliver Gierke
c9dcba68eb DATAREST-374 - Added Gemfire repository to be able to resolve 8.0 artifacts. 2014-08-13 15:00:33 +02:00
Oliver Gierke
0f74c213fe DATAREST-361 - Updated changelog. 2014-08-13 11:06:25 +02:00
Greg Turnquist
50d9c6914f DATAREST-364 - Reference documentation is now written in Asciidoctor.
Original pull request: #146.
2014-08-10 16:23:25 +02:00
Oliver Gierke
2d64fb4d84 DATAREST-326 - Improved configuration setup for better Boot compatibility.
We now don't expose the PersistentEntityJackson2Module as bean anymore to prevent global registration in case of a Boot setup. The HttpMessageConverters registered are now TypeConstrainedMappingJackson2HttpMessageConverters so that they only get used of the object to marshal is of type ResourceSupport.
2014-07-25 16:33:07 +02:00
Oliver Gierke
aa28aebca5 DATAREST-353 - Fixed potential NullPointerException when trying to delete a non-existing resource.
We now correctly return a 404 Not Found in case we receive a DELETE request for a resource not existing.
2014-07-16 17:44:02 +02:00
Oliver Gierke
07a8dd2ca6 DATAREST-319 - Adapt to changes in Spring Data Commons.
Fixed ReflectionRepositoryInvokerIntegrationTests after some CRUD method detection changes that invalidated the test cases.

Related ticket: DATACMNS-539.
2014-07-15 11:03:18 +02:00
Oliver Gierke
3a583ba511 DATAREST-350 - After release cleanups. 2014-07-10 20:45:44 +02:00
Spring Buildmaster
9e1c607abb DATAREST-350 - Prepare next development iteration. 2014-07-10 20:35:04 +02:00
Spring Buildmaster
527d2391ce DATAREST-350 - Release version 2.2.0.M1. 2014-07-10 20:35:04 +02:00
Oliver Gierke
c722743ad1 DATAREST-350 - Prepare 2.2.0.M1 (Evans M1). 2014-07-10 20:35:00 +02:00
Oliver Gierke
507bed6698 DATAREST-350 - Updated changelog. 2014-07-10 20:34:48 +02:00
Oliver Gierke
48700f239d DATAREST-337 - Updated changelog. 2014-07-10 17:07:56 +02:00
Oliver Gierke
12d2b813cc DATAREST-350 - Upgraded to Spring HATEOAS 0.15.0.RELEASE. 2014-07-10 17:07:56 +02:00
Oliver Gierke
b29fea84e9 DATAREST-333, DATAREST-348 - OPTIONS requests now expose Accept-Patch header.
As recommended in RFC 5789, the support for PATCH request should be advertised in OPTIONS requests (already in place) and include an Accept-Patch header listing the patch media types supported. We now include the media types for JSON Patch, JSON Merge Patch and plain JSON in that header.

[0] http://tools.ietf.org/html/rfc5789#section-3
2014-07-10 17:07:55 +02:00
Oliver Gierke
020de45c1b DATAREST-230 - Support for serving Alps documents.
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
2014-07-10 17:07:55 +02:00
Christoph Strobl
0f0d23c6b1 DATAREST-352 - Remove links to forum.spring.io.
Replace by liks to stackoverflow.
Additionally altered springsource.org to spring.io.
2014-07-10 07:29:35 +02:00
Oliver Gierke
bffa378bc5 DATAREST-350 - Upgraded to Spring HATEOAS 0.15.0.BUILD-SNAPSHOT. 2014-07-08 21:08:10 +02:00
Oliver Gierke
65c95d9068 DATAREST-351 - Upgraded to Evo Inflector 1.2.
This is mainly to prevent users from running into Java 6 incompatibility as the Evo library was accidentally compiled requiring Java 7 compatibility in version 1.1.
2014-07-08 17:01:26 +02:00
Oliver Gierke
b9aef87e05 DATAREST-337 - Fix trailing whitespace in poms. 2014-07-08 14:05:24 +02:00
Oliver Gierke
ef3720be11 DATAREST-348 - Support for json-patch+json and merge-patch+json media types.
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
2014-07-08 14:04:47 +02:00
Oliver Gierke
ca2e88ae34 DATAREST-346 - Fixed invocation of overridden delete(…) methods.
We now defensively invoke the ConversionService prior to the reflective invocation of the delete method as we have to assume the clients providing the id value in a raw form, i.e. as obtained from the request and thus most likely as String.

Related ticket: DATAREST-335.
2014-07-02 13:26:03 +02:00
Oliver Gierke
59b15933ae DATAREST-343 - Added jackson-annotation as explicit dependency.
Added explicit dependency to jackson-annotations as a library previously declared might pull in that one in a different version which might cause conflicts.
2014-07-01 10:59:02 +02:00
Oliver Gierke
0dabf8d376 DATAREST-341 - Upgraded to Spring HATEOAS 0.14.0.RELEASE. 2014-06-30 14:08:55 +02:00
Oliver Gierke
e6949f8a46 DATAREST-340 - AssociationOmittingSerializerModifier now keeps non-persistent property writers.
AssociationOmittingSerializerModifier previously dropped the writer fro a particular property if it couldn't find a PersistentProperty for the bean property. We now keep those writers to make sure that non-persistent, additional fields are written as well.

Related issues: https://github.com/spring-projects/spring-boot/issues/1190
2014-06-30 13:31:16 +02:00
Oliver Gierke
71b8b275d1 DATAREST-322 - Updated changelog. 2014-06-30 11:15:53 +02:00