public class AbstractCatalogRestResource extends AbstractItemLookupRestResource
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
COLLECTION_MISSING_INPUT_PARAMS, COLLECTION_PARENT_ITEM_NOT_FOUND, COLLECTION_PARENT_REPOSITORY_NOT_FOUND, COLLECTION_PROPERTY_INVALID, COLLECTION_PROPERTY_NOT_FOUND, COLLECTION_SORT_SIZE, COMMA, DEFAULT_PAGE_SIZE, ID, INVALID_QUERY_PARAMS, ITEM, ITEM_DESCRIPTOR_NOT_SUPPLIED, ITEM_NOT_FOUND, mEmbeddedRelationshipToResourceId, mRepository, PARENT_ITEM_ID, PARENT_ITEM_TYPE, PARENT_PROPERTY_NAME, REQUEST_DATA_KEY_PREFIX, RESOURCE_NAME, SEPARATOR, sResourceBundle, UNEXPECTED_ERROR
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 |
---|
AbstractCatalogRestResource() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
buildInputs(java.lang.String pItemId,
java.lang.Boolean pFilterByCatalogFlag,
java.lang.Boolean pFilterBySiteFlag,
java.lang.String pSiteId)
Helper method to build the inputs that will be passed in as params to the
|
void |
embedParentCategory(RepresentationModel.Builder pBuilder,
RepositoryItem pItem,
java.lang.String pRelationshipName)
Embed the parentCategory resource for the item and relationship name passed in
|
CustomCatalogTools |
getCatalogTools()
Get CatalogTools used for manipulating catalog data
|
RepositoryItem |
getItem(java.lang.String pItemId,
java.lang.Boolean pFilterByCatalogFlag,
java.lang.Boolean pFilterBySiteFlag,
java.lang.String pSiteId)
Get the catalog item matching the id passed.
|
protected DropletInvoker |
postInvoker(DropletInvoker pInvoker,
java.util.Map<java.lang.String,java.lang.Object> pParams)
Catalog specific post processing required after the droplet is invoked.
|
protected DropletInvoker |
preInvoker(DropletInvoker pInvoker,
java.util.Map<java.lang.String,java.lang.Object> pParams)
Sets the catalog specific inputs parameters before invoking the CatalogItemLookupDroplet.
|
protected RepositoryItem |
retrieveItem(DropletInvoker pInvoker)
Retrieve item returned by the droplet.
|
void |
setCatalogTools(CustomCatalogTools pCatalogTools)
Sets CatalogTools for manipulating catalog data
|
addEmbeddedCollectionResource, addEmbeddedCollectionResources, buildInputs, generateRequestDataKey, getCollectionSortLimit, getDefaultLimit, getDroplet, getEmbeddedRelationshipToResourceId, getItem, getItemDescriptor, getParentRepositoryItem, getRepository, getRepresentationModelBuilder, listItems, listItems, listItems, retrieveRequestData, setCollectionSortLimit, setDefaultLimit, setDroplet, setEmbeddedRelationshipToResourceId, setItemDescriptor, setRepository, validateProperty
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 CustomCatalogTools getCatalogTools()
public void setCatalogTools(CustomCatalogTools pCatalogTools)
pCatalogTools
- the new CatalogToolspublic void embedParentCategory(RepresentationModel.Builder pBuilder, RepositoryItem pItem, java.lang.String pRelationshipName)
pBuilder
- the model builder used to embed the link.pItem
- the item (category/product) that has the parentCategory.pRelationshipName
- the relationship name of the embedded resource.public RepositoryItem getItem(java.lang.String pItemId, java.lang.Boolean pFilterByCatalogFlag, java.lang.Boolean pFilterBySiteFlag, java.lang.String pSiteId) throws RestException
pItemId
- the id of the catalog item to findpFilterByCatalogFlag
- if true only find the item if the item's catalog matches the users catalog.pFilterBySiteFlag
- if true only find the item if it matches siteId or the current site contextpSiteId
- the id of the site the item should belong tooRestException
- the rest exceptionprotected DropletInvoker preInvoker(DropletInvoker pInvoker, java.util.Map<java.lang.String,java.lang.Object> pParams)
preInvoker
in class AbstractItemLookupRestResource
pInvoker
- the invokerpParams
- the paramsprotected DropletInvoker postInvoker(DropletInvoker pInvoker, java.util.Map<java.lang.String,java.lang.Object> pParams) throws RestException
postInvoker
in class AbstractItemLookupRestResource
pInvoker
- the invokerpParams
- the paramsRestException
- the rest exceptionprotected RepositoryItem retrieveItem(DropletInvoker pInvoker)
For the storefront we don't support the profile's catalog not being set therefore generally the noCatalog oparam won't be encountered however as it's possible we handle it. It may be useful in an admin-style call where user/user's catalog may not be set. This behaviour can be overridden if required.
retrieveItem
in class AbstractItemLookupRestResource
pInvoker
- the invokerRestException
- the rest exceptionpublic java.util.Map<java.lang.String,java.lang.Object> buildInputs(java.lang.String pItemId, java.lang.Boolean pFilterByCatalogFlag, java.lang.Boolean pFilterBySiteFlag, java.lang.String pSiteId)
pItemId
- the item idpFilterBySiteFlag
- the filter by site flagpSiteId
- the site id