Extension Point Framework Release Notes
Learn about Extension Point Framework releases.
1.1.0.19281af30e
Released: September 2022
New in this release
Added customData to all XPF entity and context classes
A new method Map<String, Object> customData
has been added to all XPF context and entity classes (such as XPFFindShopperBasePriceSourcesContext
, XPFProduct
, XPFCustomer
, etc) to allow project teams to pass custom data from core classes to XPF extensions without needing to override XPF classes directly.
1.1.0.06b3c0d032
Released: July 2022
New in this release
Added Tax Calculator extension point
A new Extension Point has been added to support tax calculations. This allows project teams or third-party developers to create extensions that provide tax calculation support that can be invoked by Elastic Path Commerce. For more information, see Tax Calculator Extension Point.
Additionally, an external plugin for Avalara AvaTax is now available.
Added Inventory Flow extension point
A new Extension Point has been added to support transactional inventory operations. This allows project teams or third-party developers to create extensions that provide inventory tracking capabilities. For more information, see Inventory Flow Extension Point.
Added Base Price Finder extension point
A new Extension Point has been added to support base price determination. This allows project teams or third-party developers to create extensions that return unit-price tiers for product SKUs. For more information, see Base Price Finder Extension Point.
Allow extensions to throw a business state exception
When an extension or plugin detects a problem that needs to be surfaced, it can throw a Java exception. In Extension Point Framework version 1.0, we provided the XPFPluginRuntimeException
for plugins to use. In this version, we’ve also added a XPFPluginInvalidBusinessStateException
which should be used if the problem is something that the end-user can resolve. For more information, see Exceptions.
XPFHttpTagSetContext
Added helper methods to The following helper methods have been added to XPFHttpTagSetContext
:
String getUserIdFromRequest()
: This returns the current username from thex-ep-user-id
header in the request.Collection<String> getUserScopesFromRequest()
: This returns the specified scopes (store codes) from thex-ep-user-scope
andx-ep-user-scopes
headers in the request.Collection<String> getUserRolesFromRequest()
: This returns the specified user roles from thex-ep-user-role
andx-ep-user-roles
headers in the request.Map<String, String> getUserTraitsFromRequest()
: This returns the specified traits from thex-ep-user-trait
andx-ep-user-traits
headers in the request.Collection<String> getMultipleValuesHeader(String... headers)
: This returns all values from the specified headers in the request. This can handle both the situation where the same header is specified multiple times in the request, or a single header with multiple comma-separated values. If multiple headers are specified, the values are merged.Map<String, String> getKeyValuePairsHeader(String... headers)
: This returns a map of values from the specified headers in the request. The header values are expected to be in the formkey1=value1,key2=value2,etc
. If multiple headers are specified, the values are merged.
Support for lazy loading expensive entity fields
Normally, the entity objects passed to Extension Point methods are fully populated before the method is invoked. However, some entity class values are slow to calculate while at the same time may not be required by the configured extensions. To address this, we’ve added the ability to lazy load certain values when the entity class getter is called by the extension. These methods can be identified by the existence of the @LazyLoaded
annotation on the method. For more information, see Lazy-loaded entity fields.
Fixed issues
- Several Extension Point entity classes have
getAttributeValueByKey(String key, Locale locale)
orgetDisplayName(String key)
methods, includingXPFCustomer
,XPFCategory
,XPFProduct
, andXPFProductSku
. These methods had several bugs that have now been addressed:- Locale fallback support was missing. Now a fallback algorithm is followed:
- Lookup the attribute value using the passed locale (i.e.
en_US_va
). - If no value is found, lookup the attribute value using the locale without the variant (i.e.
en_US
). - If no value is found, lookup the attribute value using the locale without the county (i.e.
en
).
- Lookup the attribute value using the passed locale (i.e.
- If a value could not be found for the specified locale, a
NullPointerException
was thrown. Now if all the fallbacks fail to find a value, the method correctly returnsOptional.empty()
.
- Locale fallback support was missing. Now a fallback algorithm is followed:
- Added a useful
toString
implementation toXPFStructuredErrorMessage
.