java.lang.Object
de.hybris.platform.sap.sapordermgmtservices.converters.populator.DefaultAbstractOrderPopulator<SOURCE,TARGET>
de.hybris.platform.sap.sapordermgmtservices.converters.populator.DefaultOrderPopulator<SOURCE,TARGET>
- Type Parameters:
SOURCE- BOL representation of an orderTARGET- DAO representation of an order
- All Implemented Interfaces:
de.hybris.platform.converters.Populator<SOURCE,TARGET>
public class DefaultOrderPopulator<SOURCE extends Order,TARGET extends OrderData>
extends DefaultAbstractOrderPopulator<SOURCE,TARGET>
Populates a hybris order DAO from the BOL representation of an order
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringConverts a date to a localized stringprotected StringgetExternalFormat(String orderId) Compiles external format of SAP order ID by just cutting leading zeros in case ID is purely numericalvoidprotected voidpopulateCondensedstatus(TARGET target) Compiles a condensed status from overall and delivery status, seeOrderData.setCondensedStatus(String).protected voidpopulateCreatedAt(SOURCE source, TARGET target) Converts the created at date into a format the UI can understand.protected voidpopulateHeader(SOURCE source, TARGET target) Maps an abstract order header in BOL representation into an hybris abstract orderprotected voidpopulateOverallstatus(Header source, TARGET target) Populates hybris overall status from BOL sales document headerprotected voidpopulatePartners(SOURCE source, TARGET target) protected voidpopulateShippingstatus(Header source, TARGET target) Populates hybris shipping (in hybris terminology: delivery) status from BOL sales document headervoidsetB2bCustomerConverter(de.hybris.platform.servicelayer.dto.converter.Converter<UserModel, CustomerData> b2bCustomerConverter) Methods inherited from class de.hybris.platform.sap.sapordermgmtservices.converters.populator.DefaultAbstractOrderPopulator
convertDeliveryModeSAPToHybris, determineDeliveryModeSAPToHybris, getBaseSiteService, getBaseStoreService, getBolCartFacade, getCartItemConverter, getPriceFactory, getSapPartnerService, populateDeliveryAddress, setAddressConverter, setBaseSiteService, setBaseStoreService, setBolCartFacade, setCartItemConverter, setPriceFactory, setSapPartnerService
-
Constructor Details
-
DefaultOrderPopulator
public DefaultOrderPopulator()
-
-
Method Details
-
populate
public void populate(SOURCE source, TARGET target) throws de.hybris.platform.servicelayer.dto.converter.ConversionException - Specified by:
populatein interfacede.hybris.platform.converters.Populator<SOURCE extends Order,TARGET extends OrderData> - Overrides:
populatein classDefaultAbstractOrderPopulator<SOURCE extends Order,TARGET extends OrderData> - Throws:
de.hybris.platform.servicelayer.dto.converter.ConversionException
-
populateCreatedAt
Converts the created at date into a format the UI can understand. We need to pass it as array with size 1 to the OrderData target object, this makes sure that <spring:theme> can digest it. Otherwise a date with ',' as separator can lead to issues, as the date then would be interpreted as array with multiple entries.- Parameters:
source- BOL order headertarget- Order data
-
populatePartners
- Parameters:
source-target-
-
populateHeader
Description copied from class:DefaultAbstractOrderPopulatorMaps an abstract order header in BOL representation into an hybris abstract order- Overrides:
populateHeaderin classDefaultAbstractOrderPopulator<SOURCE extends Order,TARGET extends OrderData> - Parameters:
source- BOL representation of abstract ordertarget- hybris representation of abstract order
-
populateOverallstatus
Populates hybris overall status from BOL sales document header- Parameters:
source- BOL sales document headertarget- hybris order data
-
populateShippingstatus
Populates hybris shipping (in hybris terminology: delivery) status from BOL sales document header- Parameters:
source- BOL sales document headertarget- hybris order data
-
populateCondensedstatus
Compiles a condensed status from overall and delivery status, seeOrderData.setCondensedStatus(String).
In case the overall status is completed, condensed status will also be set to completed, otherwise condensed status will be equal to delivery status.- Parameters:
target- Order data with condensed status
-
getExternalFormat
Compiles external format of SAP order ID by just cutting leading zeros in case ID is purely numerical- Parameters:
orderId- Technical SAP order ID- Returns:
- Order ID in external format
-
setB2bCustomerConverter
public void setB2bCustomerConverter(de.hybris.platform.servicelayer.dto.converter.Converter<UserModel, CustomerData> b2bCustomerConverter) - Parameters:
b2bCustomerConverter- the b2bCustomerConverter to set
-
convertDateToLongDateString
Converts a date to a localized string- Parameters:
date-- Returns:
- Date, localized according the session locale
-