Commit Graph

56 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
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
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
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
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
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
5346215d47 DATAREST-588 - Upgraded to Spring HATEOAS 0.18.0 to benefit from downstream fix. 2015-06-19 16:56:55 +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
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