Commit Graph

153 Commits

Author SHA1 Message Date
Spring Buildmaster
8bb2143919 DATAREST-766 - Prepare next development iteration. 2016-02-23 05:26:21 -08:00
Spring Buildmaster
01661f9763 DATAREST-766 - Release version 2.4.4 (Gosling SR4). 2016-02-23 05:26:20 -08:00
Oliver Gierke
0995aea18b DATAREST-766 - Tweaked version properties for Gosling SR4. 2016-02-11 19:49:15 +01:00
Oliver Gierke
3c411d1261 DATAREST-747 - ProjectionDefinitionConfiguration now returns the most concrete projection.
In case multiple projections are defined with a given name, we now return the projection defined for the most concrete type match.
2016-01-11 19:40:26 +01:00
Spring Buildmaster
5b0110f2d0 DATAREST-731 - Prepare next development iteration. 2015-12-18 01:17:45 -08:00
Spring Buildmaster
3a495f9ce7 DATAREST-731 - Release version 2.4.2.RELEASE (Gosling SR2). 2015-12-18 01:17:44 -08:00
Oliver Gierke
8c5bf9802f DATAREST-723 - PropertyMappings now get eagerly initialized.
Switched to eager initialization of PropertyMappings to avoid potential ConcurrentModificationException.
2015-12-16 16:02:23 +01:00
Spring Buildmaster
45a00b55ba DATAREST-707 - Prepare next development iteration. 2015-11-15 06:30:45 -08:00
Spring Buildmaster
89a39035f2 DATAREST-707 - Release version 2.4.1.RELEASE (Gosling SR1). 2015-11-15 06:30:43 -08:00
Oliver Gierke
3a6b9ea3ff DATAREST-699 - Fixed pageable parameters showing up as is in search resource links on Java 8.
We now explicitly drop parameters of type Pageable and Sort from being exposed as search resource parameters as they're added via the UriComponentsContributors anyway. This prevents "pageable" from showing up as parameter on Java 8 code compiled with -parameters. The latter adds naming information for the Pageable parameter and caused it showing up as is despite the fact that the UriComponentsContributor for Pageables exposes a dedicated syntax.
2015-11-06 16:36:47 +01:00
Spring Buildmaster
a43ecf3795 DATAREST-663 - Prepare next development iteration. 2015-09-02 15:27:06 +02:00
Spring Buildmaster
1a38f96602 DATAREST-663 - Release version 2.4.0.RELEASE (Gosling GA). 2015-09-01 02:46:01 -07:00
Oliver Gierke
2dfce406e9 DATAREST-663 - Switched to Spring HATEOAS version property from build parent. 2015-09-01 11:28:41 +02:00
Oliver Gierke
9280a4e4b6 DATAREST-655 - Fixed type in exception message for parameter checks of ParameterMetadata. 2015-08-21 16:00:16 +02:00
Oliver Gierke
06b6b266db DATAREST-654 - Added suport for internationalization of enum values.
RepositoryRestConfiguration now exposes an option to enable enum value serialization and a nested configuration object to tweak the details.

If enabled, a Jackson serializer and deserializer is registered trying to resolve the enum values from the Spring Data REST resource bundle using the fully-qualified enum value name as key. If no explicitly configured value is configured a default translation is triggered that capitalizes the lowercased value name replacing the underscores with spaces (e.g. PAYMENT_EXPECTED -> Payment expected). This can be opted out of, of course.

On the parsing side the deserializer will also consult the resourcebundle and default translation but also accepting the enum name as is (also opt-outable).

Deprecated non-bean-style accessors for projection and metadata configuration on RepositoryRestConfiguration to make these options tweakable via Spring Boot application properties by default.
2015-08-21 15:22:27 +02:00
Oliver Gierke
39eb338025 DATAREST-651 - Upgraded to Spring HATEOAS 0.19.
Upgraded to snapshots of Spring HATEOAS to use the now extended constructor of HalHandlerInstantiator to be able to render title attributes for links.
2015-08-19 19:13:03 +02:00
Oliver Gierke
d4dbeb93a0 DATAREST-644 - Improvements to JSON Schema output.
Fixed JSON Schema output use "definitions" keyword instead of the previously used wrong "descriptors".

We now also include the title attribute for properties, using rest.description.$type.$property._title as i18n key. Titles are now also defaulted to the camel-case property name split up, lowercased and capitalized, e.g. "orderDate" will become "Order date".

JacksonMetadata now allows obtaining the Jackson serializer being used for a given type and exposes whether a property is considered read-only for Jackson.

Introduced JsonSchemaPropertyCustomizer to potentially tweak the JSON schema property definition. This is helpful in case custom JsonSerializers are implemented to also reflect the change in representation in the schema.
2015-08-14 19:13:23 +02:00
Spring Buildmaster
1d7e7f4ea4 DATAREST-634 - Prepare next development iteration. 2015-08-04 05:06:47 -07:00
Spring Buildmaster
402d7c9382 DATAREST-634 - Release version 2.4.0.RC1 (Gosling RC1). 2015-08-04 05:06:44 -07:00
Oliver Gierke
4e40bb456a DATAREST-634 - Upgraded to Spring HATEOAS 0.18.0.
Upgraded to Hibernate 4.3.10 along the way.
2015-08-04 13:11:03 +02:00
Oliver Gierke
5b0b368353 DATAREST-625 - Removed references to BeanWrapper.
DomainObjectMerger is now using the PersistentPropertyAccessor API instead of the BeanWrapper.

Related ticket: DATACMNS-738.
2015-07-22 21:09:56 +02:00
Oliver Gierke
de5a98d47b DATAREST-606 - Polishing.
Moved the accessibility tweak to the EventHandlerMethod's constructor so that the modification only occurs at detection time. Polished unit test.

Original pull request: #187.
2015-07-19 12:53:47 +02:00
Fabian Trampusch
698643cf18 DATAREST-606 - Allow non-public @RepositoryEventHandler methods.
AnnotatedEventHandlerInvoker now makes sure the method about to be invoked is accessible.

Original pull request: #187.
2015-07-19 12:52:34 +02:00
Oliver Gierke
be8964c465 DATAREST-582 - Fixed potential double invocation of annotated event handlers.
AnnotatedEventHandlerInvoker now uses the user class to detect handler methods on to make sure we don't accidentally find CGLib generated methods and thus invoke the handler multiple times later on.

Extended MethodFilter Methods.USER_METHODS to filter methods on CGLib proxy classes, too.

Added missing license header and Javadocs where necessary.
2015-07-06 12:30:05 +02:00
Oliver Gierke
5346215d47 DATAREST-588 - Upgraded to Spring HATEOAS 0.18.0 to benefit from downstream fix. 2015-06-19 16:56:55 +02:00
Oliver Gierke
290c1886f0 DATAREST-577 - Excerpt projections are now configured automatically.
Excerpt projections defined in @RepositoryRestResource had to be discoverable (i.e. located in a sub-package of the domain type). RepositoryRestMvcConfiguration now uses an newly introduced constructor of ProjectionDefinitionConfiguration that automatically registers all projects in the given ResourceMappings.
2015-06-16 15:24:31 +02:00
Spring Buildmaster
42fc85afdc DATAREST-563 - Prepare next development iteration. 2015-06-02 01:58:14 -07:00
Spring Buildmaster
0604e7b876 DATAREST-563 - Release version 2.4.0 M1 (Gosling). 2015-06-02 01:58:12 -07:00
Oliver Gierke
e4277378a0 DATAREST-553 - Polishing.
Removed obsolete logger in RepositoryRestConfiguration. Removed obsolete Commons IO dependency from POM.

Original pull request: #178.
2015-06-01 13:38:34 +02:00
Greg Turnquist
07986acc54 DATAREST-553 - Removed RepositoryRestConfiguration.setBaseUri(…).
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.
2015-06-01 13:38:34 +02:00
Oliver Gierke
f2d8a996bc DATAREST-523 - Re-enabled POST for collection based association resources.
We now support augmenting elements of a collection resource by using POST which previously only worked with PATCH requests. Took the chance to clean up RepositoryPropertyReferenceController by quite a bit and refactor functionality to discover the supported HTTP methods for a PersistentProperty into RootResourceInformation.
2015-05-19 15:36:56 +02:00
Oliver Gierke
17305f4067 DATAREST-479 - Empty collections now render a dedicated _embedded property.
Instead of rendering an empty _embedded document for empty collections and pages we now explicitly trigger the creations of an EmbeddedWrapper for that empty, collection to preserve the collection's element type.

Tweaked ResourceProcessorHandlerMethodReturnValueHandler to invoke ResourceProcessor instances for those empty collections, too. PRHMRVH now checks the assignability of the raw resource type before analyzing the value type for a match.

RepositorySearchController now adds additional self links for the list of searches and a search execution.
2015-05-18 19:55:23 +02:00
Oliver Gierke
3537bbd20b DATAREST-518 - MappingResourceMetadata is now not exported by default. 2015-04-14 22:27:02 +02:00
Oliver Gierke
7c3b93fffd DATAREST-511 - Support for executing repository methods returning Optionals.
Added an UnwrappingRepositoryInvokerFactory that transparently unwraps JDK 8 and Guava Optionals to make sure the consuming code works with values or plain nulls correctly.
2015-04-13 08:38:44 +02:00
Oliver Gierke
c412bc3a76 DATAREST-514 - Fixed resource exposure for customized associations.
We no correctly handle the customized association path if @RestResource is used on an association. Took the chance to refactor the resource mapping subsystem quite significantly to improve the handling of property mappings. Those had been externalized before.
2015-04-10 16:08:51 +02:00
Oliver Gierke
1bb228df17 DATAREST-502 - Prepare request parameters to enable URI-to-entity resolution for executing searches.
RepositorySearchController now takes all request parameters as MultiValueMap to execute query methods. For parameters mapping to a managed resource we try to interpret the given parameter value as URI to actually trigger the URI-to-entity resolution through the newly registered UriToEntityConverter.

The latter is now registered with the default ConversionService registered so that it's

A lot of cleanups in RepositorySearchController. Removed some obsolete prints to the console to reduce log output during test execution.

Related ticket: DATACMNS-678.
2015-04-07 17:02:16 +02:00
Spring Buildmaster
829bbdd221 DATAREST-493 - Prepare next development iteration. 2015-03-23 05:36:59 -07:00
Spring Buildmaster
338047fd62 DATAREST-493 - Release version 2.3.0.RELEASE (Fowler GA). 2015-03-23 05:36:57 -07:00
Oliver Gierke
5486712b1b DATAREST-34 - Polishing.
Moved decision logic on whether to return response bodies int RepositoryRestConfig to ease testability of the controller. Added more unit tests and simplified the controller integration tests accordingly. Had to deactivate some Cassandra related tests as they don't seem to handle nulling of properties correctly.

Changed configuration to rely on the presence of the Accept header by default. Deprecated parameterless isReturnBodyFor…(…) methods in favor of the ones taking the Accept header to avoid the null checks on the calling side.

Polished JavaDoc for the isReturnBodyOn(Create|Update) methods. Polished formatting in RepositoryEntityController.

Original pull request: #167.
2015-03-20 08:50:47 +01:00
Jeremy Rickard
f3c74ac9db DATAREST-34 - PUT and POST request now consider Accept header by default.
By default, whether to return response bodies for PUT and POST is determined by the presence of an Accept header, unless explicitly activated or deactivated in RepositoryRestConfiguration.

Original pull request: #167.
2015-03-20 08:50:30 +01:00
Spring Buildmaster
7b53546236 DATAREST-487 - Prepare next development iteration. 2015-03-05 10:28:08 -08:00
Spring Buildmaster
c52b72047f DATAREST-487 - Release version 2.3.0.RC1. 2015-03-05 10:28:07 -08:00
Oliver Gierke
b1ef67211f DATAREST-487 - Dependency upgrades in preparation of the release.
Upgraded to Spring HATEOAS 0.17.0.RELEASE, Spring Plugin 1.2.0.RELEASE as well as Evo Inflector 1.2.1.
2015-03-05 11:22:29 +01:00
Oliver Gierke
def74e6618 DATAREST-354 - General rewrite of the JSONSchema support.
Significant overhaul of the JSONSchema support. This currently adds the following features:

- Complex nested types are exposed as descriptors with the properties pointing to them whenever necessary.
- Sets are treated as unique collections.
- Enums are handled as expected (enum values are listed).
- Renamings via @JsonProperty are considered.
- @JsonProperty(required = true) is considered and added to required properties.
- Date/time types (legacy Date, JSR-310, ThreeTenBP and Joda Time) are exposed with format "date-time".
- Objects with @JsonValue methods are considered to be rendered as String value.
- Formats and patterns can be manually configured on MetadataConfiguration.

TODOs:

- Implementation polish, JavaDoc
- Automatically inspect ObjectMapper to detect customizations made through Mixins and custom Serializers.
2015-03-05 10:13:47 +01:00
Oliver Gierke
8cbd952d88 DATAREST-483 - Upgrade to JSONPath 0.9.1 and Spring HATEOAS 0.17.0 snapshots. 2015-03-02 17:41:02 +01:00
Oliver Gierke
14cee9c94f DATAREST-467 - RepositoryEntityLinks now exposes methods to create links to search resources.
RepositoryEntityLinks now exposes methods to obtain links to all search resources and individual ones, including overloads to pre-expand Pageable and Sort parameters potentially contained in the method signature.

Search links now also contain a projection template variable if the type returned by the query method backing the search resource has projections registered.
2015-01-30 20:46:03 +01:00
Oliver Gierke
c3ffe7793b DATAREST-446 - Removed RepositoriesUtils in favor of RepositoryMetadata.
To be sure to pick up domain type lookup customizations we now consistently use RepositoryMetadata instead of trying to be clever and re-detecting it via RepositoriesUtils.
2015-01-16 13:15:38 +01:00
Oliver Gierke
8700c60cef DATAREST-445 - Fixed domain type lookup in RepositoryCollectionResourceMapping.
We now use the domain type provided by RepositoryMetadata instead of manually looking up to be sure to pick up customizations correctly.
2015-01-16 12:22:17 +01:00
Oliver Gierke
f09880ff16 DATAREST-437 - Moved to projections API of Spring Data Commons.
Related tickets: DATACMNS-630, DATACMNS-618.
2015-01-11 16:45:41 +01:00
Oliver Gierke
e39d624832 DATAREST-427 - Refactorings in UriToEntityConverter.
Instead of using a DomainClassConverter directly we now use a raw ConversionService in UriToEntityConverter. This allos us to get rid off the bean definitions for UriToEntityConverter and DomainClassConverter. The population of the ConversionService is now taken care of by calling SpringDataWebConfiguration's addFormatter(…) in defaultConversionService().

Added unit tests for UriToEntityConverter.
2015-01-05 13:55:07 +01:00