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 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)
      Maps Order and OrderItem data into an OrderFulfillmentView.
      Specified by:
      contributeMapping in interface OrderFulfillmentViewMappingContributor<P extends OrderFulfillmentView>
      Parameters:
      fulfillmentView - the view to map data into
      orderFulfillment - the order fulfillment to map into a vendor order fulfillment
      contextInfo - 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)
      Maps Order and OrderItem data into many OrderFulfillmentViews.
      Specified by:
      contributeMapping in interface OrderFulfillmentViewMappingContributor<P extends OrderFulfillmentView>
      Parameters:
      orderFulfillmentsAndViews - the views to map data into and their original fulfillments
      contextInfo - 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 an Order, initialize a new MinimalOrderView with 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 new MinimalOrderItemViews in the fulfillmentView's OrderFulfillmentItemViews for its OrderItems.
      Parameters:
      fulfillmentView - the fulfillment view containing items to populate order item data for
      orderItemsById - the order items to source data from
    • initializeOrderItemView

      protected MinimalOrderItemView initializeOrderItemView(com.broadleafcommerce.order.client.domain.OrderItem from)
      Given an OrderItem, initialize a new MinimalOrderItemView with 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()