Class ContextUtil
java.lang.Object
com.broadleafcommerce.common.dataimport.util.ContextUtil
Provides common functionality for processing tracking and context related data on an import.
- Author:
- Kelly Tisdell (ktisdell)
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
overrideChangeContainerForChildOfEntity
(String parentResourceId, Class<?> parentClass, com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable child, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Overrides theChangeContainer
on the provided child to align with that of the parent, specified by the ID of the parent and the type (Class) of the parent.
-
Method Details
-
overrideChangeContainerForChildOfEntity
public static void overrideChangeContainerForChildOfEntity(String parentResourceId, Class<?> parentClass, com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable child, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Overrides theChangeContainer
on the provided child to align with that of the parent, specified by the ID of the parent and the type (Class) of the parent. Variants, Entity Assets, and Category Products are examples of child entities that have parents of Product or Category type.The actual change container and sub container names will be determined by the highest level type mapping available. Therefore, if a parent entity is an extension, e.g., MyProduct, the change container name will still be
PRODUCT
since that is the highest level mapping. Otherwise, it would have beenMY_PRODUCT
. This ensures consistent behavior across entities and extensions.- Parameters:
parentResourceId
- the context ID of the parent entityparentClass
- the type of the parent (e.g. Product.class)child
- the child entity implementingChangeContainerOverridable
typeFactory
- a standardTypeFactory
-