@RestResource(id="atg.commerce.order.restresources.OrderRestResource") public class OrderRestResource extends AbstractOrderRestResource
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
COMMA |
static java.lang.String |
ERR_NO_USER_ID_IN_REQUEST |
static java.lang.String |
FALSE |
static java.lang.String |
ITEM |
static java.lang.String |
TOTAL |
static java.lang.String |
TRUE |
COLON, mEmbeddedAppliedPromotionsRelationshipName, mEmbeddedResources, mGWPChoicesRelationshipName, mGwpManager, mOrderGWPInfoRelationshipName, mOrderManager, mTransactionManager, ORDER_ID, PIPELINE_RESULT, 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 |
---|
OrderRestResource() |
Modifier and Type | Method and Description |
---|---|
protected void |
addToRequestCache(java.lang.String pOrderId)
Request cache the Order for use by sub resources.
|
java.lang.Object |
getCommerceItems(java.lang.String pOrderId)
Returns the Commerce Items sub resource.
|
RepresentationModel |
getOrder(java.lang.String pOrderId)
Returns a representation of an Order for given order id.
|
javax.servlet.Servlet |
getOrderLookupDroplet()
Get the OrderLookupDroplet
|
java.lang.Object |
getPaymentGroupCommerceItemRelationships(java.lang.String pOrderId)
Returns the PaymentGroupCommerceItemRelationship sub resource.
|
java.lang.Object |
getPaymentGroupOrderRelationships(java.lang.String pOrderId)
Returns the PaymentGroupOrderRelationship sub resource.
|
java.lang.Object |
getPaymentGroups(java.lang.String pOrderId)
Returns the PaymentGroup subresource.
|
java.lang.Object |
getPaymentGroupShippingGroupRelationships(java.lang.String pOrderId)
Returns the PaymentGroupShippingGroupRelationship sub resource.
|
java.lang.String |
getProfilePath()
Returns property ProfilePath.
|
java.lang.Object |
getShippingGroupCommerceItemRelationships(java.lang.String pOrderId)
Returns the ShippingGroupCommerceItemRelationship sub resource.
|
java.lang.Object |
getShippingGroups(java.lang.String pOrderId)
Returns the ShippingGroup subresource.
|
boolean |
isSecurityEnabled()
Gets the property SecurityEnabled.
|
RepresentationModel |
listOrders(java.lang.String pUserId,
java.lang.String pState,
java.lang.String pOpenStates,
java.lang.String pClosedStates,
java.lang.String pSiteIds,
java.lang.String pOrganizationIds,
java.lang.String pSiteScope,
java.lang.String pOffset,
java.lang.String pLimit,
java.lang.String pOrderBy)
Retrieves Orders for the current user.
|
protected Order |
retrieveOrder(java.lang.String pOrderId)
Retrieve the Order for the given Order Id.
|
void |
setOrderLookupDroplet(javax.servlet.Servlet pOrderLookupDroplet)
Sets the OrderLookupDroplet
|
void |
setProfilePath(java.lang.String pProfilePath)
Sets property ProfilePath.
|
void |
setSecurityEnabled(boolean pSecurityEnabled)
Sets the property SecurityEnabled.
|
addEmbeddedResource, addEmbeddedResources, addEmbeddedResources, addGiftWithPurchaseChoicesLinks, checkPipelineResult, checkPipelineResult, createRepresentationModelBuilder, getEmbeddedAppliedPromotionsRelationshipName, getEmbeddedResources, getGWPChoicesRelationshipName, getGwpManager, getOrderGWPInfoRelationshipName, getOrderManager, getRepresentationModelBuilder, getTransactionManager, setEmbeddedAppliedPromotionsRelationshipName, setEmbeddedResources, setGWPChoicesRelationshipName, setGwpManager, setOrderGWPInfoRelationshipName, setOrderManager, setTransactionManager
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
public static final java.lang.String CLASS_VERSION
public static final java.lang.String ITEM
public static final java.lang.String TOTAL
public static final java.lang.String ERR_NO_USER_ID_IN_REQUEST
public static final java.lang.String COMMA
public static final java.lang.String FALSE
public static final java.lang.String TRUE
public void setSecurityEnabled(boolean pSecurityEnabled)
pSecurityEnabled
- flag to enable security checkingpublic boolean isSecurityEnabled()
public void setProfilePath(java.lang.String pProfilePath)
pProfilePath
- path to the profile nucleus component. Usually atg/userprofiling/Profilepublic java.lang.String getProfilePath()
public javax.servlet.Servlet getOrderLookupDroplet()
public void setOrderLookupDroplet(javax.servlet.Servlet pOrderLookupDroplet)
pOrderLookupDroplet
- the OrderLookupDroplet@Endpoint(id="/orders/{orderId}#GET", isSingular=true, filterId="orders.id-Default") public RepresentationModel getOrder(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the order id of the order to retrieveRestException
- if a problem occurs retrieving the OrderCommerceException
@Endpoint(id="/orders/#GET", filterId="orders-Default") public RepresentationModel listOrders(java.lang.String pUserId, java.lang.String pState, java.lang.String pOpenStates, java.lang.String pClosedStates, java.lang.String pSiteIds, java.lang.String pOrganizationIds, java.lang.String pSiteScope, java.lang.String pOffset, java.lang.String pLimit, java.lang.String pOrderBy) throws RestException
There are options to filter the orders returned by Order State, Sites and Organizations.
Orders can be sorted using the orderBy param, e.g. propertyName:desc. This resource only supports sorting by one property name. The default direction is ascending, like all the framework's paged collections.
The orders will be paged based on the offset & limit params. If not set the paging settings will default to 0 and 30 (or the orderLookup's defaultNumOrders setting).
Null is valid for all options. If all options are null an unsorted, paged set of orders for the current user will be returned (from 0 - defaultNumOrders).
Note that the getForUpdate param is not supported for this paged collection. The order results are always paged on retrieval therefore the output can not be used for a subsequent PATCH merge update as any non paged items will not be part of the output and so would be deleted.
pUserId
- The user Id on which to narrow the search by.pState
- Order State to narrow result set returned. Can be one of the
named order states OrderStates
or one of 2 virtual
states 'open' or 'closed'.pOpenStates
- comma separated list of open Order States. This is
ignored if pState is not 'open'. If null and pState
is 'open' pre-configured list of open states is used.pClosedStates
- comma separated list of closed Order States. This is
ignored if pState is not 'closed'. If null and pState
is 'closed' pre-configured list of closed states is used.pSiteIds
- comma separated list of Site ids to narrow result set returned.pOrganizationIds
- comma separated list of Organization ids to narrow result set returned.pSiteScope
- the site scope to narrow result set returned. Can be 'all',
'current' or a shareable type ID such as "atg.ShoppingCart".
This is ignored if pSiteIds is specified.pOffset
- the page start indexpLimit
- the page sizepOrderBy
- the Order repository item property to sort results by,
direction defaults to ascending unless ':desc' is specified.RestException
@SubresourceLocator(subresourceIds="atg.commerce.order.restresources.CommerceItemRestSubresource") public java.lang.Object getCommerceItems(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the parent Order IdRestException
- if a problem occurs obtaining the sub resourceCommerceException
- if fails to load order or fails to check if the order exists.@SubresourceLocator(subresourceIds="atg.commerce.order.restresources.PaymentGroupRestSubresource") public java.lang.Object getPaymentGroups(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the parent Order IdRestException
- if a problem occurs obtaining the subresourceCommerceException
- if fails to load order or fails to check if the order exists.@SubresourceLocator(subresourceIds="atg.commerce.order.restresources.ShippingGroupRestSubresource") public java.lang.Object getShippingGroups(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the parent Order IdRestException
- if a problem occurs obtaining the subresourceCommerceException
- if fails to load order or fails to check if the order exists.@SubresourceLocator(subresourceIds="atg.commerce.order.restresources.ShippingGroupCommerceItemRelationshipRestSubresource") public java.lang.Object getShippingGroupCommerceItemRelationships(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the parent Order IdRestException
- if a problem occurs obtaining the sub resourceCommerceException
- if fails to load order or fails to check if the order exists.@SubresourceLocator(subresourceIds="atg.commerce.order.restresources.PaymentGroupCommerceItemRelationshipRestSubresource") public java.lang.Object getPaymentGroupCommerceItemRelationships(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the parent Order IdRestException
- if any problem occurs obtaining the sub resourceCommerceException
- if fails to load order or fails to check if the order exists.@SubresourceLocator(subresourceIds="atg.commerce.order.restresources.PaymentGroupOrderRelationshipRestSubresource") public java.lang.Object getPaymentGroupOrderRelationships(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- id of the order containing the paymentGroup Order relationshipsRestException
- if any problem occurs obtaining the sub resourceCommerceException
- if fails to load order or fails to check if the order exists.@SubresourceLocator(subresourceIds="atg.commerce.order.restresources.PaymentGroupShippingGroupRelationshipRestSubresource") public java.lang.Object getPaymentGroupShippingGroupRelationships(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- id of the order containing the paymentGroup ShippingGroup relationshipsRestException
- if any problem occurs obtaining the sub resourceCommerceException
- if fails to load order or fails to check if the order exists.protected void addToRequestCache(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the parent Order IdRestException
- if there is a problem obtaining the OrderCommerceException
- if fails to load order or fails to check if the order exists.protected Order retrieveOrder(java.lang.String pOrderId) throws RestException, CommerceException
pOrderId
- the Order Id to retrieveRestException
- if there is a problem retrieving the OrderCommerceException
- if fails to load order or fails to check if the order exists.