@RestResource(id="atg.commerce.order.restresources.CommerceItemRestSubresource") public class CommerceItemRestSubresource extends AbstractCommerceIdentifierRestSubresource
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
COMMERCE_ITEM_ID_PATH_PARAM |
static java.lang.String |
ERR_COMMERCE_ITEM_NOT_AVAILABLE_IN_ORDER |
protected java.lang.String |
mEmbeddedProductRelationshipName |
protected java.lang.String |
mEmbeddedSkuRelationshipName |
protected atg.commerce.promotion.GWPMarkerManager |
mGwpMarkerManager |
protected java.lang.String |
mItemGWPDiscountInfoRelationshipName |
protected java.lang.String |
mUnitPricesRelationshipName |
static java.lang.String |
REQUESTED_BEANS_QUERY_PARAM |
static java.lang.String |
UNITS |
static java.lang.String |
VIEW_QUERY_PARAM |
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 |
---|
CommerceItemRestSubresource() |
Modifier and Type | Method and Description |
---|---|
RepresentationModel |
getCommerceItem(java.lang.String pCommerceItemId,
java.lang.String pView,
java.lang.String pRequestedBeans)
Returns a representation of a commerce item from a given parent order.
|
protected CommerceItem |
getCommerceItemFromOrder(Order pOrder,
java.lang.String pCommerceItemId)
Return the given CommerceItem from the Order.
|
java.lang.String |
getEmbeddedProductRelationshipName()
Get the relationship name used for the embedded product resource.
|
java.lang.String |
getEmbeddedSkuRelationshipName()
Get the relationship name used for the embedded sku resource.
|
protected RepositoryItem[] |
getGiftWithPurchaseDetails(CommerceItem pCommerceItem)
This method returns the gift with purchase information associated
with a commerce item.
|
atg.commerce.promotion.GWPMarkerManager |
getGwpMarkerManager()
Getter for the GWP marker manager
|
java.lang.String |
getItemGWPDiscountInfoRelationshipName()
Return the relationship name of the item gwp discount info, defaults to 'giftWithPurchaseDiscountInfo'
|
protected RepresentationModel.Builder |
getRepresentationModelBuilder(java.lang.Object pState)
Gets the RepresentationModel.Builder with the given object acting as the state.
|
java.lang.String |
getUnitPriceBeanOverrideFilterId()
Returns the UnitPriceBeanOverrideFilterId property, used when view=units is selected.
|
protected java.util.List<atg.commerce.pricing.UnitPriceBean> |
getUnitPriceBeans(Order pOrder,
CommerceItem pCommerceItem,
java.lang.String pRequestedBeans)
Retrieves a list of UnitPriceBeans from the Order or CommerceItem.
|
java.lang.String |
getUnitPriceBeanStateMapKey() |
java.lang.String |
getUnitPricesRelationshipName()
Get the unit prices relationship name.
|
protected boolean |
isRequestedBeanToBeHandled(java.lang.String pRequestedBean)
Validation checks to ensure that requestBean has been set.
|
RepresentationModel |
listCommerceItems(java.lang.String pView,
java.lang.String pRequestedBeans,
java.lang.String pOffset,
java.lang.String pLimit,
java.lang.String pGetForUpdate)
For the given Order there are two possible return values driven by the value of the 'view' query parameter.
|
void |
setEmbeddedProductRelationshipName(java.lang.String pEmbeddedProductRelationshipName)
Configure the relationship name used for the embedded product resource.
|
void |
setEmbeddedSkuRelationshipName(java.lang.String pEmbeddedSkuRelationshipName)
Configure the relationship name used for the embedded sku resource.
|
void |
setGwpMarkerManager(atg.commerce.promotion.GWPMarkerManager pGwpMarkerManager)
Setter for the GWP marker manager
|
void |
setItemGWPDiscountInfoRelationshipName(java.lang.String pItemGWPDiscountInfoRelationshipName)
Configure the relationship name used for the item gift with purchase discount information
The configured name is used by the filter schema to display the property in the payload.
|
void |
setUnitPriceBeanOverrideFilterId(java.lang.String pUnitPriceBeanOverrideFilterId)
Sets the UnitPriceBeanOverrideFilterId property, used for when view=units is selected.
|
void |
setUnitPriceBeanStateMapKey(java.lang.String mUnitPriceBeanStateMapKey) |
void |
setUnitPricesRelationshipName(java.lang.String pUnitPricesRelationshipName)
Set the unit prices relationship name
|
addCreatedItemUri, buildMemberUris, getCartUri, getCreatedItemUri, getDefaultLimit, getEmbeddedCartRelationshipName, getEmbeddedCommerceItemRelationshipName, getEmbeddedPaymentGroupRelationshipName, getEmbeddedShippingGroupRelationshipName, getOrder, getRelationshipCreated, getRelationships, 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
public static final java.lang.String CLASS_VERSION
public static final java.lang.String UNITS
public static final java.lang.String COMMERCE_ITEM_ID_PATH_PARAM
public static final java.lang.String VIEW_QUERY_PARAM
public static final java.lang.String REQUESTED_BEANS_QUERY_PARAM
public static final java.lang.String ERR_COMMERCE_ITEM_NOT_AVAILABLE_IN_ORDER
protected atg.commerce.promotion.GWPMarkerManager mGwpMarkerManager
protected java.lang.String mItemGWPDiscountInfoRelationshipName
protected java.lang.String mEmbeddedProductRelationshipName
protected java.lang.String mEmbeddedSkuRelationshipName
protected java.lang.String mUnitPricesRelationshipName
public java.lang.String getUnitPriceBeanStateMapKey()
public void setUnitPriceBeanStateMapKey(java.lang.String mUnitPriceBeanStateMapKey)
public void setUnitPriceBeanOverrideFilterId(java.lang.String pUnitPriceBeanOverrideFilterId)
pUnitPriceBeanOverrideFilterId
- set the UnitPriceBeanOverrideFilterId property to this valuepublic java.lang.String getUnitPriceBeanOverrideFilterId()
Default filter id is unitPriceBean-Default.
public atg.commerce.promotion.GWPMarkerManager getGwpMarkerManager()
public void setGwpMarkerManager(atg.commerce.promotion.GWPMarkerManager pGwpMarkerManager)
pGwpMarkerManager
- GWPMarkerManagerpublic void setItemGWPDiscountInfoRelationshipName(java.lang.String pItemGWPDiscountInfoRelationshipName)
pItemGWPDiscountInfoRelationshipName
- the name of the item gwp discount info relationship namepublic java.lang.String getItemGWPDiscountInfoRelationshipName()
public void setEmbeddedProductRelationshipName(java.lang.String pEmbeddedProductRelationshipName)
pEmbeddedProductRelationshipName
- the name of the relationship to the embedded product resource.public java.lang.String getEmbeddedProductRelationshipName()
public void setEmbeddedSkuRelationshipName(java.lang.String pEmbeddedSkuRelationshipName)
pEmbeddedSkuRelationshipName
- the name of the relationship to the embedded sku resource.public java.lang.String getEmbeddedSkuRelationshipName()
public void setUnitPricesRelationshipName(java.lang.String pUnitPricesRelationshipName)
pUnitPricesRelationshipName
- the unit prices relationship namepublic java.lang.String getUnitPricesRelationshipName()
@Endpoint(id="/{commerceItemId}#GET", isSingular=true, linkRelation="getCommerceItem", filterId="commerceItems.id-Default") public RepresentationModel getCommerceItem(java.lang.String pCommerceItemId, java.lang.String pView, java.lang.String pRequestedBeans) throws RestException, CommerceException
#getUnitPriceBeanOverrideFilterId())
for configurable filter used in this case.pCommerceItemId
- - the commerce item to look up in the orderRestException
- if a problem occurs retrieving the commerce itemCommerceException
- if a problem occurs retrieving the commerce item@Endpoint(id="/{commerceItems}#GET", isSingular=false, linkRelation="getCommerceItems", filterId="commerceItems-Default") public RepresentationModel listCommerceItems(java.lang.String pView, java.lang.String pRequestedBeans, java.lang.String pOffset, java.lang.String pLimit, java.lang.String pGetForUpdate) throws RestException
pView
- the representation view to be returned.pRequestedBeans
- the kind of beans we wish to retrieve. Supported :
groupOnly - only generate beans for the quantities
of commerce items included in discount
groups.
allByGroup - generate price beans for all commerce
items whether grouped or not, but ordering
will take account of grouping where relevant.pOffset
- the page start indexpLimit
- the page sizepGetForUpdate
- flag indicating that the GET response will be used for
a subsequent PATCH merge. Used so framework knows to
output item ids before and after the paged collection
so that unpaged items will not be deleted from the
collection on the subsequent PATCH mergeRestException
- if a problem occurred whilst obtaining the commerce item informationprotected RepresentationModel.Builder getRepresentationModelBuilder(java.lang.Object pState) throws RestException
The product and sku are also embedded and gift with purchase information is included as additional state.
getRepresentationModelBuilder
in class AbstractCommerceIdentifierRestSubresource
pState
- the state that will be added to the representation modelRestException
protected RepositoryItem[] getGiftWithPurchaseDetails(CommerceItem pCommerceItem)
pCommerceItem
- The item to inspect for gwp information.protected java.util.List<atg.commerce.pricing.UnitPriceBean> getUnitPriceBeans(Order pOrder, CommerceItem pCommerceItem, java.lang.String pRequestedBeans) throws PricingException
pOrder
- - the Order on which to look up the UnitPriceBeans.pCommerceItem
- - the CommerceItem on which to look up the UnitPriceBeans.pRequestedBeans
- - the kind of beans we wish to retrieve. Supported :
groupOnly - only generate beans for the quantities
of commerce items included in discount
groups.
allByGroup - generate price beans for all commerce
items whether grouped or not, but ordering
will take account of grouping where relevant.RestException
- if a problem as occurred retrieving the UnitPriceBeans.PricingException
protected CommerceItem getCommerceItemFromOrder(Order pOrder, java.lang.String pCommerceItemId) throws RestException
pOrder
- - the Order on which to lookup the CommerceItem.pCommerceItemId
- - the commerce id of interest.RestException
- if there is a problem retrieving the CommerceItem from the Order (404 NOT FOUND).protected boolean isRequestedBeanToBeHandled(java.lang.String pRequestedBean)
pRequestedBean
- - the groupby details to be applied to the generation of UnitPriceBeans.