ContentNegotiationServiceOrgApacheCausewayV2

API

ContentNegotiationServiceOrgApacheCausewayV2.java
class ContentNegotiationServiceOrgApacheCausewayV2 {
  public static final String ACCEPT_PROFILE;     (1)
  Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedObject objectAdapter)     (2)
  Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedProperty objectAndProperty)     (3)
  Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedCollection managedCollection)     (4)
  Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedAction objectAndAction)     (5)
  Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ObjectAndActionInvocation objectAndActionInvocation)     (6)
  boolean canAccept(IResourceContext resourceContext)
}
1 ACCEPT_PROFILE

Unlike RO v1.0, use a single content-type of application/json;profile="urn:org.apache.causeway/v2" .

2 buildResponse(IResourceContext, ManagedObject)

Domain object is returned as a map with the RO 1.0 representation as a special '$$ro' property within that map.

3 buildResponse(IResourceContext, ManagedProperty)

Individual property of an object is not supported.

4 buildResponse(IResourceContext, ManagedCollection)

Individual (parented) collection of an object is returned as a list with the RO representation as an object in the list with a single property named '$$ro'

5 buildResponse(IResourceContext, ManagedAction)

Action prompt is not supported.

6 buildResponse(IResourceContext, ObjectAndActionInvocation)

Action invocation is supported provided it returns a single domain object or a list of domain objects (ie invocations returning void or scalar value are not supported). Action invocations returning a domain object will be rendered as a map with the RO v1.0 representation as a 'ro' property within (same as _#buildResponse(IResourceContext, ManagedObject)_ ), while action invocations returning a list will be rendered as a list with the RO v1.0 representation as a map object with a single 'ro' property (similar to #buildResponse(IResourceContext, ManagedCollection) )

Members

ACCEPT_PROFILE

Unlike RO v1.0, use a single content-type of application/json;profile="urn:org.apache.causeway/v2" .

The response content types RepresentationTypeSimplifiedV2 append the 'repr-type' parameter.

buildResponse(IResourceContext, ManagedObject)

Domain object is returned as a map with the RO 1.0 representation as a special '$$ro' property within that map.

buildResponse(IResourceContext, ManagedProperty)

Individual property of an object is not supported.

buildResponse(IResourceContext, ManagedCollection)

Individual (parented) collection of an object is returned as a list with the RO representation as an object in the list with a single property named '$$ro'

buildResponse(IResourceContext, ManagedAction)

Action prompt is not supported.

buildResponse(IResourceContext, ObjectAndActionInvocation)

Action invocation is supported provided it returns a single domain object or a list of domain objects (ie invocations returning void or scalar value are not supported). Action invocations returning a domain object will be rendered as a map with the RO v1.0 representation as a 'ro' property within (same as _#buildResponse(IResourceContext, ManagedObject)_ ), while action invocations returning a list will be rendered as a list with the RO v1.0 representation as a map object with a single 'ro' property (similar to #buildResponse(IResourceContext, ManagedCollection) )