Commit Graph

732 Commits

Author SHA1 Message Date
Oliver Gierke
ccdeae7bbd DATAREST-791 - Association resources now considers customized id lookup.
RepositoryPropertyReferenceController now uses a RepositoryInvoker instead of the ConversionService so that potentially applied customized entity lookups are considered during that lookup.

Extracted HttpHeadersPreparer to remove functionality and dependencies from the commons superclass of all Spring Data REST controllers in favor of a dedicated type.

Related tickets: DATAREST-724.
2016-04-01 10:42:18 +02:00
Oliver Gierke
e5a1f2d1cf DATAREST-794 - Upgraded to Solr 5.5 to make integration tests work again. 2016-04-01 10:42:18 +02:00
Oliver Gierke
d37bf77703 DATAREST-782 - After release cleanups. 2016-03-18 11:16:07 +01:00
Oliver Gierke
05c723fe50 DATAREST-782 - Prepare next development iteration. 2016-03-18 11:15:51 +01:00
Oliver Gierke
03a720d1c0 DATAREST-782 - Release version 2.5 RC1 (Hopper). 2016-03-18 11:15:00 +01:00
Oliver Gierke
90d94df1ea DATAREST-782 - Prepare 2.5 RC1 (Hopper). 2016-03-18 11:06:58 +01:00
Oliver Gierke
1d867d6474 DATAREST-782 - Updated changelog. 2016-03-18 11:06:54 +01:00
Oliver Gierke
4430e78966 DATAREST-787 - Remove dependency to JSON Patch library.
Switched to own JSON Patch implementation built by Craig Walls for Spring Sync back in the days.
2016-03-18 09:47:27 +01:00
Oliver Gierke
6075f3052a DATAREST-782 - Fixed build after Spring 4.2.5 update.
Upgraded to JSONPath 1.1.0 as 0.9 is not supported with Spring 4.2 anymore. Tweaked integration tests due to changed semantics and internals of JSONPath >= 1.0.
2016-03-17 21:29:20 +01:00
Oliver Gierke
2be6b2b6a9 DATAREST-776, DATAREST-775 - Integration tests for lookup types and nested associations.
Added shop integration test example that shows and tests nested associations and both unique and collection lookup type references.
2016-02-29 19:40:12 +01:00
Oliver Gierke
892409da2c DATAREST-774 - Separated integration tests from core project to avoid classpath overlap.
Extracted store specific tests into separate test modules to prevent classpath overlap between projects. Those tests are now executed in an "it" build profile to prevent the tests being packaged for distribution on release.

Use Map-based repositories and mapping contexts for test in the Core and WebMvc module.

Slightly changed the configuration API for lookup types on RepositoryRestConfiguration.

Related ticket: DATAREST-776.
2016-02-29 19:40:10 +01:00
Oliver Gierke
897bc88d69 DATAREST-775 - Support for nested association links.
Tweaked custom Jackson serialization to make sure nested entities are rendered as resources so that links to related resources can be collected on nested levels as well.

Extracted EmbeddedResourcesAssembler from PersistentEntityResourceAssembler so that embedded resources can also be build for nested entities. Extracted a ResourceProcessorInvoker from ResourceProcessorHandlerMethodReturnValueHandler to allow ResourceSupport instances created for nested entities get the ResourceProcessor instance registered for them invoked as well.

ProjectionDefinitionRegistrar now also allows the domain type of a repository being registered as excerpt, too.

Related tickets: DATAREST-776.
2016-02-29 19:38:59 +01:00
Oliver Gierke
6b9f274388 DATAREST-766 - Updated changelog. 2016-02-23 14:27:24 +01:00
Oliver Gierke
5ffc1c1ce4 DATAREST-756 - After release cleanups. 2016-02-12 15:43:57 +01:00
Oliver Gierke
c74576b91e DATAREST-756 - Prepare next development iteration. 2016-02-12 15:43:39 +01:00
Oliver Gierke
1c850a5909 DATAREST-756 - Release version 2.5 M1 (Hopper). 2016-02-12 15:42:47 +01:00
Oliver Gierke
790b861f81 DATAREST-756 - Prepare 2.5 M1 (Hopper). 2016-02-12 15:36:20 +01:00
Oliver Gierke
51617131bc DATAREST-756 - Updated changelog. 2016-02-12 15:36:14 +01:00
Oliver Gierke
070f049edd DATAREST-765 - Polishing.
Removed solrconfig.xml. Minor formatting in solr.xml. Reduced nesting in shutdown handler in SolrInfrastructureConfig.

Original pull request: #209.
2016-02-10 11:10:42 +01:00
Christoph Strobl
598b276843 DATAREST-765 - Update Solr test configuration for Solr 5.
Added required solr.xml and moved core.properties to new location. Additionally registered a CloseHook to prevent SolrCore.close() failures.

Original pull request: #209.
2016-02-10 11:10:42 +01:00
Oliver Gierke
29153b6aae DATAREST-765 - Upgraded Solr dependency to 5.3.1. 2016-02-09 20:55:13 +01:00
Oliver Gierke
e760118039 DATAREST-758 - Added code of conduct.
Tweaked CONTRIBUTING.adoc along the way.
2016-02-02 10:04:36 +01:00
Oliver Gierke
16306f6826 DATAREST-756 - Fix Querydsl test class generation.
We now configure a proper output directory for Querydsl generated test classes. Previously we used the folder that's automatically picked up by the main compilation step which breaks subsequent compile runs if they're not run with a previous clean.
2016-01-29 19:16:51 +01:00
Oliver Gierke
46df1279bf DATAREST-757 - Upgraded to Spring Data Solr 2.0.
Tweaked test configuration to use SolrClientFactory instead of SolrServerFactory.
2016-01-29 18:51:52 +01:00
Oliver Gierke
40e4dbf586 DATAREST-756 - Remove Enforcer plugin for now as it seems to break the Artifactory Maven plugin.
Related ticket: https://github.com/JFrogDev/build-info/issues/74
2016-01-29 18:36:37 +01:00
Oliver Gierke
b25df0bcf1 DATAREST-756 - Reorganize dependencies to make sure they get pulled in in release profile. 2016-01-28 15:41:58 +01:00
Oliver Gierke
e7afe51d65 DATAREST-756 - Declare Artifactory Maven plugin to be able to distribute build artifacts. 2016-01-28 14:55:21 +01:00
Oliver Gierke
b866af762d DATAREST-754 - Polishing.
Upgraded to Groovy 2.4.4. Polished sample domain types and repositories. Removed obsolete format registration in test cases for schema creation. Keep inlined null checks to make sure the IDE doesn't create unnecessary can-be-null warnings.

Original pull request: #206.
2016-01-25 17:50:48 +01:00
Greg Turnquist
9fd62b5dbf DATAREST-753 - Added support for Groovy-based domain objects.
Groovy-based objects inherit from GroovyObject. This brings along attributes that Spring Data REST may try to parse when generating metadata like JSON Schema. Also verify ALPS is supported.

We now exclude those artificial properties from being exposed in the schema as well as causing issues.

Original pull request: #206.
2016-01-25 17:50:48 +01:00
Oliver Gierke
c49754ebb3 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:26:54 +01:00
Oliver Gierke
88c97a600d DATAREST-743 - Made ProjectionResourceContentSerializer immutable.
ProjectionResourceContentSerializer.unwrappingSerializer(…) now returns a new unwrapping instance instead of mutating the current instance to prevent the source one from answering subsequent calls to isUnwrappingSerializer() with true.

This allows the source instance to be reused and produce reliable results on multiple serialization attempts.

Related tickets: DATAREST-716.
2016-01-07 21:46:26 +01:00
Oliver Gierke
3ce10774d8 DATAREST-741 - UriToEntityDeserializer now uses RepositoryInvoker directly.
UriToEntityDeserializer now uses the RepositoryInvokerFactory to resolve entity instances directly to make sure potentially registered EntityLookup instances are considered for the lookup.
2016-01-06 14:17:42 +01:00
Oliver Gierke
000f645543 DATAREST-740 - Removed Cassandra integration tests. 2016-01-05 12:47:48 +01:00
Oliver Gierke
482c78c925 DATAREST-724 - Fixed invocation of DELETE on item resource with entity lookup present.
Tweaked the RepositoryEntityController to lookup the identifier of the entity to be deleted from the entity obtained rather than forwarding the given id directly. This makes sure we use the real entity identifier on calls to delete in case the one to be used in URIs is customized via an EntityLookup.
2016-01-05 12:47:47 +01:00
Oliver Gierke
7e3b426ee9 DATAREST-731 - Updated changelog. 2015-12-18 11:04:35 +01:00
Oliver Gierke
1b99111634 DATAREST-730 - Temporarily remove integration tests for Neo4j. 2015-12-16 16:45:41 +01:00
Oliver Gierke
414f314684 DATAREST-723 - PropertyMappings now get eagerly initialized.
Switched to eager initialization of PropertyMappings to avoid potential ConcurrentModificationException.
2015-12-16 16:28:12 +01:00
Oliver Gierke
100eb86e9d DATAREST-729 - Removed relative reference to parent POM. 2015-12-16 16:28:11 +01:00
Vladimir Tsukur
8744b9c2f4 DATAREST-711 - Actualized examples with projection configuration and fixed typos.
Original pull request: #202.
2015-12-16 16:28:08 +01:00
Oliver Gierke
e08dff846e DATAREST-702 - Tweaked ResourceProcessorHandlerMethodReturnValueHandler to handle potentially proxied ResourceProcessors. 2015-12-11 19:02:19 +01:00
Oliver Gierke
0757253846 DATAREST-726 - Moved ResourceProcessorHandlerMethodReturnValueHandler to ResolvableType.
Removed all usages of TypeInformation from ResourceProcessorHandlerMethodReturnValueHandler so that it's not tied to Spring Data (REST) APIs anymore.
2015-12-10 18:50:17 +01:00
Oliver Gierke
6709d1fd92 DATAREST-697 - Fixed unwrapping mode in ProjectionSerializer.
Projection serializer now only creates a nested JSON document if it's not in unwrapping mode. Switched to a completely immutable implementation as we were previously mutating state in the request for an unwrapping instance as we were assuming the instances not being reused.
2015-12-10 13:20:47 +01:00
Oliver Gierke
959ddf8e15 DATAREST-724 - Updated documentation to mention new Java 8 config options for URI customization. 2015-12-10 12:46:42 +01:00
Oliver Gierke
3a66bc75e2 DATAREST-724 - Added configuration API for entity lookup customizations.
RepositoryRestConfiguration now exposes a withCustomEntityLookup() returning an EntityLookupRegistrar that allows to define customizations as follows on Java 8:

config.withCustomEntityLookup()
  .forRepository(UserRepository.class)
  .withIdMapping(User::getUsername)
  .withLookup(UserRepository::findByUsername);

or even abbreviated to:

config.withCustomEntityLookup()
  .forRepository(UserRepository.class, User::getUsername, UserRepository::findByUsername);

The API basically takes two lambdas or method references to define the id mapping (User::getUsername in this case) as well as the lookup call based on the repository type with which the customization builder was set up in the first place (UserRepository::findByUsername in this case).
2015-12-09 16:00:32 +01:00
Oliver Gierke
44ab756873 DATAREST-724 - Added support for customizing the property to be used for URI generation.
Spring Data REST now exposes an EntityLookup interface that allows to customize the property of an entity that shall be used to create item resource URIs. By default this mechanism uses the backend identifier and uses the repository's findOne(…) method.

The EntityLookup now exposes one method to return the property value to be used for URI generation as well as one method to obtain the entity instance from the very same raw identifier value. The EntityLookups are registered with both the SelfLinkProvider (for link creation) and the RepositoryInvoker (to obtain the entity instance).
2015-12-09 12:42:15 +01:00
Oliver Gierke
e50a9dcb89 DATAREST-714 - Reference documentation now mentions RepositoryrestConfigurer instead of RepositorytestMvcConfiguration.
Fixed documentation on how to customize Spring Data REST by moving away from extending RepositoryRestMvcConfiguration to RepositoryRestConfigurer.
2015-11-25 14:46:00 +01:00
Oliver Gierke
f497f40746 DATAREST-473 - Reference documentation updates for repository detection strategy. 2015-11-25 14:44:38 +01:00
Oliver Gierke
dc36dfb67a DATAREST-473 - Introduced configuration option to control default exposure of repositories.
RepositoryRestConfiguration now exposes a setRepositoryDetectionStrategy(…) to define which repositories should be detected for exposure by default. The default value for that will consider the repository interfaces visibility but also take the exported flag of @(Repository)RestResource into account. See all other options in RepositoryDetectionStrategies.

Tweaked the auto-registration of excerpt projections to avoid a circular dependency between configuration and resource mappings and moved it onto a BeanPostProcessor implementation.
2015-11-25 13:40:26 +01:00
Oliver Gierke
b663b5ff73 DATAREST-712 - Fixed application of Querydsl bindings to only kick in for collection resources.
The Querydsl integration in RootResourceInformationHandlerMethodArgumentResolver now only kicks in if the controller method parameter is annotated with @QuerydslPredicate. This allows us to apply the QuerydslBindings for collection resources but make sure they aren't accidentally applied during executions of query methods etc.

Improved the type lookup for query method execution to make sure the correct mapping is looked up for collection parameters.
2015-11-24 15:35:39 +01:00
Oliver Gierke
8329fcf8f6 DATAREST-705 - DomainObjectReader now doesn't wipe identifier and version properties.
Identifier and version properties are handled in a special way by Spring Data REST (ids are derived from and exposed via the URI, versions make it into the ETag header) and are not contained in the response representation. That requires handling PUT request having to explicitly exclude them from being wiped to null so that the server side values are still preserved.
2015-11-20 16:53:18 +01:00