Broadleaf Microservices
  • v1.0.0-latest-prod

Catalog Services Release Notes for 2.2.0-BETA-1

Warning

This is a BETA release and not generally available. Contents may change prior to GA.

Tip
The 2.x versions are Spring Boot 3 compatible.

Requirements

  • JDK 17 is required for Broadleaf release trains 2.0.0-GA, and beyond.

New Features & Notable Changes

  • Updated BusinessTypeService and BusinessTypeRepository to introduce a method that can find BusinessType by ID as well as additional RSQL filters

  • Updated the BusinessType domain to contain a new attributes map to hold custom additional attributes. Admin metadata has also been updated to introduce this field.

    Note
    See the Schema Changes section below for more information on migration.
  • Refactored logic that built BusinessType instances from DefaultProductType values into its own DefaultProductTypeBusinessTypeBuilder component. BusinessTypeEndpoint now injects and uses this component instead of having the logic inline within itself.

  • For BusinessType instances built for DefaultProductType values, added logic to set a reserved corresponding ID for BusinessType.id instead of keeping it blank. The ID mapping is defined in DefaultProductTypeBusinessTypeBuilder.

  • Introduced Product Characteristics.

  • Introduced the ability to define available terms for Products.

Bug Fixes

Removal of Sandbox Behavior from BusinessType

The BusinessType domain was always meant to be non-sandboxable, and all operations against this domain from the Broadleaf admin have been 'production' level accordingly. However, the Trackable configuration of JpaBusinessType did not explicitly exclude sandbox behavior. This meant that theoretically, it was possible to create sandbox-level records for this domain if requests were made by a custom API caller.

With this release, JpaBusinessType has been explicitly annotated with @TrackableExtension(TrackableBehavior.APPLICATION), which excludes it entirely from supporting sandbox behavior.

Clients who have exclusively been managing this domain from the Broadleaf admin will not be impacted by this change, as the Broadleaf admin has always affected this domain at the production (non-sandbox) level.

For clients that believe they may have sandbox-level BusinessType records, here are some recommended steps:

  • First, examine the change summaries in the BLC admin’s 'Application Updates' section. From here, you can audit and manage (deploy/reject/etc) any changes to BusinessType domains until there are no more pending changes.

  • At this point, all that should be left in the CatalogServices database are production level records and 'obsolete' sandbox level records. The goal now is to find and remove those obsolete records.

    Note
    Technically, this step to remove obsolete sandbox records is optional. However, we include it in case clients find it helpful.
    • You can run the following SQL to see the BusinessType records who exist in the datastore with a sandbox-archived state

      SELECT id, context_id, name, trk_level, trk_sandbox_archived
      FROM catalog.blc_product_business_type
      WHERE trk_sandbox_archived = 'Y'
      • Inspect these results and verify that these obsolete records are indeed okay to remove

    • You can run the following SQL to see the Notification State records that would become orphaned if those business types were deleted:

      SELECT id
      from catalog.blc_notification_state
      WHERE entity_type = 'com.broadleafcommerce.catalog.provider.jpa.domain.product.type.JpaBusinessType'
        AND container IN (SELECT id
                          FROM catalog.blc_product_business_type
                          WHERE trk_sandbox_archived = 'Y')
    • If everything looks fine to remove, then you can first execute a DELETE on the blc_notification_state table with the same criteria as above, and then execute a DELETE on the blc_product_business_type table, again with the same criteria as above.

Schema Changes

The database schema has changed as part of this version.

'Create/Update' Changes

Create/update changes (new tables, new columns, etc) are automatically included in the updated *changelog-master.xml after you upgrade to the new Catalog Services JAR. The new changesets inside will run automatically to migrate existing data.

Database Platform Create/Update Changelog File Name

PostgreSQL

db/changelog/catalog.postgresql.changelog-master.xml

MariaDB

db/changelog/catalog.mariadb.changelog-master.xml

MySQL

db/changelog/catalog.mysql.changelog-master.xml

Oracle

db/changelog/catalog.oracle.changelog-master.xml and db/changelog/catalog.oracle.short.changelog-master.xml

YugabyteDB

db/changelog/catalog.yugabytedb.changelog-master.xml

API Changes

Characteristics

Table 1. New Endpoints
Path Description

GET /characteristics

Read a page of Characteristics, accepting RSQL filters and a name (q) filter.

POST /characteristics

Create a new Characteristic.

GET /characteristics/{id}

Read a single Characteristic by ID.

PATCH /characteristics/{id}

Patch a single Characteristic by ID.

PUT /characteristics/{id}

Replace a single Characteristic by ID.

DELETE /characteristics/{id}

Delete a single Characteristic by ID.

PUT /characteristics/{id}/translations/{locale}

Replace the translations for a single Characteristic by ID for a given locale.

Business Types

Table 2. New Endpoints
Path Description

GET /variant-permutations?typeKey={typeKey}

Read all VARIANT_OPTION Characteristics by BusinessType typeKey to facilitate configuring which characteristic values to use when creating new Products of that type.