The following section describes Core Commerce-specific modifications made to your configured statelessness framework.
Core Commerce-specific cart endpoints and sub-resource locator methods call the setupCartStateRequestData
method of CartRestResource
to set up the cart state request data so that it can be added to the body of the HTTP response.
When shopping cart data is added to a request, the framework puts it in the body of the HTTP response, as described above. The CartStateService
class adds shopping cart data to a data map, allowing the framework to add to the body of a response using the cartState
key.
The RequestStateManager
uses the keyToValidatorId
to indicate what to look for in the request map. Note that the prefix atg.service.jaxrs
is prepended to cartState
. The RequestStateManager
also contains a key/value pair that points to the OrderLoadableService
component that sets up the shopping cart; this is the keyToLoadableServicePath
.
keyToValidatorId=\ atg.service.jaxrs.cartState=cart-representation keyToLoadableServicePath=\ atg.service.jaxrs.cartState=/atg/commerce/order/OrderLoadableService
When the cart state is passed in a request, the framework uses the cartState-representation
validator in the DCS/configlayers/stateless/atg/dynamo/service/payloadSchema.xm
l to retrieve and reconstruct the order object.
The CommerceProfileLoadableService
component saves and reconstructs profile properties for the response. This component overrides the loadService
method and returns a map of profile properties needed to reload the profile on subsequent requests.
The OrderLoadableService
accepts reconstructed order objects that have been created by the framework and sets them as the current order.