Catalog storefront services programming model
The search interface can be used for retrieving information for catalog entries or performing searches. The sample catalog programming model provides a consistent service-oriented architecture (SOA) based programming model for WebSphere Commerce storefronts. It uses the WebSphere Commerce search framework and the CatalogNavigationView search noun to move storefront catalog services from beans and service-oriented integration (SOI) to SOA.
WebSphere Commerce search as a search tool
- Auto-suggest menus for suggested keywords, categories, brands, site content, and search history.
- Auto-suggest lists for keywords.
- Automatic search term suggestions and spelling corrections.
- Search term highlighting.
- Structured and unstructured content in search results.
- Wildcard searching.
WebSphere Commerce search as a data store for the storefront
- It is faster than using a database, delivering performance gains.
- It can run on servers other than WebSphere Commerce, balancing the workload.
Search-based navigation enhances starter stores by triggering results when a shopper browses a storefront catalog. All immediate categories and products are returned in the results, and can also include its subcategories to increase its scope. With search-based navigation enabled, the storefront benefits include improved search performance and accuracy, search rules, and faceted navigation. As a result, the storefront delivers a perception of a personalized browsing experience in starter stores.
- Search term associations.
- Search-based merchandising rules.
- Starter stores integration by default.
The Catalog navigation noun that is used with the storefront Catalog service is called the CatalogNavigationView. This noun represents a business response of a catalog browsing request. It contains a list of subproducts, called CatalogEntryView, and a list of subcategories, called CatalogGroupView.
- Quick search
- Category-based navigation
- Faceted navigation
- Advanced search
- CatalogEntryDataBean
- ProductDataBean
- PackageDataBean
- DynamicKitDataBean
- BundleDataBean
- ItemDataBean
Catalog service overview
The product display page uses the getData tag and calls the catalog service. As WebSphere Commerce search is used to retrieve data, some of the information for the catalog entry is retrieved from the search engine and other information from the WebSphere Commerce database. The CatalogNavigationView noun is populated with data from both sources and returned in the service response. That data is then used to populate the product display page in the storefront.
Each element in the noun either comes from the search index or the database. Access profiles determine what information comes from the database, while search profiles determine what information comes from the index.
- Price
- Components
- MerchandisingAssociations
- Attributes
- DynamicKitURL
- DynamicKitDefaultConfiguration
- DynamicKitDefaultConfigurationComplete
- DynamicKitModelReference
- Title
- MetaDescription
- MetaKeyword
- FullImageAltDescription
- Price
- MetaData
- UserData
- Where Price data comes from depends on which price display mode is selected in the wc-search.xml file.
- MetaData is used internally.
- UserData is for you to perform customization.
All other elements come from the search index, where elements are added to the noun by either a mediator or results filters. Various filters are defined in the search profiles in the wc-search.xml file that pull in the extra data that is required by the product display page. The results filters use a combination of index queries, command calls, and service calls to add data to the new noun elements. When possible, the results filters use search profiles to retrieve the required information from the index or database. These profiles can then be modified to return additional information with no code changes.
Implementation overview
The CatalogNavigationView noun is implemented by using the BOD Programming model and uses the same implementation concepts.
Access profiles and search profiles
<wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType" var="catalogNavigationView"
expressionBuilder="getCatalogEntryViewDetailsByID" varShowVerb="showCatalogNavigationView" scope="request">
<wcf:param name="UniqueID" value="${catEntryID}" />
<wcf:contextData name="storeId" data="${WCParam.storeId}" />
<wcf:contextData name="catalogId" data="${WCParam.catalogId}" />
<wcf:param name="searchProfile" value="MySearchProfile"/>
</wcf:getData>
<_config:configgrouping name="AccessProfileToSearchProfileMapping">
<_config:property name="IBM_Store_Summary" value="IBM_findCatalogEntrySummary"/>
<_config:property name="IBM_Store_Details" value="IBM_findCatalogEntryDetails"/>
<_config:property name="IBM_Store_CatalogEntryAttachments" value="IBM_findCatalogEntryAttachments"/>
<_config:property name="IBM_Store_CatalogEntryDetailsWithAttachments"
value="IBM_findCatalogEntryDetailsWithAttachments"/>
<_config:property name="IBM_Store_CatalogEntryDetailsWithComponentsAndAttachments"
value="IBM_findCatalogEntryDetailsWithComponentsAndAttachments"/>
<_config:property name="IBM_Store_CatalogEntryDetailsWithMerchandisingAssociations"
value="IBM_findCatalogEntryDetailsWithMerchandisingAssocDetails"/>
<_config:property name="IBM_Store_CatalogEntryPrice" value="IBM_findCatalogEntryPrice"/>
<_config:property name="IBM_Store_CatalogEntryPriceWithAttributes"
value="IBM_findCatalogEntryPriceWithAttributes"/>
<_config:property name="IBM_Store_All" value="IBM_findCatalogEntryAll"/>
</_config:configgrouping>
Access profiles returned fields
The following table describes the access profiles and the respective fields returned by each profile.Access profile | Returned fields |
---|---|
IBM_Store_Summary | Catalog entries:
Catalog groups:
|
IBM_Store_Details |
Catalog entries: IBM_Store_Summary +
Catalog groups: IBM_Store_Summary +
|
IBM_Store_CatalogEntryDetailsWithAttachments | IBM_Store_Details +
|
IBM_Store_CatalogEntryDetailsWithComponentsAndAttachments | IBM_Store_CatalogEntryDetailsWithAttachments +
|
IBM_Store_CatalogEntryDetailsWithMerchandisingAssociations | IBM_Store_Details +
|
IBM_Store_All | IBM_Store_CatalogEntryDetailsWithComponentsAndAttachments +
|
IBM_Store_CatalogEntryAttachments |
|
IBM_Store_CatalogEntryPrice |
|
IBM_findCatalogEntryPriceWithAttributes | IBM_Store_CatalogEntryPrice +
|
Access profiles and their corresponding search profiles
Access profile | Search profile |
---|---|
IBM_Store_Summary | IBM_findCatalogEntrySummary |
IBM_Store_Details | IBM_findCatalogEntryDetails |
IBM_Store_CatalogEntryDetailsWithAttachments | IBM_findCatalogEntryDetailsWithAttachments |
IBM_Store_CatalogEntryDetailsWithComponentsAndAttachments | IBM_findCatalogEntryDetailsWithComponentsAndAttachments |
IBM_Store_CatalogEntryDetailsWithMerchandisingAssociations | IBM_findCatalogEntryDetailsWithMerchandisingAssocDetails |
IBM_Store_All | IBM_findCatalogEntryAll |
IBM_Store_CatalogEntryAttachments | IBM_findCatalogEntryAttachments |
IBM_Store_CatalogEntryPrice | IBM_findCatalogEntryPrice |
IBM_Store_CatalogEntryPriceWithAttributes | IBM_findCatalogEntryPriceWithAttributes |
Search profile inheritance
Search profile | Extends from |
---|---|
IBM_findCatalogEntrySummary | |
IBM_findCatalogEntryDetails | IBM_findCatalogEntrySummary |
IBM_findCatalogEntryDetailsWithAttachments | IBM_findCatalogEntryDetails |
IBM_findCatalogEntryDetailsWithComponentsAndAttachments | IBM_findCatalogEntryDetailsWithAttachments |
IBM_findCatalogEntryDetailsWithMerchandisingAssocDetails | IBM_findCatalogEntryDetails |
IBM_findCatalogEntryAll | IBM_findCatalogEntryDetailsWithComponentsAndAttachments |
IBM_findCatalogEntryAttachments | |
IBM_findCatalogEntryPrice | |
IBM_findCatalogEntryPriceWithAttributes | IBM_findCatalogEntryPrice |
IBM_findCatalogGroupSummary | |
IBM_findCatalogGroupDetails | IBM_findCatalogGroupSummary |
<!-- Search profile for IBM_findCatalogEntrySummary-->
<_config:profile indexName="CatalogEntry" name="IBM_findCatalogEntrySummary">
<_config:query>
<_config:param name="debug" value="false"/>
<_config:param name="maxRows" value="50"/>
<_config:param name="maxTimeAllowed" value="5000"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchProfileNameValidator"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchIndexNameValidator"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchIndexSynchronizer"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByStorePathExpressionProvider"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByPublishedEntryOnlyExpressionProvider"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchProductEntitlementExpressionProvider"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByCustomExpressionProvider"/>
<_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchExpressionValidator"/>
</_config:query>
<_config:result>
<_config:field name="catentry_id"/>
<_config:field name="storeent_id"/>
<_config:field name="buyable"/>
<_config:field name="partNumber_ntk"/>
<_config:field name="name"/>
<_config:field name="thumbnail"/>
<_config:field name="fullImage"/>
<_config:field name="shortDescription"/>
<_config:field name="longDescription"/>
<_config:field name="keyword"/>
<_config:field name="mfName_ntk"/>
<_config:field name="catenttype_id_ntk_cs"/>
</_config:result>
</_config:profile>
Expression builders
The UniqueIDsExpressionBuilder class is modified to support the searchProfile parameter, which can be passed in addition to the access profile. The search data mediator is modified to extract and add the UniqueID to the search query. One expression builder is created for each access profile and for both catentryID and partNumber.
Expression builder | Access profile |
---|---|
getCatalogEntryViewSummaryByID | IBM_Store_Summary |
getCatalogEntryViewSummaryByPartnumber | IBM_Store_Summary |
getCatalogEntryViewDetailsByID | IBM_Store_Details |
getCatalogEntryViewDetailsByPartnumber | IBM_Store_Details |
getCatalogEntryViewAttachmentsByID | IBM_Store_CatalogEntryAttachments |
getCatalogEntryViewAttachmentsByPartnumber | IBM_Store_CatalogEntryAttachments |
getCatalogEntryViewPriceByID | IBM_Store_CatalogEntryPrice |
getCatalogEntryViewPriceByPartnumber | IBM_Store_CatalogEntryPrice |
getCatalogEntryViewPriceWithAttributesByID | IBM_Store_CatalogEntryPriceWithAttributes |
getCatalogEntryViewPriceWithAttributesByPartnumber | IBM_Store_CatalogEntryPriceWithAttributes |
getCatalogEntryViewDetailsWithAttachmentsByID | IBM_Store_CatalogEntryDetailsWithAttachments |
getCatalogEntryViewDetailsWithAttachmentsByPartnumber | IBM_Store_CatalogEntryDetailsWithAttachments |
getCatalogEntryViewDetailsWithComponentsAndAttachmentsByID | IBM_Store_CatalogEntryDetailsWithComponentsAndAttachments |
getCatalogEntryViewDetailsWithComponentsAndAttachmentsByPartnumber | IBM_Store_CatalogEntryDetailsWithComponentsAndAttachments |
getCatalogEntryViewDetailsWithMerchandisingAssociationsByID | IBM_Store_CatalogEntryDetailsWithMerchandisingAssociations |
getCatalogEntryViewDetailsWithMerchandisingAssociationsByPartnumber | IBM_Store_CatalogEntryDetailsWithMerchandisingAssociations |
getCatalogEntryViewAllByID | IBM_Store_All |
getCatalogEntryViewAllByPartnumber | IBM_Store_All |
getCatalogNavigationCatalogGroupView | IBM_Store_Summary |
getCatalogNavigationCatalogGroupViewByIdentifier | IBM_Store_Summary |
getCatalogNavigationCatalogGroupViewByCatalogId | IBM_Store_Summary |
getCatalogNavigationCatalogGroupViewByParentCatalogGroup | IBM_Store_Summary |
XPath expression
The XPath for catalog entries is
/CatalogNavigationView[CatalogEntryView[ParentCatalogGroupID= and
(catalogEntryTypeCode=)]]
/CatalogNavigationView[CatalogGroupView[(UniqueID=)]]
/CatalogNavigationView[CatalogGroupView[(Identifier=)]]
/CatalogNavigationView/CatalogGroupView
/CatalogNavigationView[CatalogGroupView[(ParentCatalogGroupID=)]]
/CatalogNavigationView[CatalogEntryView[(UniqueID=)]]
/CatalogNavigationView[CatalogEntryView[(PartNumber=)]]
<_config:queryMapping indexName='CatalogEntry'
xpathKey='/CatalogNavigationView[CatalogEntryView[(UniqueID=)]]'
searchQuery='catentry_id:(?UniqueID?)'/>
<_config:queryMapping indexName='CatalogEntry'
xpathKey='/CatalogNavigationView[CatalogEntryView[(PartNumber=)]]'
searchQuery='partNumber_ntk:(?PartNumber?)'/>
<_config:queryMapping indexName="CatalogEntry"
searchQuery="parentCatgroup_id_search:?ParentCatalogGroupID? AND catenttype_id_ntk_cs:(?catalogEntryTypeCode?)
" xpathKey="/CatalogNavigationView[CatalogEntryView[ParentCatalogGroupID= and (catalogEntryTypeCode=)]]"/>
<_config:queryMapping indexName="CatalogGroup"
searchQuery="catgroup_id:(?UniqueID?)" xpathKey="/CatalogNavigationView[CatalogGroupView[(UniqueID=)]]"/>
<_config:queryMapping indexName="CatalogGroup"
searchQuery="identifier_ntk:(?Identifier?)" xpathKey="/CatalogNavigationView[CatalogGroupView[(Identifier=)]]"/>
<_config:queryMapping indexName="CatalogGroup"
searchQuery="parentCatgroup_id_facet:*_-1" xpathKey="/CatalogNavigationView/CatalogGroupView"/>
<_config:queryMapping indexName="CatalogGroup"
searchQuery="parentCatgroup_id_facet:(*_?ParentCatalogGroupID?)"
xpathKey="/CatalogNavigationView[CatalogGroupView[(ParentCatalogGroupID=)]]
" queryComposer="com.ibm.commerce.foundation.internal.server.services.search.processor.solr.SolrSearchQueryContainingAsteriskComposer"/>
The current control parameter for access control (_wcf.ap) is used to control access and details returned.
Search index changes
<field name="longDescription" type="string" indexed="false" stored="true" multiValued="false"/>
<field name="keyword" type="wc_text" indexed="true" stored="false" multiValued="false"/>
<field name="disallowRecOrder" type="int" indexed="false" stored="true" multiValued="false"/>
<field name="subscripType" type="string" indexed="false" stored="true" multiValued="false"/>
<field name="parentCatgroup_id_facet" type="wc_keywordText" indexed="true" stored="true" multiValued="true"/>
<field name="sequence" type="wc_keywordText" indexed="true" stored="true" multiValued="true" />
<_config:mediator-property name="CatalogEntryView/Attachments/Usage" value="rulename" />