HTTP GET com.mycompany.myapp.Order|123/placeOrder

Returns details of action, parameters, parameter defaults and choices. This is a superset of the information returned in GET on an Object for the action, because it contains parameter names, defaults and choices.

Returns:

  • 200 "OK"
    • object was found, and action was found
    • body will contain representation described below
  • 404 "Not Found"
    • either the object was not found or the action was not found
    • body will be empty
{
  "_self": { 
    "link": {
      "rel": "_self.link",
      "href": "http://localhost:8080/com.mycompany.myapp.Order|123/placeOrder",
      "method": "get",
    },
    "memberType": "action",
    "object": {
      "rel": "_self.object",
      "href": "http://localhost:8080/com.mycompany.myapp.Order|123",
      "method": "get",
    }
  },
  "type": {
    "rel": "type",
    "href": "http://localhost:8080/types/application/vnd+com.mycompany.myapp.DeliveryConfirmation"
    "method": "get"
  },
  "numParameters": 3,
  "parameters": {
    "confirmDetails": {
       "type": { ... },
       "choices": [ ... ],
       "default": { ... },
       ...
    },
    "param2": {
       "type": { ... },
       "choices": [ ... ],
       "default": { ... },
       ...
    },
    "param3": {
       "type": { ... },
       "choices": [ ... ],
       "default": { ... },
       ...
    }
  },
  "validateArg": {
    "rel": "validateArg",
    "href": "http://localhost:8080/com.mycompany.myapp.Order|123/placeOrder",
    "method": "put",
  },
  "invoke": {
    "rel": "invoke",
    "href": "http://localhost:8080/com.mycompany.myapp.Order|123/placeOrder/invoke",
    "method": "post",
  },
  "invokeIdempotent": {
    "rel": "invokeIdempotent",
    "href": "http://localhost:8080/com.mycompany.myapp.Order|123/placeOrder/invoke",
    "method": "get",
  },
  ...
}

Notes

  • "choices" and "default" attributes for parameters are optional
  • the representation may also include other standard Isis/NOF attributes (disabled, name, helpText etc)
    • this is true for action parameters as well as actions
  • the "validateArg" attribute specifies the URL for validating one or more args
  • the "invokeIdempotent" attribute will only be present if the framework determines that the action is idempotent

HTTP GET com.mycompany.myapp.Order|123/com.mycompany.myapp.CustomerRepository/placedBy (contributed action)

Contributed actions appear as if they belong to the resource/domain object, but are actually invoked on a domain service with one of the parameter arguments set to the domain object.

To support this, the "_self.object" attribute will actually refer to the domain service that contributed the object, while the one of the parameters will have also have a "value" set to the domain object.

For example, supposing that the CustomerRepository has an action "placedBy(Order)" which is used to locate the customer that placed a particular Order. This would be represented as follows:

{
  "_self": { 
    "link": {
      "rel": "_self.link",
      "href": "http://localhost:8080/com.mycompany.myapp.Order|123/com.mycompany.myapp.CustomerRepository/placedBy",
      "method": "get",
    },
    "memberType": "action",
    "object": {
      "rel": "_self.object",
      "href": "http://localhost:8080/com.mycompany.myapp.CustomerRepository|1",
      "method": "get",
    }
  },
  "type": {
    "rel": "type",
    "href": "http://localhost:8080/types/application/vnd+com.mycompany.myapp.Customer"
    "method": "get"
  },
  "numParameters": 1,
  "parameters": {
    "order": {
       "value": { 
         "rel": "parameters.1.value",
         "href": "http://localhost:8080/types/application/vnd+com.mycompany.myapp.Order|123"
         "method": "get"
       },
       "type": { 
         "rel": "parameters.1.type",
         "href": "http://localhost:8080/types/application/vnd+com.mycompany.myapp.Order"
         "method": "get"
       },
       ...
    }
  },
  "validateArg": {
    "rel": validateArg",
    "href": "http://localhost:8080/com.mycompany.myapp.CustomerRepository|1/placedBy",
    "method": "put",
  },
  "invoke": {
    "rel": "invoke",
    "href": "http://localhost:8080/com.mycompany.myapp.CustomerRepository|1/placedBy/invoke",
    "method": "post",
  },
  "invokeIdempotent": {
    "rel": "invokeIdempotent",
    "href": "http://localhost:8080/com.mycompany.myapp.CustomerRepository|1/placedBy/invoke",
    "method": "get",
  },
  ...
}

Notes:

  • the "_self.object" link is the same as the "contributedFrom" link in the action's representation within GET on an Object
  • No labels