Class DefaultStaticPackageService
java.lang.Object
de.hybris.platform.staticpackageservices.services.impl.DefaultStaticPackageService
- All Implemented Interfaces:
StaticPackageService
The class implementation of
StaticPackageService-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloneChildBundleTemplate(BundleTemplateModel childBundleTemplate, RouteBundleTemplateModel parentBundleTemplate, String flightPackageId, int originDestinationRefNumber, String staticPackageId) Clones a child bundle template.protected voidcreateChangeProductPriceBundleRule(String accommodationBundleId, CurrencyModel currency, int index, long percentageDiscount, BundleTemplateModel parentTemplate, de.hybris.platform.jalo.order.price.PriceInformation priceInfo, ProductModel product, String staticPackageId) Creates a change product price bundle rule.protected voidcreateChangeProductPriceBundleRuleForRoomRateProducts(List<ProductModel> roomRateProducts, String accommodationBundleId, long percentageDiscount, BundleTemplateModel parentTemplate, String staticPackageId) Creates a change product price bundle rule for each room rate product.protected StringcreateChangeProductPriceBundleRuleId(String bundleId, String isocode, int i, String staticPackageId) Generates the id for a change product price bundle rule related to a product.protected voidcreateChildTemplatesForRouteBundle(RouteBundleTemplateModel parentBundleTemplate, BundleTemplateModel bundleTemplate, String flightPackageId, int originDestinationRefNumber, String staticPackageId) Creates child templates for a route bundle by cloning the ones contained in the bundle template previously retrieved.protected voidcreateDealAccommodationBundleTemplate(RoomPackageModel roomPackage, DealBundleTemplateModel dealParentBundleTemplate, long percentageDiscount, String staticPackageId) Creates the child accommodation bundle template from a static package.protected voidcreateDealBundleTemplate(StaticPackageModel staticPackage) Creates a deal bundle template from a static package.voidcreateDealBundleTemplates(List<StaticPackageModel> staticPackages) Creates a deal bundle template for each static package.protected voidcreateDealProductBundleTemplate(DealBundleTemplateModel parentTemplate, List<ProductModel> products, String staticPackageId) Creates a deal product bundle template from the list of products of a static package.protected voidcreateDealRouteBundleTemplate(TransportBundleTemplateModel parentTemplate, int originDestinationRefNumber, TransportFacilityModel origin, TransportFacilityModel destination, CabinClassModel cabinClass, BundleType bundleType, String flightPackageId, BundleTemplateModel bundleTemplate, String staticPackageId) Creates a deal route bundle template.protected voidcreateDealTransportBundleTemplate(StaticPackageModel staticPackage, DealBundleTemplateModel parentTemplate) Creates the child bundle template of type transport from a static package.protected StringgetBundleSelectionCriteriaId(String staticPackageId, int originDestinationRefNumber, String bundleSelectionCriteriaId) Gets the bundle selection criteria id.protected de.hybris.platform.servicelayer.i18n.CommonI18NServiceGets common i 18 n service.protected StringgetIdForClonedChildBundleTemplate(String flightPackageId, int originDestinationRefNumber, String childBundleTemplateId, String staticPackageId) Gets the id for cloned child bundle template.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.protected StringgetRouteBundleTemplateId(String flightPackageId, int originDestinationRefNumber, String staticPackageId) Gets the route bundle template id.protected StringgetRouteChangeProductPriceBundleRuleId(String flightPackageId, int originDestinationRefNumber, String originalId, String staticPackageId) Gets route change product price bundle rule id.protected StaticPackageBundleTemplateServiceGets static package bundle template service.protected TravelBundleTemplateStatusServiceGets travel bundle template status service.protected TravelCommercePriceServiceGets travel commerce price service.protected TravelRouteServiceGets travel route service.protected voidsetBasicInformationForProductBundleTemplate(BundleTemplateModel productBundleTemplate, String staticPackageId) Sets basic information for a product bundle template.voidsetCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) Sets common i 18 n service.protected voidsetDealBasicInformation(DealBundleTemplateModel dealBundleTemplate) Sets deal basic information.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidsetStaticPackageBundleTemplateService(StaticPackageBundleTemplateService staticPackageBundleTemplateService) Sets static package bundle template service.voidsetTravelBundleTemplateStatusService(TravelBundleTemplateStatusService travelBundleTemplateStatusService) Sets travel bundle template status service.voidsetTravelCommercePriceService(TravelCommercePriceService travelCommercePriceService) Sets travel commerce price service.voidsetTravelRouteService(TravelRouteService travelRouteService) Sets travel route service.
-
Field Details
-
PACKAGE_ID_SEPARATOR
- See Also:
-
-
Constructor Details
-
DefaultStaticPackageService
public DefaultStaticPackageService()
-
-
Method Details
-
createDealBundleTemplates
public void createDealBundleTemplates(List<StaticPackageModel> staticPackages) throws StaticPackageException Creates a deal bundle template for each static package. This method uses the transaction in order to rollback the creation of a dealBundleTemplate if something goes wrong.- Specified by:
createDealBundleTemplatesin interfaceStaticPackageService- Parameters:
staticPackages- the list of staticPackages- Throws:
StaticPackageException
-
createDealBundleTemplate
protected void createDealBundleTemplate(StaticPackageModel staticPackage) throws StaticPackageException Creates a deal bundle template from a static package.- Parameters:
staticPackage- the static package- Throws:
StaticPackageException
-
setDealBasicInformation
Sets deal basic information.- Parameters:
dealBundleTemplate- the deal bundle template
-
createDealProductBundleTemplate
protected void createDealProductBundleTemplate(DealBundleTemplateModel parentTemplate, List<ProductModel> products, String staticPackageId) throws StaticPackageException Creates a deal product bundle template from the list of products of a static package.- Parameters:
parentTemplate- the parent templateproducts- the productsstaticPackageId- the static package id- Throws:
StaticPackageException
-
createDealTransportBundleTemplate
protected void createDealTransportBundleTemplate(StaticPackageModel staticPackage, DealBundleTemplateModel parentTemplate) throws StaticPackageException Creates the child bundle template of type transport from a static package.- Parameters:
staticPackage- the flight package modelparentTemplate- the parent template- Throws:
StaticPackageException- the static package exception
-
createDealRouteBundleTemplate
protected void createDealRouteBundleTemplate(TransportBundleTemplateModel parentTemplate, int originDestinationRefNumber, TransportFacilityModel origin, TransportFacilityModel destination, CabinClassModel cabinClass, BundleType bundleType, String flightPackageId, BundleTemplateModel bundleTemplate, String staticPackageId) throws StaticPackageException Creates a deal route bundle template.- Parameters:
parentTemplate- the parent templateoriginDestinationRefNumber- the origin destination re numberorigin- the origin airportdestination- the destination airportcabinClass- the cabin classbundleType- the bundle typeflightPackageId- the flight package idbundleTemplate- the bundle templatestaticPackageId- the static package id- Throws:
StaticPackageException- the static package exception
-
createChildTemplatesForRouteBundle
protected void createChildTemplatesForRouteBundle(RouteBundleTemplateModel parentBundleTemplate, BundleTemplateModel bundleTemplate, String flightPackageId, int originDestinationRefNumber, String staticPackageId) throws StaticPackageException Creates child templates for a route bundle by cloning the ones contained in the bundle template previously retrieved.- Parameters:
parentBundleTemplate- the parent bundle templatebundleTemplate- the bundle templateflightPackageId- the flight package idoriginDestinationRefNumber- the origin destination ref numberstaticPackageId- the static package id- Throws:
StaticPackageException- the static package exception
-
cloneChildBundleTemplate
protected void cloneChildBundleTemplate(BundleTemplateModel childBundleTemplate, RouteBundleTemplateModel parentBundleTemplate, String flightPackageId, int originDestinationRefNumber, String staticPackageId) throws StaticPackageException Clones a child bundle template. This method clones the child bundle together with its bundle selection criteria and change product price bundle rules.- Parameters:
childBundleTemplate- the child bundle templateparentBundleTemplate- the parent bundle templateflightPackageId- the flight package idoriginDestinationRefNumber- the origin destination ref numberstaticPackageId- the static package id- Throws:
StaticPackageException- the static package exception
-
getIdForClonedChildBundleTemplate
protected String getIdForClonedChildBundleTemplate(String flightPackageId, int originDestinationRefNumber, String childBundleTemplateId, String staticPackageId) Gets the id for cloned child bundle template.- Parameters:
flightPackageId- the flight package idoriginDestinationRefNumber- the origin destination ref numberchildBundleTemplateId- the child bundle template idstaticPackageId- the static package id- Returns:
- the id for cloned child bundle template
-
getRouteChangeProductPriceBundleRuleId
protected String getRouteChangeProductPriceBundleRuleId(String flightPackageId, int originDestinationRefNumber, String originalId, String staticPackageId) Gets route change product price bundle rule id.- Parameters:
flightPackageId- the flight package idoriginDestinationRefNumber- the origin destination ref numberoriginalId- the original idstaticPackageId- the static package id- Returns:
- the route change product price bundle rule id
-
getRouteBundleTemplateId
protected String getRouteBundleTemplateId(String flightPackageId, int originDestinationRefNumber, String staticPackageId) Gets the route bundle template id.- Parameters:
flightPackageId- the flight package idoriginDestinationRefNumber- the origin destination ref numberstaticPackageId- the static package id- Returns:
- the route bundle template id
-
getBundleSelectionCriteriaId
protected String getBundleSelectionCriteriaId(String staticPackageId, int originDestinationRefNumber, String bundleSelectionCriteriaId) Gets the bundle selection criteria id.- Parameters:
staticPackageId- as the static package idoriginDestinationRefNumber- as the origin destination ref numberbundleSelectionCriteriaId- as the bundle selection criteria id- Returns:
- the bundle selection criteria id.
-
createDealAccommodationBundleTemplate
protected void createDealAccommodationBundleTemplate(RoomPackageModel roomPackage, DealBundleTemplateModel dealParentBundleTemplate, long percentageDiscount, String staticPackageId) throws StaticPackageException Creates the child accommodation bundle template from a static package.- Parameters:
roomPackage- the room packagedealParentBundleTemplate- the deal parent bundle templatepercentageDiscount- the percentage discountstaticPackageId- the static package id- Throws:
StaticPackageException- the static package exception
-
createChangeProductPriceBundleRuleForRoomRateProducts
protected void createChangeProductPriceBundleRuleForRoomRateProducts(List<ProductModel> roomRateProducts, String accommodationBundleId, long percentageDiscount, BundleTemplateModel parentTemplate, String staticPackageId) Creates a change product price bundle rule for each room rate product. The price of the rule is calculated accordingly to the percentage of the discount to apply on the product.- Parameters:
roomRateProducts- the room rate productsaccommodationBundleId- the accommodation bundle idpercentageDiscount- the percentage discountparentTemplate- the parent templatestaticPackageId- the static package id
-
createChangeProductPriceBundleRule
protected void createChangeProductPriceBundleRule(String accommodationBundleId, CurrencyModel currency, int index, long percentageDiscount, BundleTemplateModel parentTemplate, de.hybris.platform.jalo.order.price.PriceInformation priceInfo, ProductModel product, String staticPackageId) Creates a change product price bundle rule.- Parameters:
accommodationBundleId- the accommodation bundle idcurrency- the currencyindex- the indexpercentageDiscount- the percentage discountparentTemplate- the parent templatepriceInfo- the price infoproduct- the productstaticPackageId- the static package id
-
createChangeProductPriceBundleRuleId
protected String createChangeProductPriceBundleRuleId(String bundleId, String isocode, int i, String staticPackageId) Generates the id for a change product price bundle rule related to a product.- Parameters:
bundleId- the route bundle idisocode- the isocodei- the indexstaticPackageId- the static package id- Returns:
- the string
-
setBasicInformationForProductBundleTemplate
protected void setBasicInformationForProductBundleTemplate(BundleTemplateModel productBundleTemplate, String staticPackageId) Sets basic information for a product bundle template.- Parameters:
productBundleTemplate- the product bundle templatestaticPackageId- the static package id
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService()Gets model service.- Returns:
- the model service
-
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.- Parameters:
modelService- the model service
-
getTravelBundleTemplateStatusService
Gets travel bundle template status service.- Returns:
- the travel bundle template status service
-
setTravelBundleTemplateStatusService
public void setTravelBundleTemplateStatusService(TravelBundleTemplateStatusService travelBundleTemplateStatusService) Sets travel bundle template status service.- Parameters:
travelBundleTemplateStatusService- the travel bundle template status service
-
getStaticPackageBundleTemplateService
Gets static package bundle template service.- Returns:
- the static package bundle template service
-
setStaticPackageBundleTemplateService
public void setStaticPackageBundleTemplateService(StaticPackageBundleTemplateService staticPackageBundleTemplateService) Sets static package bundle template service.- Parameters:
staticPackageBundleTemplateService- the static package bundle template service
-
getCommonI18NService
protected de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService()Gets common i 18 n service.- Returns:
- the common i 18 n service
-
setCommonI18NService
public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) Sets common i 18 n service.- Parameters:
commonI18NService- the common i 18 n service
-
getTravelCommercePriceService
Gets travel commerce price service.- Returns:
- the travel commerce price service
-
setTravelCommercePriceService
Sets travel commerce price service.- Parameters:
travelCommercePriceService- the travel commerce price service
-
getTravelRouteService
Gets travel route service.- Returns:
- the travel route service
-
setTravelRouteService
Sets travel route service.- Parameters:
travelRouteService- the travel route service
-