Bloomreach Commerce Accelerator Application Libraries

Info: This feature in Bloomreach Content requires a standard or premium license. Contact Bloomreach for details.

Overview

Bloomreach Commerce Accelerator includes pre-built components and templates for common commerce and content use cases. You can extend components as needed, and you can fully customize templates.

Components and Templates

The following table lists available components, their associated Java classes, and the corresponding Freemarker frontend templates. Each component entry links to detailed documentation.

Some components use regular delivery components, while others use command chain delivery components. For more information on command chain components, see the BRIEF Framework. Regular delivery components use component classes located in com.bloomreach.commercedxp.starterstore.components. Command chain delivery components use command classes with GenericCommandChainComponent, packaged in com.bloomreach.commercedxp.starterstore.commands.

Templates are located in your Bloomreach B2C Commerce Accelerator project at repository-data/webfiles/src/main/resources/site/freemarker/hstdefault. These templates are deployed to the content repository as web files.

ComponentJava Class(es)Freemarker Template(s)
AccountAccountFormComponentstarterstore-account.ftl
Category HighlightContentDecoratorCommandstarterstore-contentenricher.ftl, starterstore-carouselcontentenricher.ftl
CheckoutCheckoutComponentstarterstore-cartproductlist.ftl, starterstore-shipment.ftl, starterstore-payment.ftl, starterstore-order.ftl
Forgot CredentialsForgotCredentialsComponent, ResetCredentialsComponentstarterstore-forgot-form.ftl, starterstore-productlist-atc.ftl
Just For YouInitContextCommand, CartCreateCommand, CartProductListCommand, CartProductAddCommandstarterstore-productlist.ftl
LoginLoginFormComponentstarterstore-login-form.ftl
More Like ThisInitContextCommand, CartCreateCommand, CartProductListCommand, CartProductAddCommandstarterstore-productlist.ftl, starterstore-productlist-atc.ftl
Navigation MenuInitContextCommand, HstMenuCommandstarterstore-menu.ftl, starterstore-categories-menu.ftl
PixelLandingPagePixelSettingComponentLandingPagePixelSettingComponent.ftl (built-in)
Product DetailInitContextCommand, PersonalizationCallCommand, CommerceCallCommand, ContentEnricherCommandstarterstore-productdetail.ftl
Product HighlightInitContextCommand, CartCreateCommand, CartProductListCommand, CartProductAddCommandstarterstore-productcontentenricher.ftl, starterstore-carouselproductcontentenricher.ftl
Product GridInitContextCommand, CartCreateCommand, CartProductListCommand, CartProductAddCommandstarterstore-productlist.ftl, starterstore-productlist-atc.ftl
SearchInitContextCommand, CartCreateCommand, CartProductListCommand, CartProductAddCommandstarterstore-productsearch.ftl, starterstore-productlist.ftl, starterstore-facetlist.ftl
SignupSignupFormComponentstarterstore-signup.ftl
Tagged ContentTaggedContentComponentSee Product Grid

Commerce Connector SDK Support

Most components in Bloomreach Commerce Accelerator have been updated to support the Commerce Connector SDK. For details, see the Commerce Connector SDK API details. Components now interact with repository implementations and use bean models instead of JSON resources. These models wrap responses from e-commerce backends and provide a standardized way to access data, similar to content beans. This approach enables a more decoupled integration.

Version 2 remains compatible with the previous commerce connector definitions, which use mapping bundles. The earlier strategy is deprecated and will be removed in future releases. Components can detect whether a connector uses the Commerce Connector SDK or the legacy approach. You can use the following logic to determine the connector type:

@Override public void doBeforeRender(final HstRequest request, final HstResponse response) { super.doBeforeRender(request, response); // Obtain a decorated commerce connector instance final CommerceConnector commerceConnector = getDecoratingCommerceConnector(request, response); if (StringUtils.isBlank(commerceConnector.getModuleName())) { // If the connector module name field is blank, the commerce connector is compatible with v1 } else { // If the connector module name field contains the HST addon module name, // the commerce connector is based on the Commerce Connector SDK and compatible with v2 } }

The v2 connector definition introduces a "module name" field. Use this field to determine if the connector is v1 or v2.

Templates have also been refactored. For more information, see the Commerce Connector SDK introduction. Bloomreach Commerce Accelerator v2 simplifies template development by introducing several bean models. Developers can use these models directly and no longer need to extract data from JSON resources in templates.

To maintain backward compatibility with v1, the B2C Commerce Accelerator project includes new folders named v1 under repository-data/webfiles/src/main/resources/site/freemarker/hstdefault. These folders contain the legacy templates from v1. The rendering logic uses a fallback strategy to select the appropriate template. For example, for the Product Grid component, two templates are available:

  • repository-data/webfiles/src/main/resources/site/freemarker/hstdefault/starterstore-productlist.ftl
  • repository-data/webfiles/src/main/resources/site/freemarker/hstdefault/v1/starterstore-productlist.ftl

The Product Grid component references the template in the hstdefault folder. The template uses the following logic to determine which version to use:

<#if result??> // If the result is set, fall back to the old template definition <#include "v1/starterstore-productlist.ftl" /> <#elseif beanResult??> // If the beanResult is defined, fetch the related bean properties .. </#if>

Bloomreach Commerce Accelerator components can provide backend results to templates in two ways:

  1. By setting the result attribute.
  2. By setting the beanResult attribute.

If the result attribute is set, the component uses a v1 commerce connector. The result object is a JSON resource that must be processed in the template. If the beanResult attribute is set, the component uses the Commerce Connector SDK. The beanResult object is a commerce model that exposes all required data as properties.

This hybrid approach is temporary and will be removed when mapping bundle support is discontinued. Develop new templates using CommerceModel and the Commerce Connector SDK for future compatibility.

Share Feedback
Page: /frontend/commerce-accelerator/overview-setup/application-libraries
Section: Frontend
Category *