Class DefaultAbstractOrderPopulator<SOURCE extends SalesDocument,TARGET extends AbstractOrderData>
- java.lang.Object
-
- de.hybris.platform.sap.sapordermgmtservices.converters.populator.DefaultAbstractOrderPopulator<SOURCE,TARGET>
-
- Type Parameters:
SOURCE- BOL representation of abstract orderTARGET- hybris representation of abstract order
- All Implemented Interfaces:
Populator<SOURCE,TARGET>
- Direct Known Subclasses:
DefaultCartPopulator,DefaultOrderPopulator
public class DefaultAbstractOrderPopulator<SOURCE extends SalesDocument,TARGET extends AbstractOrderData> extends java.lang.Object implements Populator<SOURCE,TARGET>
Populates the hybris representation of an abstract order (concrete cart or concrete order) from the SAP BOL representation
-
-
Constructor Summary
Constructors Constructor Description DefaultAbstractOrderPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconvertDeliveryModeSAPToHybris(java.lang.String shipCond, java.util.Map<java.lang.String,java.lang.String> availableShipConds, DeliveryModeData deliveryModeData)Compiles the hybris representation of the delivery mode from an SAP code and the list of possible SAP codes.protected DeliveryModeDatadetermineDeliveryModeSAPToHybris(java.lang.String deliveryModeCode)Determines a hybris model from the SAP delivery mode code (i.e.BaseSiteServicegetBaseSiteService()BaseStoreServicegetBaseStoreService()BolCartFacadegetBolCartFacade()Converter<Item,OrderEntryData>getCartItemConverter()PriceDataFactorygetPriceFactory()SapPartnerServicegetSapPartnerService()voidpopulate(SOURCE source, TARGET target)Populate the target instance with values from the source instance.protected voidpopulateDeliveryAddress(SOURCE source, TARGET target)Converts delivery addresses from BOL into hybris representation.protected voidpopulateHeader(SOURCE source, TARGET target)Maps an abstract order header in BOL representation into an hybris abstract ordervoidsetAddressConverter(Converter<AddressModel,AddressData> addressConverter)voidsetBaseSiteService(BaseSiteService baseSiteService)voidsetBaseStoreService(BaseStoreService baseStoreService)voidsetBolCartFacade(BolCartFacade bolCartFacade)voidsetCartItemConverter(Converter<Item,OrderEntryData> cartItemConverter)voidsetPriceFactory(PriceDataFactory priceFactory)voidsetSapPartnerService(SapPartnerService sapPartnerService)
-
-
-
Method Detail
-
getBaseStoreService
public BaseStoreService getBaseStoreService()
- Returns:
- the baseStoreService
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService baseStoreService)
- Parameters:
baseStoreService- the baseStoreService to set
-
populate
public void populate(SOURCE source, TARGET target) throws ConversionException
Description copied from interface:PopulatorPopulate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<SOURCE extends SalesDocument,TARGET extends AbstractOrderData>- Parameters:
source- the source objecttarget- the target to fill- Throws:
ConversionException- if an error occurs
-
populateHeader
protected void populateHeader(SOURCE source, TARGET target)
Maps an abstract order header in BOL representation into an hybris abstract order- Parameters:
source- BOL representation of abstract ordertarget- hybris representation of abstract order
-
determineDeliveryModeSAPToHybris
protected DeliveryModeData determineDeliveryModeSAPToHybris(java.lang.String deliveryModeCode)
Determines a hybris model from the SAP delivery mode code (i.e. the shipping condition in SD terms)- Parameters:
deliveryModeCode- SAP delivery mode code- Returns:
- hybris delivery mode data
-
convertDeliveryModeSAPToHybris
protected void convertDeliveryModeSAPToHybris(java.lang.String shipCond, java.util.Map<java.lang.String,java.lang.String> availableShipConds, DeliveryModeData deliveryModeData)Compiles the hybris representation of the delivery mode from an SAP code and the list of possible SAP codes. This list contains the language dependent descriptions which we need for the facade layer or UI- Parameters:
shipCond- SAP delivery mode codeavailableShipConds- List of possible SAP delivery mode codesdeliveryModeData- hybris delivery mode data
-
getBaseSiteService
public BaseSiteService getBaseSiteService()
- Returns:
- the baseSiteService
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
- Parameters:
baseSiteService- the baseSiteService to set
-
getCartItemConverter
public Converter<Item,OrderEntryData> getCartItemConverter()
- Returns:
- the cartItemConverter
-
setCartItemConverter
public void setCartItemConverter(Converter<Item,OrderEntryData> cartItemConverter)
- Parameters:
cartItemConverter- the cartItemConverter to set
-
getPriceFactory
public PriceDataFactory getPriceFactory()
- Returns:
- the priceFactory
-
setPriceFactory
public void setPriceFactory(PriceDataFactory priceFactory)
- Parameters:
priceFactory- the priceFactory to set
-
getBolCartFacade
public BolCartFacade getBolCartFacade()
- Returns:
- the bolCartFacade
-
setBolCartFacade
public void setBolCartFacade(BolCartFacade bolCartFacade)
- Parameters:
bolCartFacade- the bolCartFacade to set
-
setSapPartnerService
public void setSapPartnerService(SapPartnerService sapPartnerService)
- Parameters:
sapPartnerService- the sapPartnerService to set
-
populateDeliveryAddress
protected void populateDeliveryAddress(SOURCE source, TARGET target)
Converts delivery addresses from BOL into hybris representation. On BOL level, the address is identified through the SAP key of the ship-to party which is attached toHeader.
As a result of this method,AbstractOrderData.setDeliveryAddress(AddressData)will be called on the hybris abstract order- Parameters:
source- BOL representation of abstract ordertarget- hybris representation of abstract order
-
setAddressConverter
public void setAddressConverter(Converter<AddressModel,AddressData> addressConverter)
- Parameters:
addressConverter- the addressConverter to set
-
getSapPartnerService
public SapPartnerService getSapPartnerService()
- Returns:
- the sapPartnerService
-
-