Broadleaf Microservices
  • v1.0.0-latest-prod

Categories

Data Model

Category Data Model
Figure 1. Category and Related Entities Data Model

Categories

Categories provide a way to group related Products for merchandising, marketing, and search results. It has a URL customers can navigate to to browse its contents as well as additional SEO related fields like a meta title and description. A Category can also have related sub-categories.

BLC_CATEGORY

Field Description

ID

Unique row ID

CONTEXT_ID

Logical ID. Allows for sandbox versions.

ACTIVE_START_DATE

Start of when this category should be active.

ACTIVE_END_DATE

End when this category is not longer active. Unset indicates that it is always active

ATTRIBUTES

Dynamic attributes that are a part of the category. This is an admin-centered concept allowing additional information to be stored on a category without modifying the domain directly.

Name

Customer-facing name of this product.

URL

SEO-friendly URL to identify this category. This is usually generated with some URL-safe version of NAME.

DESCRIPTION

Description of the category that can include HTML to display to customers.

TAX_CODE

The tax code for all products in this category.

DISPLAY_TEMPLATE

Defines the display template. The display template can be used to help create a unique key that drives the presentation layer destination for this category. For example, if using Spring MVC with Thymeleaf, this could be a path to a Thymeleaf template. If using a frontend view technology like React, this could point to a specific React component.

META_TITLE

Used for SEO data in <title> tag in a category browse page. If this is unset, then NAME will be used.

META_DESCRIPTION

sed for SEO data in <meta description=""> in a category browse page. If this is unset, DESCRIPTION will be used.

PARENT_CATEGORY_CONTEXT_ID

Context ID of the parent Category if this is a sub-category.

PRODUCT_MEMBERSHIP_TYPE

Determines how this category defines membership of its products. Valid types include RULE_BASED (product membership in the category is determined by various criteria) or EXPLICIT (the related Products are specified using Category Products).

PRODUCT_MEMBERSHIP_RULE

If PRODUCT_MEMBERSHIP_TYPE is RULE_BASED, then this field contains the rule string, which should be RSQL format by default. Note that products may also be added explicitly when a rule is used.

SHOW_IN_SITE_MAP

This controls whether a category should be visible on the frontend display. An example use-case for setting this to false would be a category involving a "secret specials" page, which should be hidden from general navigation and search engines, but still has a valid URL that could be sent to customers.

EXTERNAL_ID

Intended to hold any unique identifier not tied to datastore where this category is stored. For example, many implementations may integrate or import/export data from other systems that manage their own unique identifiers.

Category Products

CategoryProducts represent a relationship between a Category and the Products it contains. This relationship affects what products show up in browse results when navigating to a Category by URL. This domain provides a primary flag to signify that the the Category referenced by it is the "primary" or "main" parent of the referenced Product.

BLC_CATEGORY_PRODUCT

Field Description

ID

Unique row ID

CONTEXT_ID

Logical ID. Allows for sandbox versions.

PRODUCT_CONTEXT_ID

Context ID of the related Product.

CATEGORY_CONTEXT_ID

Context ID of the owning Category.

IS_PRIMARY

Whether this is the "primary" or "main" parent Category of the related Product.

SORTING

Defines the sort order of the related Product relative to all others belonging to the Category.

Promotional Category Products

A join entity that associates Categories and Products to each other in a many to many relationship, including additional information about the association. This relationship is different from Category Products as it is marketing-focused and will not impact browse or search results. Typically this is used to specify featured, cross-sale, or up-sale products as an aside to normal browse results.

BLC_PROMOTIONAL_CATEGORY_PRODUCT

Field Description

ID

Unique row ID

CONTEXT_ID

Logical ID. Allows for sandbox versions.

CATEGORY_CONTEXT_ID

Context ID of the owning Category

PROMOTIONAL_PRODUCT_CONTEXT_ID

Context ID of the Category being promoted

PROMOTIONAL_PRODUCT_TYPE

The type of the promotion being made such as FEATURED, CROSS_SALE, or UP_SALE.

SORTING

Defines the sort order of this promotional product relative to all others belonging to a Category.

PROMOTIONAL_MESSAGE

A message to display to customers along with the promoted product.

Category Assets

An EntityAsset associated with a Category.

Tip
EntityAssets encapsulates information related to stored, digital content such as images, videos, or text files, that belong to a particular entity.

One of these can be marked as the primary (or default) asset to be displayed on customer-facing pages.

BLC_CATEGORY_ASSET

Field Description

ID

Unique row ID

CONTEXT_ID

Logical ID. Allows for sandbox versions.

CATEGORY_CONTEXT_ID

Context ID of the owning Category

IS_PRIMARY

Whether this is the default asset to display for the Category.

SORTING

Defines the sort order of this asset relative to all others belonging to a Category.

TENANT_ID

Context ID of the Tenant this asset belongs to. Used for resolving the actual asset content.

APPLICATION_ID

Context ID of the Application this asset belongs to. Used for resolving the actual asset content.

TYPE

Describes the general type of the asset. This is used to determine how to render the asset on the frontend such as IMAGE, PDF, or VIDEO.

PROVIDER

The name of the provider that is hosting the asset. For assets hosted by the asset service itself, this should be set to BROADLEAF.

URL

The location used to resolve this asset. If the PROVIDER is BROADLEAF, then this will be a relative URL such as /icon.png. For other providers, this will be the fully qualified URL such as https://www.youtube.com/watch?v=abcdefg.

EMBED_CODE

If TYPE is EMBED_CODE, then this field holds the HTML to be embedded. This field is mutually exclusive with URL.

ALT_TEXT

Text that corresponds to the HTML alt attribute that should be used when this asset is rendered in a browser.

TITLE

Text that corresponds to the HTML title attribute that should be used when this asset is rendered in a browser.

Asset Tags

A category asset tag represents additional, descriptive or identifying information about an asset. These could be used to distinguish between mobile and desktop versions of assets, for instance.

BLC_CATEGORY_ASSET_TAG

Field Description

CATEGORY_ASSET_ID

The ID of the parent asset.

TAG

The actual tag value.

Broadleaf Common Data Features

Categories, Category Products, Promotional Category Products, and Category Assets are Catalog Trackable, which includes Sandbox Trackable behavior.