Extension Point Framework Release Notes
Learn about Extension Point Framework releases.
1.2.0.5079a708c1
Released: September 2023
New in this release
Added OpenID Connect Claims Extractor extension point
A new Extension Point has been added to allow extensions to specify which claims from the Identity Provider should be used to update the customer profile attribute values and customer group values on the registered user record.
Added customData field to all extension point entity and context classes
A new class named XPFEntity
has been created and all XPF*Entity
and XPF*Context
classes now extend this class. This adds a customData
map field to all entity and context classes:
@NonNull
private final Map<String, Object> customData = new HashMap<>;
This allows developers to create customizations that can pass data to custom extensions without needing to extend or modify extension point entity and context classes.
name
field to XPFProductType
Added This allows extensions to make decisions based on the name of a product type when accessing information about products.
customerType
field to XPFCustomer
Added This allows extensions to make decisions based on the type of customer (ACCOUNT
, SINGLE_SESSION_USER
, REGISTERED_USER
).
Fixed broken backwards compatibility in Tax Calculation Extension Point
A non-null taxProviderName
was added to the XPFTaxedItems
class. Since plugins instantiate this class, this change modified the constructor, which broke existing plugins. The taxProviderName
field has been changed to optional to support backwards compatibility.
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
.