Class OrderFulfillmentViewOrderDataContributor<P extends OrderFulfillmentView>
- java.lang.Object
-
- com.broadleafcommerce.order.service.OrderFulfillmentViewOrderDataContributor<P>
-
- All Implemented Interfaces:
OrderFulfillmentViewMappingContributor<P>
public class OrderFulfillmentViewOrderDataContributor<P extends OrderFulfillmentView> extends Object implements OrderFulfillmentViewMappingContributor<P>
A contributor capable of mapping basicOrderandOrderItemdata into anOrderFulfillmentView.This must be executed after
OrderFulfillmentViewFulfillmentDataContributorso that theOrderFulfillmentItemViewsare present for populatingMinimalOrderItemViewinto.
-
-
Constructor Summary
Constructors Constructor Description OrderFulfillmentViewOrderDataContributor(com.broadleafcommerce.common.extension.TypeFactory typeFactory, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontributeMapping(@NonNull List<org.springframework.data.util.Pair<P,com.broadleafcommerce.order.client.domain.OrderFulfillment>> orderFulfillmentsAndViews, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)voidcontributeMapping(P fulfillmentView, @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected OrderService<com.broadleafcommerce.order.client.domain.Order>getOrderService()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()protected MinimalOrderItemViewinitializeOrderItemView(com.broadleafcommerce.order.client.domain.OrderItem from)Given anOrderItem, initialize a newMinimalOrderItemViewwith basic matching data.protected MinimalOrderViewinitializeOrderView(com.broadleafcommerce.order.client.domain.Order from)Given anOrder, initialize a newMinimalOrderViewwith basic matching data.protected booleanisApplicationRequest(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidpopulateDataFromOrder(P fulfillmentView, com.broadleafcommerce.order.client.domain.Order order, Map<String,com.broadleafcommerce.order.client.domain.OrderItem> orderItemsById)protected voidpopulateOrderItemViews(P fulfillmentView, Map<String,com.broadleafcommerce.order.client.domain.OrderItem> orderItemsById)Initializes and populates newMinimalOrderItemViewsin thefulfillmentView'sOrderFulfillmentItemViewsfor itsOrderItems.
-
-
-
Constructor Detail
-
OrderFulfillmentViewOrderDataContributor
public OrderFulfillmentViewOrderDataContributor(com.broadleafcommerce.common.extension.TypeFactory typeFactory, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService)
-
-
Method Detail
-
contributeMapping
public void contributeMapping(@NonNull P fulfillmentView, @NonNull @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)- Specified by:
contributeMappingin interfaceOrderFulfillmentViewMappingContributor<P extends OrderFulfillmentView>- Parameters:
fulfillmentView- the view to map data intoorderFulfillment- the order fulfillment to map into a vendor order fulfillmentcontextInfo- context information surrounding multitenant state
-
contributeMapping
public void contributeMapping(@NonNull @NonNull List<org.springframework.data.util.Pair<P,com.broadleafcommerce.order.client.domain.OrderFulfillment>> orderFulfillmentsAndViews, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)- Specified by:
contributeMappingin interfaceOrderFulfillmentViewMappingContributor<P extends OrderFulfillmentView>- Parameters:
orderFulfillmentsAndViews- the views to map data into and their original fulfillmentscontextInfo- context information surrounding multitenant state
-
isApplicationRequest
protected boolean isApplicationRequest(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
populateDataFromOrder
protected void populateDataFromOrder(P fulfillmentView, com.broadleafcommerce.order.client.domain.Order order, Map<String,com.broadleafcommerce.order.client.domain.OrderItem> orderItemsById)
-
initializeOrderView
protected MinimalOrderView initializeOrderView(com.broadleafcommerce.order.client.domain.Order from)
Given anOrder, initialize a newMinimalOrderViewwith basic matching data.- Parameters:
from- the order to source data from- Returns:
- a new minimal order view with basic fields initialized
-
populateOrderItemViews
protected void populateOrderItemViews(P fulfillmentView, Map<String,com.broadleafcommerce.order.client.domain.OrderItem> orderItemsById)
Initializes and populates newMinimalOrderItemViewsin thefulfillmentView'sOrderFulfillmentItemViewsfor itsOrderItems.- Parameters:
fulfillmentView- the fulfillment view containing items to populate order item data fororderItemsById- the order items to source data from
-
initializeOrderItemView
protected MinimalOrderItemView initializeOrderItemView(com.broadleafcommerce.order.client.domain.OrderItem from)
Given anOrderItem, initialize a newMinimalOrderItemViewwith basic matching data.- Parameters:
from- the order item to source data from- Returns:
- a new minimal order item view with basic fields initialized
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
getOrderService
protected OrderService<com.broadleafcommerce.order.client.domain.Order> getOrderService()
-
-