Commit Graph

106 Commits

Author SHA1 Message Date
Oliver Gierke
aa3fa8da91 DATAREST-934 - Updated changelog. 2016-11-23 10:35:04 +01:00
Oliver Gierke
63bc492140 DATAREST-915 - Updated changelog. 2016-11-03 18:56:47 +01:00
Oliver Gierke
40bb8e8e6c DATAREST-573 - Polishing.
Removed RepositoryRestConfiguration.addCorsMapping(…) as we currently don't have any other shortcut methods for configuration like this.

Tweaked the setup of (now Repository)CorsConfigurationAccessor to be created earlier so that we avoid recreation for every lookup. Introduced a NoOpStringValueResolver to be used by default so that we don't need to deal with the case of the resolver being null at the end of the call chain. Replaced constructor of RepositoryCorsConfigurationAccessor with corresponding Lombok annotation.

Updated reference documentation accordingly.

Original pull request: #233.
2016-10-28 14:19:26 +02:00
Mark Paluch
a3870ca528 DATAREST-573 - Add support for new CORS configuration mechanisms introduced in Spring 4.2.
We now support CORS configuration mechanisms introduced in Spring 4.2. CORS can be configured on multiple levels: Repository interface, Repository REST controller and global level. Spring Data REST CORS configuration is isolated so Spring Web MVC'S CORS configuration does not apply to Spring Data REST resources.

 Multiple configuration sources are merged so different aspects of CORS can be configured in separate locations.

@CrossOrigin
interface PersonRepository extends CrudRepository<Person, Long> {}

@RepositoryRestController
@RequestMapping("/person")
public class PersonController {

	@CrossOrigin(maxAge = 3600)
	@RequestMapping(method = RequestMethod.GET, "/xml/{id}", produces = MediaType.APPLICATION_XML_VALUE)
	public Person retrieve(@PathVariable Long id) {
		// ...
	}
}

@Component
public class SpringDataRestCustomization extends RepositoryRestConfigurerAdapter {

  @Override
  public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {

    config.addCorsMapping("/person/**")
        .allowedOrigins("http://domain2.com")
        .allowedMethods("PUT", "DELETE")
        .allowedHeaders("header1", "header2", "header3")
        .exposedHeaders("header1", "header2")
        .allowCredentials(false).maxAge(3600);
  }
}
2016-10-28 14:19:26 +02:00
Oliver Gierke
7bfe442691 DATAREST-903 - Updated changelog. 2016-09-29 14:42:09 +02:00
Oliver Gierke
f5ad5d23c2 DATAREST-913 - Updated changelog. 2016-09-29 11:42:09 +02:00
Oliver Gierke
8492063779 DATAREST-901 - Updated changelog. 2016-09-21 08:08:43 +02:00
Oliver Gierke
bd2d3907a6 DATAREST-842 - Updated changelog. 2016-09-21 08:08:41 +02:00
Jens von Pilgrim
7d0c3d1476 DATAREST-859 - Fix links to included code in conditionals reference documentation.
Original pull request: #217.
2016-09-19 15:40:34 +02:00
Craig Dennis
3d9ed01d3f DATAREST-858 - Fix links to included code in security reference documentation.
Original pull request: #212.
2016-09-19 15:40:20 +02:00
Oliver Gierke
ba8dbc1163 DATAREST-803 - Prepare 2.6 M1 (Ingalls). 2016-07-27 13:51:38 +02:00
Oliver Gierke
31bb5834de DATAREST-803 - Updated changelog. 2016-07-27 13:51:34 +02:00
Oliver Gierke
aa1b1f7843 DATAREST-804 - Updated changelog. 2016-06-15 14:31:49 +02:00
Oliver Gierke
5f3305dd07 DATAREST-802 - Updated changelog. 2016-04-06 23:14:26 +02:00
Oliver Gierke
18173c96bf DATAREST-790 - Prepare 2.5 GA (Hopper). 2016-04-06 16:34:46 +02:00
Oliver Gierke
cfbeab88d2 DATAREST-790 - Updated changelog. 2016-04-06 16:34:40 +02:00
Massimo Mangoni
78c468532b DATAREST-790 - Fixed typos in the reference documentation.
Original pull request: #203.
2016-04-06 13:26:23 +02: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
6b9f274388 DATAREST-766 - Updated changelog. 2016-02-23 14:27:24 +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
7e3b426ee9 DATAREST-731 - Updated changelog. 2015-12-18 11:04:35 +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
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
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
2f07c795c1 DATAREST-707 - Updated changelog. 2015-11-16 08:57:50 +01:00
Greg Turnquist
5d57f134e8 DATAREST-684 - Added details on how to return a HAL document in reference documentation.
Original pull request: #199.
2015-11-02 16:30:06 +01:00
Oliver Gierke
44c732936a DATAREST-693 - Updated changelog. 2015-10-14 14:02:42 +02:00
Oliver Gierke
5293867b03 DATAREST-669 - Include section on dependency management from Spring Data Commons into reference docs.
Related tickets: DATACMNS-762.
2015-09-03 18:20:02 +02:00
Oliver Gierke
e35313ad20 DATAREST-663 - Prepare 2.4.0.RELEASE (Gosling GA). 2015-09-01 09:44:22 +02:00
Oliver Gierke
83680b505e DATAREST-663 - Updated changelog. 2015-09-01 09:44:19 +02:00
Greg Turnquist
be67f3e5b0 DATAREST-627 - HAL Browser now uses JSON Editor view for resources exposing metadata.
In case a link relation's target exposes a profile link (via HTTP HEAD and "Link" response header), we now try to obtain a JSON schema from the target resource and use a custom view based on the JSON Editor library fro non-GET requests.

This creates a customized, user friendly pop-up dialog for data entry with a nice polished look. If there is no profile link, we use a fallback editor for raw JSON input.

Original pull request: #191.
2015-08-31 18:59:15 +02:00
Greg Turnquist
345c198a75 DATAREST-638 - Consolidated metadata under a single profile link.
Moved /alps into a separate link underneath /profile, so that /schema can ALSO be served there as well. Also added a profile link to the collection resources, linking to collection-specific metadata. We now use strict content negotiation for each form of metadata so clients don't have to navigate a labyrinth of links. To preserve backwards compatibility, make ALPS the default metadata type.

Original pull request: #196.
2015-08-19 11:25:17 +02:00
Oliver Gierke
14df6fcbc0 DATAREST-623 - Polishing.
Removed trailing spaces.

Original pull request: #195.
2015-08-12 19:06:52 +02:00
Greg Turnquist
06e2564f66 DATAREST-623 - Added documentation on how to programmatically link to resource controllers.
Documented how to use RepositoryEntityLinks to link to Spring Data REST controllers.

Original pull request: #195.
2015-08-12 19:06:49 +02:00
Oliver Gierke
fc85586384 DATAREST-634 - Prepare 2.4.0.RC1 (Gosling RC1). 2015-08-04 13:12:25 +02:00
Oliver Gierke
4cedd71de7 DATAREST-634 - Updated changelog. 2015-08-04 13:12:25 +02:00
Greg Turnquist
5dac9eac0c DATAREST-624 - Added reference documentations for Spring Data REST HAL Browser.
Original pull request: #193.
2015-08-04 01:57:53 +02:00
Oliver Gierke
dee22d2726 DATAREST-628 - Updated changelog. 2015-07-28 16:46:16 +02:00
Cedric Ziel
22b2984ce6 DATAREST-596 - Add missing letter to MVC configuration import example 2015-07-09 18:50:50 +02:00
Oliver Gierke
906d76a196 DATAREST-601 - Updated changelog. 2015-07-01 10:08:43 +02:00
Oliver Gierke
06b5a65de4 DATAREST-602 - Updated changelog. 2015-07-01 07:52:56 +02:00
Oliver Gierke
6cf9326c1d DATAREST-603 - Updated changelog. 2015-06-30 14:33:24 +02:00
Oliver Gierke
b5c95ae3d6 DATAREST-454 - Polishing.
Improved example headers to not expose we're referring to test code. Used inline code instead of bold for technical terms (HTTP methods, HTML attributes etc.).

Original pull request: #184.
2015-06-25 11:48:22 +02:00
Greg Turnquist
70f35cd314 DATAREST-454 - Document conditional operations.
Added documentation of ETag and Last-Modified header handling with Spring Data managed domain types.

Original pull request: #184.
2015-06-25 09:54:08 +02:00
Greg Turnquist
ea8baf642b DATAREST-397 - Added integration tests to verify Spring Data REST working with Spring Security.
Added integration tests to verify Spring Data REST works with Spring Security as expected. Added method level security to sample repositories and verified HTTP responses to consider those.

Added some words on security configuration in the reference documentation. This is also demonstrated by some canonical samples found in [0].

Original pull request: #171.

[0] https://github.com/spring-projects/spring-data-examples/issues/21
2015-06-23 18:11:12 +02:00
Greg Turnquist
ad75c3cc8e DATAREST-508 - Added details about finding projection definitions.
Original pull request: #176.
2015-06-13 18:06:52 +02:00