Commit Graph

839 Commits

Author SHA1 Message Date
Oliver Gierke
0667e0bfb2 DATAREST-200 - Embedded associations get rendered again.
Removed too strong guard that prevented managed but not-exported types to be rendered at all.
2013-12-04 21:41:57 +01:00
Oliver Gierke
4ee1850a37 DATAREST-93 - Improvements after API updates in Spring Data Commons.
Switched to the usage of Simple(Property|Association)Handler to avoid having to use raw PersistentProperty instances.
2013-11-14 10:04:28 +00:00
Oliver Gierke
8f2e3eb4fe DATAREST-163 - Fixed rendering of embedded documents for MongoDB.
Removed the attempt to add a link to the response for non-associations. Switched to the usage of Simple(Property|Association)Handlers for simplified generics.
2013-11-14 10:04:28 +00:00
Oliver Gierke
8e29f9bcff DATAREST-184 - Upgraded to Spring Data Neo4j 2.3.3.
The upgrade is necessary to benefit from a fix for DATAGRAPH-409 which transitively fixes this ticket.

Added integration tests for Neo4j repositories.
2013-11-14 10:04:28 +00:00
Oliver Gierke
9b4b111d23 DATAREST-93 - Cleanups in repository invoker area.
Made RepositoryInvokerFactory an interface and renamed the previously existing implementation class to DefaultRepositoryInvokerFactory. Removed instantiation of the class from ResourceMetadataHandlerMethodArgumentResolver to keep the logic which implementation to use solely in the configuration.
2013-11-14 10:03:48 +00:00
Oliver Gierke
a6b5c1ec46 DATAREST-113 - Fixed glitches in JSON schema creation.
PersistentEntityToJsonSchemaConverter looks up the ResourceMetadata correctly and builds up URIs in a proper way.
2013-10-01 18:24:32 +02:00
Oliver Gierke
6260d3fba9 DATAREST-93 - Code cleanups.
Added missing license header. Polished code in RepositoryEntityController.
2013-10-01 17:41:50 +02:00
Oliver Gierke
ba0c7be7df DATAREST-169 - Added integration test to access property. 2013-10-01 17:41:49 +02:00
Oliver Gierke
9acad5d55d DATAREST-111 - Slightly raised precedence of RepositoryRestHandlerMapping.
Set order of RepositoryRestHandlerMapping to LOWEST_PRECEDENCE - 100 to give core Spring Framework components the chance to hook into the right place in the chain.

Refactored RepositoryRestHandlerMapping to really check for the exposed path and added test cases for handler method resolution.
2013-08-21 12:19:46 +02:00
Oliver Gierke
252efc5196 DATAREST-112 - Moved property mapping into PropertyResourceMapping.
PersistentEntityJackson2Module now entirely relies on the property mapping to do the right thing for link creation. The PropertyResourceMapping now returns the property name for both rel and path.
2013-08-21 10:20:37 +02:00
Oliver Gierke
70443fc6a7 DATAREST-93 - Refactorings in HandlerAdapters.
Use constructor injection consistently now in ResourceProcessorInvokingHandlerAdapter and RepositoryRestHandlerAdapter. Removed unnecessary constructor in ResourceProcessorInvokingHandlerAdapter.

Renamed RestController annotation to RepositoryRestController to avoid confusion with Spring 4's @RestController.
2013-08-16 12:04:27 +02:00
Phillip Webb
f02b717c44 DATAREST-106 - Spring 4.0 compatibility in ResourceProcessorInvokingHandlerAdapter.
Fix ResourceProcessorInvokingHandlerAdapter to call
getReturnValueHandlers() via reflection and deal with different
response types.

This change is necessary due to SPR-10519 which changed the API of
RequestMappingHandlerAdapter.getReturnValueHandlers() to return a
List rather than a HandlerMethodReturnValueHandlerComposite.

Original pull request: #114.
2013-08-16 11:25:15 +02:00
Oliver Gierke
8ac0d2c222 DATAREST-93 - Fixed test setup. 2013-07-24 14:08:51 +02:00
Oliver Gierke
d2c2ec8262 DATAREST-93 - More cleanups.
Merged core and repository modules into core. Renamed some packages for consistency in naming and in preparation to break up some package cycles. Removed @BaseUri and the according resolver. Refactored controllers a bit to have more reusable chunks of code.
2013-07-24 12:59:23 +02:00
Oliver Gierke
c1d2f624c9 DATAREST-93 - Enable web integration tests for Gemfire. 2013-07-17 23:20:28 +02:00
Oliver Gierke
975b333746 DATAREST-103 - Added support for non-CrudRepositor implementations.
The exporter can now work with repositories that do not implement CrudRepository. Introduced a new RepositoryInvoker abstraction that transparently exposes which CRUD methods the repository offers. 

We still offer special invokers that can be used for CrudRepository and PagingaAndSortingRepository implementations to avoid the reflection overhead the general mechanism introduces.
2013-07-17 15:14:45 +02:00
Oliver Gierke
a4d8a22428 DATAREST-93 - Further refactorings and refinements regarding the search resource mapping. 2013-07-12 14:20:32 +02:00
Oliver Gierke
f8e53058f8 DATAREST-93 - More cleanups in code structure.
Removed the need for RepositoryInformationSupport. Refactored Converter implementations to get dependencies injected directly and use constructor injection.

Added new RepositoryInvoker abstraction to avoid reflection for known CrudRepository or PagingAndSortingRepository. Refactored existing RepositoryMethodInvoker to implement the new abstraction.

Refactored AbstractRepositoryRestController and RepositoryEntityContoller to use new mapping API.
2013-07-08 13:27:13 +02:00
Oliver Gierke
175f9eab10 DATAREST-99 - Updated RepositoryController to use new mapping API.
RepositoryController now uses the new mapping API to not expose non-public repositories anymore. Added integration test for that in the JPA module.
2013-06-29 17:56:09 +02:00
Oliver Gierke
0127ca8d46 DATAREST-93 - Cleanups in RepositoryEntityController.
Extracted RepositorySchemaController to handle schema exposure. Turned DomainObjectMerger property into constructor argument.
2013-06-25 09:53:34 +02:00
Oliver Gierke
c5a592bd9d DATAREST-93 - Further fixes in repository mappings.
Simplified new RepositoryMappings infrastructure. Integrated EvoInflectionRelProvider to build collection resource rels. Bumped version number to 2.0 as we're going to break backwards compatibility with the next release to straighten out the rel construction and mapping.
2013-06-18 19:17:56 +02:00
Oliver Gierke
5c61632ec2 DATAREST-93 - Fixed formatting in Spring Data REST.
Added formatter to be used within Eclipse going forward.
2013-06-18 16:21:34 +02:00
Oliver Gierke
eec52471d7 DATAREST-93 - More cleanups, more fixes. 2013-06-18 14:03:30 +02:00
Oliver Gierke
db2bbfca0e DATAREST-93 - Quite a lot of refactoring.
Integrated pagination resolving and closer integration of Spring Data Commons configuration.
2013-06-14 20:35:42 +02:00
Oliver Gierke
90c4b62428 DATAREST-93 - Removed compiler warnings.
Removed dependency on jMock.
2013-06-11 15:01:03 +02:00
Oliver Gierke
cb4056e351 DATAREST-94 - Removed dependency to Guava.
Introduced simple Function interface. Replaced usage of Multimap with Spring's MultiValueMap.
2013-06-05 22:13:00 +02:00
Oliver Gierke
8d0fc660ce DATAREST-83 - Removed type level @RequestMapping annotations.
Removed type level @RequestMapping annotations to prevent Spring MVC from picking up the controllers in its default configuration.
2013-06-05 20:49:54 +02:00
Oliver Gierke
f1cf2d5069 DATAREST-83 - Controller classes aren't annotated with @Controller anymore.
This is to prevent a parallel Spring MVC setup from picking up the controller classes in addition to the custom RequestHandlerMapping we deploy.

Polished some compiler warnings on the way.
2013-06-05 17:38:34 +02:00
Jon Brisbin
ad2496374c #92 Add special Resource subclass that is returned by listRepositories method so that ResourceProcessors can easily add links to it. 2013-04-25 15:08:33 -05:00
Jon Brisbin
d74dde316d Tweaks to the way resources are returned. 2013-04-25 15:08:33 -05:00
Jon Brisbin
5e52dd0aa1 Fix for NPE when returning a subclass for Resource 2013-04-25 15:08:32 -05:00
Jon Brisbin
94bd20f39f Tweaks to the way resources are returned. 2013-04-25 15:08:32 -05:00
Jon Brisbin
467966ef63 Primarily formatting changes. 2013-04-25 15:08:32 -05:00
Jon Brisbin
2d3ebe50ec Fixing a bug with property reference deletion. 2013-04-03 00:09:54 +02:00
Jon Brisbin
9c81264d52 Added extra checks to make sure that query methods marked with @RestResource(exported=false) aren't accidentally exported anyway. 2013-03-26 14:00:25 -05:00
Jon Brisbin
34c94d1e92 Update tests. 2013-03-13 15:06:32 -05:00
Jon Brisbin
20d18bd8f2 Fix PagingAndSorting resolver to recognize property aliases from the configuration. 2013-03-13 15:06:14 -05:00
Jon Brisbin
c25d05e12e Change the signature of a constructor. 2013-03-13 15:05:29 -05:00
Jon Brisbin
94328592f4 Add explicit transactional semantics to the deleteEntity method because of problems with Neo4J support. 2013-03-13 11:14:48 -05:00
Jon Brisbin
e0c34e1be6 Fix paging. 2013-03-12 13:37:07 -05:00
Jon Brisbin
34adf44c1f Fix a bug where property mappings weren't being considered in sort parameter names. 2013-03-12 13:36:46 -05:00
Jon Brisbin
2d2a85e870 Took of @Transactional because it was causing problems in other parts of the codebase. 2013-03-12 10:27:04 -05:00
Jon Brisbin
cf275cb304 Fix a bug where paging information wasn't being displayed in the JSON. 2013-03-12 09:49:39 -05:00
Jon Brisbin
8b7340c6cc #71 Added a default no-arg constructor to the helper servlet. 2013-03-07 10:32:21 -06:00
Jon Brisbin
cc1573cb39 Make the EntityManagerFactory handling in the JpaHelper a little more robust. 2013-03-06 16:05:22 -06:00
Jon Brisbin
93d3214115 DATAREST-67 Can now using Spring Data REST without having to have any JPA dependencies in the classpath. The JPA-specific interceptor that is being used has been moved into a support class that is only created if JPA is in the classpath. 2013-03-06 14:06:44 -06:00
Jon Brisbin
b814319994 Capture the case where a ResourceNotFoundException was in the cause of an IllegalArgumentException. This situation should result in a 404 not a 500 with an error message. 2013-03-06 11:27:05 -06:00
Jon Brisbin
1a7adc6461 Tweaks to ValidationExceptionHandler injection. 2013-03-06 10:34:24 -06:00
Jon Brisbin
0b34c81394 Changes to validation code to make javax.validation an optional dependency. 2013-03-06 10:20:44 -06:00
Jon Brisbin
4d8f009679 Fix for DATAREST-72. ResourceMapping.isExported() is now considered for displaying the link to the repository or when building the metadata for the request. Now sends back a 404 when a repository is not exported and an attempt to access it is made. 2013-03-06 08:42:20 -06:00