ContentNegotiationServiceForRestfulObjectsV1_0

Returns representations according to theRestful Objectsspec.

API

ContentNegotiationServiceForRestfulObjectsV1_0.java
class ContentNegotiationServiceForRestfulObjectsV1_0 {
  ContentNegotiationServiceForRestfulObjectsV1_0(CausewayConfiguration configuration, SpecificationLoader specificationLoader)
  ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedObject objectAdapter)
  ResponseBuilder buildResponseTo(IResourceContext resourceContext, ManagedObject objectAdapter, JsonRepresentation representationIfAnyRequired, JsonRepresentation rootRepresentation)     (1)
  ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedProperty objectAndProperty)
  ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedCollection objectAndCollection)
  ResponseBuilder buildResponseTo(IResourceContext resourceContext, ManagedCollection objectAndCollection, JsonRepresentation representation, JsonRepresentation rootRepresentation)     (2)
  ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedAction objectAndAction)
  ResponseBuilder buildResponse(IResourceContext resourceContext, ObjectAndActionInvocation objectAndActionInvocation)
  ResponseBuilder buildResponseTo(IResourceContext resourceContext, ObjectAndActionInvocation objectAndActionInvocation, JsonRepresentation representation, JsonRepresentation rootRepresentation)     (3)
}

Members

buildResponseTo(IResourceContext, ManagedObject, JsonRepresentation, JsonRepresentation)

Not API

buildResponseTo(IResourceContext, ManagedCollection, JsonRepresentation, JsonRepresentation)

Not API

buildResponseTo(IResourceContext, ObjectAndActionInvocation, JsonRepresentation, JsonRepresentation)

Not API

Extensions

One extension (specific to Apache Causeway, not part of the RO spec) is that actions can also be invoked with an HTTP Accept header of the form:

application/json;profile=urn:org.restfulobjects:repr-types/object

If the action result returns a collection then this will automatically converted to a DomainObjectList view model. This can be useful for generic viewers.