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 basic
Order and OrderItem data into an
OrderFulfillmentView.
This must be executed after OrderFulfillmentViewFulfillmentDataContributor so that the
OrderFulfillmentItemViews are present for populating
MinimalOrderItemView into.
-
Constructor Summary
ConstructorsConstructorDescriptionOrderFulfillmentViewOrderDataContributor(com.broadleafcommerce.common.extension.TypeFactory typeFactory, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService) -
Method Summary
Modifier and TypeMethodDescriptionvoidcontributeMapping(@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>protected com.broadleafcommerce.common.extension.TypeFactoryprotected 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 Details
-
OrderFulfillmentViewOrderDataContributor
public OrderFulfillmentViewOrderDataContributor(com.broadleafcommerce.common.extension.TypeFactory typeFactory, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService)
-
-
Method Details
-
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
-
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
-