Commit Graph

41 Commits

Author SHA1 Message Date
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
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
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
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
8cbd952d88 DATAREST-483 - Upgrade to JSONPath 0.9.1 and Spring HATEOAS 0.17.0 snapshots. 2015-03-02 17:41:02 +01:00
Spring Buildmaster
7f4c97bf0a DATAREST-418 - Prepare next development iteration. 2014-12-01 04:29:46 -08:00
Spring Buildmaster
aa30ac65ec DATAREST-418 - Release version 2.3.0.M1. 2014-12-01 04:29:44 -08:00
Spring Buildmaster
648a50a2c1 DATAREST-380 - Prepare next development iteration. 2014-09-05 03:56:17 -07:00
Spring Buildmaster
31b689a566 DATAREST-380 - Release version 2.2.0.RELEASE (Evans GA). 2014-09-05 03:56:15 -07:00
Oliver Gierke
e4942c74ff DATAREST-380 - Prepare 2.2.0.RELEASE (Evans GA). 2014-09-05 12:49:12 +02:00
Spring Buildmaster
78ec4a8771 DATAREST-374 - Prepare next development iteration. 2014-08-13 07:27:55 -07:00
Spring Buildmaster
37a5300e87 DATAREST-374 - Release version 2.2.0.RC1 (Evans RC1). 2014-08-13 07:27:52 -07:00
Oliver Gierke
2d64fb4d84 DATAREST-326 - Improved configuration setup for better Boot compatibility.
We now don't expose the PersistentEntityJackson2Module as bean anymore to prevent global registration in case of a Boot setup. The HttpMessageConverters registered are now TypeConstrainedMappingJackson2HttpMessageConverters so that they only get used of the object to marshal is of type ResourceSupport.
2014-07-25 16:33:07 +02:00
Spring Buildmaster
9e1c607abb DATAREST-350 - Prepare next development iteration. 2014-07-10 20:35:04 +02:00
Spring Buildmaster
527d2391ce DATAREST-350 - Release version 2.2.0.M1. 2014-07-10 20:35:04 +02:00
Oliver Gierke
12d2b813cc DATAREST-350 - Upgraded to Spring HATEOAS 0.15.0.RELEASE. 2014-07-10 17:07:56 +02:00
Oliver Gierke
bffa378bc5 DATAREST-350 - Upgraded to Spring HATEOAS 0.15.0.BUILD-SNAPSHOT. 2014-07-08 21:08:10 +02:00
Oliver Gierke
65c95d9068 DATAREST-351 - Upgraded to Evo Inflector 1.2.
This is mainly to prevent users from running into Java 6 incompatibility as the Evo library was accidentally compiled requiring Java 7 compatibility in version 1.1.
2014-07-08 17:01:26 +02:00
Oliver Gierke
b9aef87e05 DATAREST-337 - Fix trailing whitespace in poms. 2014-07-08 14:05:24 +02:00
Oliver Gierke
0dabf8d376 DATAREST-341 - Upgraded to Spring HATEOAS 0.14.0.RELEASE. 2014-06-30 14:08:55 +02:00
Oliver Gierke
3969c34940 DATAREST-317 - Support for excerpt projections.
This commit adds a mechanism to define excerpt projections to be rendered for exposed repositories. The main user facing mechanism is the addition of the excerptProjection attribute to @RepositoryRestResource. This attribute takes a type which has to be a projection interface (see DATAREST-221 for more information about the general mechanism).

If such a excerpt projection is in place, it will be used by default when rendering instances of the domain type in _embedded clauses or if it is related to.

class Person {

  String name;
  int age;
  Person father;
  Person mother;
  Set<Person> siblings:
}

interface PersonExcerpt {
  String getName();
}

If PersonExcerpt is now configured as excerpt projection for Person the collection resource for people will return:

{ _embedded : {
    people : [{
      name : "Some name",
      _embedded : {
        mother : { name : "…" },
        father : { name : "…" },
        siblings : [ … ]
      },
      _links : { self : { href : "…" }}
    }, … ]
  }
}

Here you can see how the age property is omitted when rendering a person in a collection. Also each person contains the excerpt projections of related resources and the links to them omitted. If you now follow the link to the item resource, you'll something like this:

{ name : "Some name",
  age : 34,
  _embedded : {
    mother : { name : "…" },
    father : { name : "…" },
    siblings : [ … ]
  },
  _links : {
    self : { href : "…" },
    mother : { href : "…" },
    father : { href : "…" },
    siblings : { href : "…" }
  }
}

Note, that age appears, as the representation is now rendered entirely. We also see the excerpts of related resource but also the links pointing to them in case you want to manage them.
2014-06-12 13:16:12 +02:00
Spring Buildmaster
2db0203817 DATAREST-306 - Prepare next development iteration. 2014-05-20 20:04:39 +02:00
Spring Buildmaster
c67f79d5ae DATAREST-306 - Release version 2.1.0.RELEASE. 2014-05-20 20:04:39 +02:00
Oliver Gierke
e9e4da3062 DATAREST-306 - Prepare 2.1 GA. 2014-05-20 20:04:32 +02:00
Spring Buildmaster
cafa6f7931 DATAREST-297 - Prepare next development iteration. 2014-05-02 06:15:33 -07:00
Spring Buildmaster
5693af6f2a DATAREST-297 - Release version 2.1.0.RC1. 2014-05-02 06:15:31 -07:00
Oliver Gierke
358ff1bda8 DATAREST-297 - Prepare 2.1.0.RELEASE.
Upgraded to Spring HATEOAS 0.11.0, Spring Plugin 1.1.0 and Evo Inflector 1.1.
2014-05-01 20:52:29 +02:00
Spring Buildmaster
d0ccd7251d DATAREST-257 - Prepare next development iteration. 2014-03-31 08:33:17 -07:00
Spring Buildmaster
b5b5b94f01 DATAREST-257 - Release version 2.1.0.M1. 2014-03-31 08:33:14 -07:00
Oliver Gierke
af7e15b8e6 DATAREST-221 - Added support for projections.
This commit introduces support to access resources via projections, which means naming a dedicated set of properties of the entity to be exposed and being able to refer to that set through a request parameter.

## General usage

Projections are defined as interfaces that mimic the properties of the domain class to be exported:

@Projection(types = Customer.class, name = "summary")
interface Summary {
  String getFirstname();
  String getLastname();
  AddressSummary getAddress();
}

interface AddressSummary() {
  String getZipCode();
}

The projection interface can be annotated with @Projection to be auto-discovered. We scan all packages in which we find domain types to be exported for projection types and auto-register them. For manual registration, use RepositoryRestConfiguration.projectionDefinitionConfiguration().addProjection(…) and manually register them.

If a projection is registered for a given type, this will be indicated via a "projection" template variable in the URI pointing to resources with projections. The name of the variable can also be configured on ProjectionDefinitionConfiguration.

## Internals

The projection interfaces are consider bean property delegates by default. This means, that for the above interfaces we will lookup the firstname, lastname and address property of the projection target. In the case of address we re-project the result of the proxy target invocation with a sub-projection onto AddressSummary.

For more advanced use-cases you can annotate a method of the projection interface with @Value and use a SpEL expression to invoke further functionality and return that to be rendered:

interface MyProjection {

  @Value("#{@myBean.someMethod(target)}")
  SubProjection getValue();
}

This projection would call the someMethod(…) method on a Spring bean named myBean handing the proxy target to the method. The result will be projected in turn onto a type called SubProjection.

As the projection objects are exposed to Jackson as is, they can be annotated with Jackson annotations to further customize the representation.
2014-02-27 08:48:58 +01:00
Spring Buildmaster
b16b2e0ec6 DATAREST-249 - Prepare next development iteration. 2014-02-25 07:45:29 +01:00
Spring Buildmaster
fb73b52be7 DATAREST-249 - Release version 2.0.0.RELEASE. 2014-02-24 10:00:15 -08:00
Spring Buildmaster
84880ffe5e DATAREST-226 - Prepare next development iteration. 2014-01-29 06:40:33 -08:00
Spring Buildmaster
3a87ad8d49 DATAREST-226 - Release version 2.0.0.RC1. 2014-01-29 06:40:30 -08:00
Oliver Gierke
20a407d40c DATAREST-226 - Prepare 2.0 RC1 release.
Upgraded to Spring Data RC modules, Spring HATEOAS 0.9.0.RELEASE and Spring Plugin 1.0.0.RELEASE. Removed placeholder for Jackson 2 version as it's in the parent build pom now. Switched to milestone repository.
2014-01-29 15:35:46 +01:00
Oliver Gierke
88b2f05edf DATAREST-229 - RepositoryEntityLinks now exposes templated links.
If the resource exposed for a domain or repository type is considered a paging resource we now return a templated URI. Introduced ResourceMapping.isPagingResource() to allow clients to find out about whether the resource is actually capable of pagination. Adapted implementations to inspect the findAll(…) method as well as the search methods for a Pageable parameter.

Tweaked pom.xml to create correct classpaths if the IDE uses direct workspace project references.
2014-01-23 17:11:34 +01:00
Oliver Gierke
f02000e619 DATAREST-224 - Introduce Maven POMs.
Adapted JpaWebTests to compile on Java6. Fixed some broken test case in Neo4jWebTests.
2014-01-20 10:18:44 +01:00