org.broadleafcommerce.core.order.service
Class OrderMultishipOptionServiceImpl

java.lang.Object
  extended by org.broadleafcommerce.core.order.service.OrderMultishipOptionServiceImpl
All Implemented Interfaces:
OrderMultishipOptionService

@Service(value="blOrderMultishipOptionService")
public class OrderMultishipOptionServiceImpl
extends Object
implements OrderMultishipOptionService

Author:
Andre Azzolini (apazzolini)

Field Summary
protected  AddressService addressService
           
protected  FulfillmentOptionService fulfillmentOptionService
           
protected  OrderItemService orderItemService
           
 
Constructor Summary
OrderMultishipOptionServiceImpl()
           
 
Method Summary
 OrderMultishipOption create()
          Creates a new instance of the OrderMultishipOption.
protected  List<OrderMultishipOption> createPopulatedOrderMultishipOption(Order order, DiscreteOrderItem item, Integer quantity)
           
 void deleteAllOrderMultishipOptions(Order order)
          Removes all OrderMultishipOptions for this Order permanently.
 void deleteOrderItemOrderMultishipOptions(Long orderItemId)
          Removes all OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.
 void deleteOrderItemOrderMultishipOptions(Long orderItemId, int numToDelete)
          Removes up to numToDelete OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.
 List<OrderMultishipOption> findOrderItemOrderMultishipOptions(Long orderItemId)
          Finds all OrderMultishipOptions associated with the given Order Item based on the order item id
 List<OrderMultishipOption> findOrderMultishipOptions(Long orderId)
          Finds all OrderMultishipOptions associated with the given Order based on the orderId
 List<OrderMultishipOption> generateOrderMultishipOptions(Order order)
          Generates the blank set of OrderMultishipOptions for a given order.
 List<OrderMultishipOption> getOrderMultishipOptionsFromDTOs(Order order, List<OrderMultishipOptionDTO> optionDtos)
          Given the (potetially only partially filled out) OrderMultishipOptionDTO objects, builds out the associated OrderMultishipOption objects.
 List<OrderMultishipOption> getOrGenerateOrderMultishipOptions(Order order)
          If this order has associated OrderMultishipOptions, this method will return those options.
 OrderMultishipOption save(OrderMultishipOption orderMultishipOption)
          Saves the given OrderMultishipOption and returns the saved entity
 void saveOrderMultishipOptions(Order order, List<OrderMultishipOptionDTO> optionDTOs)
          Associates the appropriate objects based on the OrderMultishipOptionDTOs to OrderMultishipOption instances, associates them with the given order, and saves the set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addressService

protected AddressService addressService

orderItemService

protected OrderItemService orderItemService

fulfillmentOptionService

protected FulfillmentOptionService fulfillmentOptionService
Constructor Detail

OrderMultishipOptionServiceImpl

public OrderMultishipOptionServiceImpl()
Method Detail

save

public OrderMultishipOption save(OrderMultishipOption orderMultishipOption)
Description copied from interface: OrderMultishipOptionService
Saves the given OrderMultishipOption and returns the saved entity

Specified by:
save in interface OrderMultishipOptionService
Returns:
the saved entity

findOrderMultishipOptions

public List<OrderMultishipOption> findOrderMultishipOptions(Long orderId)
Description copied from interface: OrderMultishipOptionService
Finds all OrderMultishipOptions associated with the given Order based on the orderId

Specified by:
findOrderMultishipOptions in interface OrderMultishipOptionService
Parameters:
orderId - the order id to find OrderMultishipOptions for
Returns:
the associated OrderMultishipOptions

findOrderItemOrderMultishipOptions

public List<OrderMultishipOption> findOrderItemOrderMultishipOptions(Long orderItemId)
Description copied from interface: OrderMultishipOptionService
Finds all OrderMultishipOptions associated with the given Order Item based on the order item id

Specified by:
findOrderItemOrderMultishipOptions in interface OrderMultishipOptionService
Parameters:
orderItemId - the orderItem id to find OrderMultishipOptions for
Returns:
the associated OrderMultishipOptions

create

public OrderMultishipOption create()
Description copied from interface: OrderMultishipOptionService
Creates a new instance of the OrderMultishipOption. The default Broadleaf implementation will create an instance based on what is configured in the EntityConfiguration.

Specified by:
create in interface OrderMultishipOptionService
Returns:
the newly created OrderMultishipOption

deleteOrderItemOrderMultishipOptions

public void deleteOrderItemOrderMultishipOptions(Long orderItemId)
Description copied from interface: OrderMultishipOptionService
Removes all OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.

Specified by:
deleteOrderItemOrderMultishipOptions in interface OrderMultishipOptionService

deleteOrderItemOrderMultishipOptions

public void deleteOrderItemOrderMultishipOptions(Long orderItemId,
                                                 int numToDelete)
Description copied from interface: OrderMultishipOptionService
Removes up to numToDelete OrderMultishipOptions associated with the OrderItem represented by this orderItemId permanently.

Specified by:
deleteOrderItemOrderMultishipOptions in interface OrderMultishipOptionService
numToDelete - the maximum number of occurrences of this orderItemId to delete
See Also:
OrderMultishipOptionService.deleteOrderItemOrderMultishipOptions(Long)

deleteAllOrderMultishipOptions

public void deleteAllOrderMultishipOptions(Order order)
Description copied from interface: OrderMultishipOptionService
Removes all OrderMultishipOptions for this Order permanently.

Specified by:
deleteAllOrderMultishipOptions in interface OrderMultishipOptionService

saveOrderMultishipOptions

public void saveOrderMultishipOptions(Order order,
                                      List<OrderMultishipOptionDTO> optionDTOs)
Description copied from interface: OrderMultishipOptionService
Associates the appropriate objects based on the OrderMultishipOptionDTOs to OrderMultishipOption instances, associates them with the given order, and saves the set. Note that this method will clear any previously saved OrderMultishipOptions for the requested order before performing the save.

Specified by:
saveOrderMultishipOptions in interface OrderMultishipOptionService

getOrGenerateOrderMultishipOptions

public List<OrderMultishipOption> getOrGenerateOrderMultishipOptions(Order order)
Description copied from interface: OrderMultishipOptionService
If this order has associated OrderMultishipOptions, this method will return those options. If there are items in the order that do not have associated options, options for those items will be generated and attached to the existing options.

Specified by:
getOrGenerateOrderMultishipOptions in interface OrderMultishipOptionService
Returns:
the OrderMultishipOptions for this Order
See Also:
OrderMultishipOptionService.findOrderMultishipOptions(Long), OrderMultishipOptionService.generateOrderMultishipOptions(Order)

getOrderMultishipOptionsFromDTOs

public List<OrderMultishipOption> getOrderMultishipOptionsFromDTOs(Order order,
                                                                   List<OrderMultishipOptionDTO> optionDtos)
Description copied from interface: OrderMultishipOptionService
Given the (potetially only partially filled out) OrderMultishipOptionDTO objects, builds out the associated OrderMultishipOption objects. This is done by looking up the non-null fields in the optionDtos for their associated entity. Note that the only potentially null fields are address and location ids.

Specified by:
getOrderMultishipOptionsFromDTOs in interface OrderMultishipOptionService
Returns:
the associated OrderMultishipOptions

generateOrderMultishipOptions

public List<OrderMultishipOption> generateOrderMultishipOptions(Order order)
Description copied from interface: OrderMultishipOptionService
Generates the blank set of OrderMultishipOptions for a given order. Note that the default Broadleaf implementation splits up all DiscreteOrderItems in the given order into instances of OrderMultishipOption such that each instance assumes its quantity is one. Also note that this will not set the Address or the FulfillmentOption for any of the generated options.

Specified by:
generateOrderMultishipOptions in interface OrderMultishipOptionService
Parameters:
order - the order to generate OrderMultishipOptions for
Returns:
the OrderMultishipOptions generated for the Order.

createPopulatedOrderMultishipOption

protected List<OrderMultishipOption> createPopulatedOrderMultishipOption(Order order,
                                                                         DiscreteOrderItem item,
                                                                         Integer quantity)


Copyright © 2012. All Rights Reserved.