Commit Graph

191 Commits

Author SHA1 Message Date
Oliver Gierke
5882fcf0d6 #219 - HAL setup now registers a more strict HttpMessageConverter.
Previously we registered a special HttpMessageConverter with a custom ObjectMapper to deploy the HAL customizations. That converter was added to Spring MVC registered HandlerAdapters and registered as the first converter.

In case Spring MVC handled a request with Accept header */* or no Accept header at all, this meant that this converter kicked in and served HAL even for objects that don't need the customizations.

We now restrict the applicability of that special HttpMessageConverter to subtypes of ResourceSupport so that it will only be chosen if the object to render is of such type.
2014-07-25 10:24:30 +02:00
fiddlerpianist
f4c43b26c4 #215 - Fixed Traverson constructor usage in readme. 2014-07-23 15:55:41 +02:00
Oliver Gierke
67aa51dbea #217 - Improve UriTempalte's handling of TemplateVariables.
TempalteVariables now concatenates all request parameter styles correctly. UriTemplate uses continued style of request parameters if the base URI already contains request parameters.
2014-07-23 15:53:55 +02:00
Spring Buildmaster
050eae06d3 #208 - Prepare next development iteration. 2014-07-10 04:26:05 -07:00
Spring Buildmaster
835df9ddd6 #208 - Release version 0.15.0.RELEASE. 2014-07-10 04:26:03 -07:00
Oliver Gierke
8f0dcecdb2 #208 - Prepare 0.15.0.RELEASE.
Build and test dependency updates. Fixed JSON in VndErrors reference file as the order of the properties has changed after Jackson upgrade.
2014-07-10 13:18:09 +02:00
Oliver Gierke
377f4adff8 #141 - Added model to build ALPS documents.
Added the necessary abstractions to build an ALPS [0] document.

[0] http://alps.io
2014-07-09 16:02:20 +02:00
Oliver Gierke
8fba900aee #212 - Traverson can now return the last link. 2014-07-08 20:59:35 +02:00
Dietrich Schulten
9ca7049348 #183 - Added documentation for how to use CurieProvider.
Original pull request: #200.
2014-07-08 20:47:05 +02:00
Oliver Gierke
a363122be9 #185 - Traverson can now get LinkDiscoverers configured.
Moved to a setter based configuration for both the RestOperations and LinkDiscoverers to be used.

Related pull request: #189.
2014-07-08 20:40:21 +02:00
Dietrich Schulten
c1e940c5f3 #201 - Traverson can now take a customized RestTemplate.
Traverson now has an additional constructor taking a RestOperations instance which will be used instead of the default one. This allows more fine grained control over the HTTP request infrastructure used when performing link traversals.

Some internal polishing (moved from RestTemplate to RestOperations).

Original pull request: #203.
2014-07-08 14:40:27 +02:00
Spring Buildmaster
9993e9f51f #202 - Prepare next development iteration. 2014-07-08 14:33:56 +02:00
Spring Buildmaster
99bfb253ee #202 - Release version 0.14.0.RELEASE. 2014-06-30 00:25:04 -07:00
Oliver Gierke
8320bea75c #202 - Prepare 0.14.0.RELEASE. 2014-06-30 09:15:31 +02:00
Kory Markevich
921d1af9fb #206 - Set class loader for dummy method proxies.
The Enhancer used to create the proxy instances wasn't explicitly
setting the class loader to use, which meant by default the proxied
class's class loader was chosen. This is fine for controller classes, but
in some containers the return types for the controller may have a
class loader that doesn't have access to Spring, resulting in
ClassNotFoundExceptions. For example, returning a JAX-RS class JBoss.
Using the controller's class loader when proxying the return type solves
this. 

Related issues: #136.
2014-06-30 08:44:17 +02:00
Oliver Gierke
d4d788d9e0 #205 - Jackson2ModuleRegisteringBeanPostProcessor now looks up dependent beans lazily.
We now only lookup the beans, Jackson2ModuleRegisteringBeanPostProcessor needs to post-process other beans if the post-processing is really needed. This avoids premature initialization of those dependent beans.
2014-06-24 16:09:21 +02:00
Spring Buildmaster
ce5b66cd9a #181 - Prepare next development iteration. 2014-06-18 00:51:26 -07:00
Spring Buildmaster
fe2005b550 #181 - Release version 0.13.0.RELEASE. 2014-06-18 00:51:24 -07:00
Oliver Gierke
b60113852d #181 - Prepare 0.13.0.RELEASE.
Upgraded Evo Inflector version to 1.2. Updated changelog.
2014-06-18 09:47:35 +02:00
Oliver Gierke
0b4b3c1ad9 #199 - Refactorings in HalEmbeddedBuilder.
We now provide a dedicated EmbeddedWrappers API that HalEmbeddedBuilder uses to transparently handle the collection enforcement etc. It also allow manually hand in EmbeddedWrapper instances to enforce a certain behavior independent of the global settings in HalEmbeddedBuilder.

Simplified HalResourcesSerializer in Jackson2Hal module as we now don't have to deploy custom serializers for the embedded elements anymore.

Supersedes some of the API introduced for #195.
2014-06-12 10:46:30 +02:00
Oliver Gierke
40ceba3c47 #198 - TemplateVariables now drops duplicate TemplateVariable instances. 2014-06-11 10:21:21 +02:00
Oliver Gierke
20bfa86c5f #195 - HalEmbeddedBuilder now considers RelAware on objects added.
This change introduces a RelAware interface for objects to implement which want to enforce a particular rel to be used in the _embedded clause. This is useful if the objects being added are not categorized by type but rather by their role in the context of the main object.
2014-06-10 10:46:46 +02:00
Oliver Gierke
673f82d388 #192 - Added linkTo(Class<?>, Method, Object...) to MethodLinkBuilderFactory.
The newly introduced method is needed to make sure the correct mappings are looked up if the method given is actually not declared on the class the method shall eventually be invoked on.

This is basically allowing to try to build links, similar to the dummy invocation mechanism but effectively avoiding the overhead of creating such invocation manually (as it would usually require reflection to be used).
2014-06-05 16:19:10 +02:00
Oliver Gierke
daeae2e98a #192 - Added test case to show that mapping lookup works.
The test case added shows that the mapping lookup also works if the method invoked is referred to via a mapped sub type.
2014-06-05 12:34:23 +02:00
Dietrich Schulten
4f7e1cb561 #187, #188 - Fix header handling in Traverson.
Traverson correctly applies headers when using JsonPath to evaluate GET result: accepts the media types it is configured for and preserves additional headers.
2014-06-04 19:36:54 +02:00
Spring Buildmaster
345c710ddc #174 - Prepare next development iteration. 2014-05-20 05:37:08 -07:00
Spring Buildmaster
7007081c53 #174 - Release version 0.12.0.RELEASE. 2014-05-20 05:37:05 -07:00
Oliver Gierke
f3024063c6 #174 - Upgrade dependencies in preparation of 0.12 release.
Upgraded to Spring 3.2.9.RELEASE and Slf4j to 1.7.7.
2014-05-20 14:32:07 +02:00
Oliver Gierke
3fd835cafd #174 - Updated changelog. 2014-05-20 10:59:29 +02:00
qizeqing
84104897af #177 - Fix typo in readme.md. 2014-05-20 10:53:38 +02:00
Oliver Gierke
48749e7a87 #178 - Fixed potential NullPointerException in ResourceSupport.
ResourceSupport now has a null guard in equals(…) to prevent NullPointerExceptions from happening.
2014-05-20 10:52:56 +02:00
Kamill Sokol
6473c10113 #96 - Fixed double-encoding issues in LinkBuilderSupport.
LinkBuilderSupport now prefers the URI string over the URI to avoid double encoding issues.

VndErrorsMarshallingTest.jackson2marshalling(…) shouldn't take line breaks into account due to platform differences (Win, OSX, Linux)

Original pull request: #179.
2014-05-20 10:49:05 +02:00
Oliver Gierke
9790d94872 #180 - Overhaul of URI template expansion in Traverson.
We're now consistently using Spring HATEOAS' UriTemplate instead of the Spring MVC one to be able to expand extended template parameters correctly.

Also the ObjectMapper used by Traverson to unmarshal JSON responses does not fail for unknown properties anymore.
2014-05-20 10:33:42 +02:00
Spring Buildmaster
bef8994a43 #167 - Prepare next development iteration. 2014-05-01 10:48:57 -07:00
Spring Buildmaster
0a331f49c3 #167 - Release version 0.11.0.RELEASE. 2014-05-01 10:48:55 -07:00
Oliver Gierke
8d5f29393e #167 - Updated changelog. 2014-05-01 19:45:36 +02:00
Oliver Gierke
2bf386bd6f #167 - Prepare 0.11.0.RELEASE.
Updated pom.xml. Upgraded to Logback 1.1.2, Jackson 2.3.3, Spring Plugin 1.1.0.
2014-05-01 19:37:55 +02:00
Oliver Gierke
c9675640f2 #114 - Support for type mappings on sub-types in ControllerLinkBuilder.
When building links for method invocations we previously only inspected the type that declared the method for type level mappings. We now use the type the method was invoked on explicitly.
2014-05-01 18:38:52 +02:00
Vladimir Lyubitelev
2c6fa4d1b3 #170 - LinkBuilder takes X-Forwarded-Port header into account if present.
ControllerLinkBuilder now inspects the X-Forwarded-Port and uses that if present. If an X-Forwarded-Host header doesn't contain a :, we now also reset the port to prevent the local one from leaking into links generated.
2014-05-01 18:17:15 +02:00
Oliver Gierke
eafbda0c8a #172 - Made types contained in Link implement Serializable. 2014-05-01 17:57:04 +02:00
Oliver Gierke
0985979428 #131 - Add Traverson hypermedia client API.
Introduce Traverson as means to traverse hypermedia based APIs by providing a set of relation names to discover and follow to access the final representation. Traverson allows to specify a parameter map that will be used  to potentially expand the URIs discovered.

We currently support LinkDiscoverer based relation discovery, which means that relations in HAL representations can be found by simply stating their names. Alternatively JSON path expressions can be used (starting with a $).
2014-05-01 17:47:46 +02:00
Spring Buildmaster
03de68b3e5 #127 - Prepare next development iteration. 2014-03-31 02:12:58 -07:00
Spring Buildmaster
0c1a59d160 #127 - Release version 0.10.0.RELEASE. 2014-03-31 02:12:57 -07:00
Oliver Gierke
ba67233391 #127 - Prepare 0.10.0.RELEASE.
Upgraded to latest Objenesis and Slf4j. Updated changelog.
2014-03-31 10:48:48 +02:00
Oliver Gierke
8436e9ed4e #165 - Removed support for Jackson 1.x. 2014-03-21 17:45:58 +01:00
Oliver Gierke
d11bec0bc3 #162 - Fixed readme to mention @Relation, not @RelationType. 2014-03-20 15:46:33 +01:00
Oliver Gierke
20befe9a58 #134 - Fixed initialization of HttpMessageConverters for HAL.
The Jackson(2)ModuleRegisteringBeanPostProcessor now uses postProcess*Before*Initialization to make sure, afterPropertiesSet() has not been called on the target components which might have propagated the original HttpMessageConverters into other internal components.

With this fix, adding the HttpMessageConverter for HAL is added before the call and thus will be propagated to downstream components.
2014-03-19 14:16:34 +01:00
Oliver Gierke
f954a11e47 #160 - Fixed UriTemplate.expand(…) method declaration.
UriTemplate.expand(Map) not takes a Map<String, ? extends Object> to make sure Link.expand(Map) binds to the correct method. Previously it was bound to the method overload taking an Object vararg which caused an invalid expansion.
2014-03-11 19:18:19 +01:00
Oliver Gierke
ec41d78828 #158 - HalEmbeddedBuilder now uses AopUtils.getTargetClass().
To correctly resolve the rel for a proxied class we need to build up relation types for, HalEmbeddedBuilder now uses Spring's AopUtils.getTargetClass(), which will use the object's getTargetClass() method in case it implements TargetClassAware.
2014-02-27 07:50:26 +01:00
Oliver Gierke
4ad5dd7136 #154 - Introduce XMLUnit to make sure we can build on Java 6 and 7.
Using XMLUnit's Diff to guard against minor changes in the default rendering of XML between Java 6 and 7.
2014-02-27 07:47:31 +01:00