@RestResource(id="atg.commerce.order.restresources.CartShippingGroupRestSubresource") public class CartShippingGroupRestSubresource extends ShippingGroupRestSubresource implements UpdateableRestResource
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
COMMERCE_ITEM_ID |
static java.lang.String |
QUANTITY |
static java.lang.String |
RELATIONSHIPS |
static java.lang.String |
SHIPPING_GROUP_ID |
ERR_SHIPPING_GROUP_NOT_FOUND
DEFAULT_PAGE_SIZE, mEmbeddedCommerceItemRelationshipName, mEmbeddedPaymentGroupRelationshipName, mEmbeddedShippingGroupRelationshipName, RESOURCE_NAME, sResourceBundle
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
CartShippingGroupRestSubresource() |
Modifier and Type | Method and Description |
---|---|
RepresentationModel |
addShippingGroup(org.json.JSONObject pInputJson)
Add a new shipping group to the current order.
|
java.lang.Object |
deleteShippingGroup(java.lang.String pShippingGroupId)
Removes the shippingGroup from the current order based on the shippingGroupId
As the sub-resource delete can affect the top-level resource details, e.g.
|
CommerceItemManager |
getCommerceItemManager()
returns the commerce item manager
|
RepresentationModel |
relateToItems(org.json.JSONObject pInputJson)
Creates/modifies relationships between commerce items and shipping groups.
|
void |
setCommerceItemManager(CommerceItemManager pCommerceItemManager)
sets the commerce item manager
|
java.net.URI |
update(atg.service.jaxrs.ResourceUpdateInfo pUpdateInfo)
Updates the ShippingGroups in the Cart.
|
protected void |
updateOrder(Order pOrder)
Updates the order
|
RepresentationModel |
updateShippingGroup(java.lang.String pShippingGroupId,
org.json.JSONObject pInputJson)
Updates a shipping group associated with the current order
|
RepresentationModel |
updateShippingGroups(org.json.JSONObject pInputJson)
This endpoint removes, updates or creates the shipping groups as part of the collection update.
|
checkShippingGroupIsAvailableForOrder, getOrderManager, getShippingGroup, getShippingGroup, getShippingGroupManager, getShippingGroups, getShippingMethods, setOrderManager, setShippingGroupManager
addCreatedItemUri, buildMemberUris, getCartUri, getCreatedItemUri, getDefaultLimit, getEmbeddedCartRelationshipName, getEmbeddedCommerceItemRelationshipName, getEmbeddedPaymentGroupRelationshipName, getEmbeddedShippingGroupRelationshipName, getOrder, getRelationshipCreated, getRelationships, getRepresentationModelBuilder, getRepresentationModelBuilder, getRepresentationModelBuilderWithCart, getRepresentationModelBuilderWithCart, getRepresentationModelBuilderWithPaging, getSelfLink, setDefaultLimit, setEmbeddedCartRelationshipName, setEmbeddedCommerceItemRelationshipName, setEmbeddedPaymentGroupRelationshipName, setEmbeddedShippingGroupRelationshipName
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
updateEmbeddedResources
public static final java.lang.String CLASS_VERSION
public static final java.lang.String SHIPPING_GROUP_ID
public static final java.lang.String COMMERCE_ITEM_ID
public static final java.lang.String RELATIONSHIPS
public static final java.lang.String QUANTITY
public CommerceItemManager getCommerceItemManager()
public void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
pCommerceItemManager
- new commerce item manager@Endpoint(id="/shippingGroups#POST", validatorId="shippingGroups.id-FullWithCart", updateTarget=true) public RepresentationModel addShippingGroup(org.json.JSONObject pInputJson) throws RestException, CommerceException
pInputJson
- A JSONObject that contains the ShippingGroupType (type - eg hardgoodShippingGroup,
electronicShippingGroup) and subsequent details that are specific for that particular typeRestException
- if any internal error occurs whilst adding a new shipping groupCommerceException
- if any internal error occurs whilst adding a new shipping group@Endpoint(id="/shippingGroups/{shippingGroupId}#DELETE", isSingular=true, filterId="shippingGroups-Delete") public java.lang.Object deleteShippingGroup(java.lang.String pShippingGroupId) throws RestException, CommerceException
pShippingGroupId
- Id of the shippingGroup to be removed from the current orderRestException
- if any internal error occurs while removing the shippingGroupCommerceException
- if any error removing the shippingGroup from the current order@PATCH @Endpoint(id="/shippingGroups/{shippingGroupId}#PATCH", isSingular=true, validatorId="shippingGroups.id-Full", filterId="shippingGroups.id-FullWithCart", updateTarget=true) public RepresentationModel updateShippingGroup(java.lang.String pShippingGroupId, org.json.JSONObject pInputJson) throws RestException, CommerceException
pShippingGroupId
- id of shipping group to updatepInputJson
- representation of shipping group updates to applyRestException
- if an internal server error occurs while updating the shipping groupCommerceException
@PATCH @Endpoint(id="/shippingGroups#PATCH", validatorId="shippingGroups-Full", filterId="shippingGroups-DefaultWithCart", updateTarget=true) public RepresentationModel updateShippingGroups(org.json.JSONObject pInputJson) throws RestException, CommerceException
pInputJson
- JSON representation of the shipping groups to be updatedRestException
- if an internal server error occurs while updating the shipping groups in the orderCommerceException
- if an internal server error occurs while updating the shipping groups in the order@Endpoint(id="/shippingGroups/relateToItems#POST", linkRelation="relateToItems", validatorId="shippingGroups.relateToItems", filterId="shippingGroups-DefaultWithCart", updateTarget=true) public RepresentationModel relateToItems(org.json.JSONObject pInputJson) throws RestException, CommerceException
{
"relationships" : [
{
"commerceItemId" : "ci5436",
"shippingGroupId" : "sg3943",
"quantity" : 2
},
{
"commerceItemId" : "ci9349",
"shippingGroupId" : "sg2293",
"quantity" : 9
},
...
]
}
pInputJson
- A JSONObject that contains the relationships to setup/modify.RestException
- if an error with the input data, e.g. missing dataCommerceException
- if any internal error occurs while creating/updating
commerce item to shipping group relationshippublic java.net.URI update(atg.service.jaxrs.ResourceUpdateInfo pUpdateInfo) throws RestException
update
in interface UpdateableRestResource
pUpdateInfo
- - update object containing request input and any existing
repository (shipping groups) data to be updatedRestException
- - if an issue occurs performing the updateprotected void updateOrder(Order pOrder) throws CommerceException
pOrder
- the current order to be updatedCommerceException
- if an error occurs while updating the Order