Broadleaf Microservices
  • v1.0.0-latest-prod

Admin Navigation Release Notes for 3.0.0-GA

Important Updates

Spring Boot Upgrade

  • As of Broadleaf Release Train 3.0.0-GA, all microservices have been upgraded to support Spring Boot 4.1 and Java 25.

Requirements

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

New Features & Notable Changes

Introduced caching for NavigableMenu responses from the API.

Introduced caching for MenuItemService#getMenuWithNavigationTree since this is hitting the DB and building a NavigableNavMenuItem for each NavMenuItem. Admin menus are practically static from a data perspective so the expiration is 1-year. Additional eviction based on CRUD usage is included since there is a NavMenuItemEndpoint.

  • Configured adminNavigationMenuTreeCacheStateConfigurer to register our new cache with the global Broadleaf CacheStateManager.

  • Implemented AdminNavigationMenuTreeKeyGenerator to produce a serialized context key incorporating both depthLimit and context information: Tenant, Application, and Locale. Menus are tenant trackable and translatable, but they may also be filtered on application ID or presence using predicates.

  • Cache configuration using the following properties

  • broadleaf.adminnavigation.cache.heapBudget default is 5

  • broadleaf.adminnavigation.cache.offHeapBudget default is 5

  • broadleaf.adminnavigation.cache.menu-navigation-tree default is 1 year in minutes, duration.

  • broadleaf.adminnavigation.cache.sizes.menu-navigation-tree default is 20,480 bytes

  • broadleaf.adminnavigation.cache.weights.menu-navigation-tree default 1.0

Support Defining Standard Admin Navigation Menus with Spring Properties

We introduced support for defining NavMenuItems as Spring Properties (e.g., in YAML) and to use predicates and scopes similar to Metadata Routes that determine whether they should render.

Out of box, Predicates are simple and use a standardized name to drive logic when menu items are retrieved to be applied: APPLICATION_BY_ID, APPLICATION_ONLY, TENANT_BY_ID, TENANT_ONLY. Handling for custom, additional predicates can be added in the DefaultMenuItemService#evaluateCustomNavigationPredicate.

Scopes may be specific and used in the frontend to limit accessibility of menu items without needing to consult a metadata Route. This includes specifying the match behavior: All must match or Any may match. To enable this behavior in the Admin, set VITE_MAIN_NAVIGATION_BEHAVIOR=ROUTE_INDEPENDENT, otherwise only scopes of the matching Route will be used, which is the default behavior.

Example Usage
broadleaf:
  adminnavigation:
    menu:
      items:
        - id: 'TENANT'
          label: 'Tenant Management' // or message key like menu-item.tenant-management
          displayOrder: 1_000
          icon: 'globe'
          predicates:
            - name: 'TENANT_ONLY'
          predicate-match-type: 'ALL'
          submenu:
            - id: 'APPLICATIONS'
              label: 'Applications'
              url: '/applications'
              displayOrder: 1_000
              icon: 'globe'
              scopes: [ 'TENANT' ]
              scope-match-type: 'ANY'
              predicates:
                - name: 'TENANT_ONLY'
              predicate-match-type: 'ALL'
            - id: 'VENDORS'
              label: 'Vendors'
              url: '/vendors'
              displayOrder: 2_000
              icon: 'user-group'
              scopes: [ 'TENANT', 'VENDOR' ]
              scope-match-type: 'ANY'
              predicates:
                - name: 'TENANT_ONLY'
              predicate-match-type: 'ALL'

1.New Classes Created

  • NavigationPredicate.java: Models runtime tenant/application-based menu restrictions (e.g., TENANT_ONLY, APPLICATION_BY_ID) defined in YAML, mirroring the RoutePredicate metadata pattern.

  • NavigationItemLocator.java: Pluggable interface to contribute menus from any in-memory or programmatic source.

  • PropertiesNavigationItemLocator.java: Default implementation mapping Spring properties to the locator.

  • CompositeNavigationItemLocator.java: Composite wrapper collecting and flattening all registered locators.

2. Domain & DTO Extension

  • Updated NavMenuItem.java and NavigableNavMenuItem.java to hold and propagate scopes, scopeMatchType, predicates, and predicateMatchType.

  • Updated the existing AdminNavigationProperties.java to bind the list configuration under broadleaf.adminnavigation.menu.items.

  • Introduced PropertyDrivenNavMenuItem to represent the property version and allow nesting submenu items rather than a purely flat list for convenience.

    • PropertiesNavigationItemLocator will convert these to a flat list of NavMenuItems to fit into the existing business logic seamlessly.