Class Functions
java.lang.Object
de.hybris.platform.acceleratorstorefrontcommons.tags.Functions
JSP EL Functions. This file contains static methods that are used by JSP EL.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanarrayContainsInstance(String[] stringArr, String string) Check if array contains instance.static booleanUtility tag function to check if Pickup mode is enabled for the current base store.protected static StringconvertWithProperConverter(de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel, ProductData> productUrlConverter, ProductModel product) static booleandoesAppliedPromotionExistForOrderEntry(CartData cart, int entryNumber) Test if a cart has an applied promotion for the specified entry number.static booleanTest if a cart has an applied promotion for the specified entry or grouped entry.static booleandoesPotentialPromotionExistForOrderEntry(CartData cart, int entryNumber) Test if a cart has an potential promotion for the specified entry number.static booleanTest if a cart has an potential promotion for the specified entry or entry group.protected static booleandoesPromotionExistForOrderEntry(Integer entryNumberToFind, PromotionResultData productPromotion) static booleandoesPromotionExistForOrderEntry(List<PromotionResultData> productPromotions, int entryNumber) static StringencodeHTML(String valueToBeEncoded) Utility method that encodes the given input as HTMLstatic StringencodeJavaScript(String valueToBeEncoded) Utility method that encodes the given input as HTMLstatic StringUtility method that encodes given URLstatic booleanprotected static StringgetCategoryUrl(CMSLinkComponentModel component, de.hybris.platform.servicelayer.dto.converter.Converter<CategoryModel, CategoryData> categoryUrlConverter) protected static de.hybris.platform.servicelayer.dto.converter.Converter<CategoryModel,CategoryData> getCategoryUrlConverter(javax.servlet.http.HttpServletRequest httpRequest) protected static de.hybris.platform.acceleratorcms.services.CMSPageContextServicegetCMSPageContextService(javax.servlet.http.HttpServletRequest httpRequest) protected static de.hybris.platform.acceleratorcms.component.slot.CMSPageSlotComponentServicegetCMSPageSlotComponentService(javax.servlet.http.HttpServletRequest httpRequest) protected static javax.servlet.http.HttpServletRequestprotected static ImageDatagetImageData(ProductData product, String productCode, String format) protected static ImageDatagetImageForFormat(Collection<ImageData> images, String format) static ImageDatagetImageForProductCode(ProductData product, String productCode, String format) JSP EL Function to get an image for a Product in a specific format based on the product code.static ImageDatagetImageForStoreAndFormat(PointOfServiceData store, String format) JSP EL Function to get an Image for a Store in a specific formatstatic ImageDatagetPrimaryImageForProductAndFormat(ProductData product, String format) JSP EL Function to get a primary Image for a Product in a specific formatprotected static ImageDatagetPrimaryImageForTypeAndFormat(Collection<ImageData> images, String format) protected static de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel,ProductData> getProductUrlConverter(javax.servlet.http.HttpServletRequest httpRequest) protected static de.hybris.platform.commerceservices.order.strategies.QuoteUserIdentificationStrategygetQuoteUserIdentificationStrategy(javax.servlet.http.HttpServletRequest httpRequest) protected static de.hybris.platform.commerceservices.order.strategies.QuoteUserTypeIdentificationStrategygetQuoteUserTypeIdentificationStrategy(javax.servlet.http.HttpServletRequest httpRequest) static <T> TgetSpringBean(javax.servlet.http.HttpServletRequest httpRequest, String beanName, Class<T> beanClass) Returns the Spring bean with namebeanNameand of typebeanClass.static StringgetUrlForCMSLinkComponent(CMSLinkComponentModel component) JSP EL Function to get the URL for a CMSLinkComponentstatic StringgetUrlForCMSLinkComponent(CMSLinkComponentModel component, de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel, ProductData> productUrlConverter, de.hybris.platform.servicelayer.dto.converter.Converter<CategoryModel, CategoryData> categoryUrlConverter) static booleanisConsumedByEntry(PromotionOrderEntryConsumedData consumed, OrderEntryData entry) Test if entry or grouped entry belongs to consumed entrystatic booleanisExtensionInstalled(String extensionName) static booleanstatic booleanstatic StringnormalizedCode(String code) Returns normalized code for selection data codestatic StringValidates that tag is a valid HTML tag name
-
Field Details
-
DEFAULT_HOMEPAGE_URL
- See Also:
-
-
Constructor Details
-
Functions
public Functions()
-
-
Method Details
-
getPrimaryImageForProductAndFormat
JSP EL Function to get a primary Image for a Product in a specific format- Parameters:
product- the productformat- the desired format- Returns:
- the image
-
getPrimaryImageForTypeAndFormat
protected static ImageData getPrimaryImageForTypeAndFormat(Collection<ImageData> images, String format) -
getImageForStoreAndFormat
JSP EL Function to get an Image for a Store in a specific format- Parameters:
store- the storeformat- the desired image format- Returns:
- the image
-
getImageForFormat
-
getUrlForCMSLinkComponent
JSP EL Function to get the URL for a CMSLinkComponent- Parameters:
component- The Link Component- Returns:
- The URL
-
getUrlForCMSLinkComponent
public static String getUrlForCMSLinkComponent(CMSLinkComponentModel component, de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel, ProductData> productUrlConverter, de.hybris.platform.servicelayer.dto.converter.Converter<CategoryModel, CategoryData> categoryUrlConverter) -
getCategoryUrl
protected static String getCategoryUrl(CMSLinkComponentModel component, de.hybris.platform.servicelayer.dto.converter.Converter<CategoryModel, CategoryData> categoryUrlConverter) -
convertWithProperConverter
protected static String convertWithProperConverter(de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel, ProductData> productUrlConverter, ProductModel product) -
evaluateRestrictions
-
getProductUrlConverter
protected static de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel,ProductData> getProductUrlConverter(javax.servlet.http.HttpServletRequest httpRequest) -
getCategoryUrlConverter
protected static de.hybris.platform.servicelayer.dto.converter.Converter<CategoryModel,CategoryData> getCategoryUrlConverter(javax.servlet.http.HttpServletRequest httpRequest) -
getCMSPageContextService
protected static de.hybris.platform.acceleratorcms.services.CMSPageContextService getCMSPageContextService(javax.servlet.http.HttpServletRequest httpRequest) -
getCMSPageSlotComponentService
protected static de.hybris.platform.acceleratorcms.component.slot.CMSPageSlotComponentService getCMSPageSlotComponentService(javax.servlet.http.HttpServletRequest httpRequest) -
getSpringBean
public static <T> T getSpringBean(javax.servlet.http.HttpServletRequest httpRequest, String beanName, Class<T> beanClass) Returns the Spring bean with namebeanNameand of typebeanClass.- Type Parameters:
T- type of the bean- Parameters:
httpRequest- the http requestbeanName- name of the beanbeanClass- expected type of the bean- Returns:
- the bean matching the given arguments or
nullif no bean could be resolved
-
isConsumedByEntry
public static boolean isConsumedByEntry(PromotionOrderEntryConsumedData consumed, OrderEntryData entry) Test if entry or grouped entry belongs to consumed entry- Parameters:
consumed-entry-- Returns:
- true if consumed entry and entry/grouped entry corresponds to each other otherwise false
-
doesAppliedPromotionExistForOrderEntry
Test if a cart has an applied promotion for the specified entry number.- Parameters:
cart- the cartentryNumber- the entry number- Returns:
- true if there is an applied promotion for the entry number
-
doesAppliedPromotionExistForOrderEntryOrOrderEntryGroup
public static boolean doesAppliedPromotionExistForOrderEntryOrOrderEntryGroup(CartData cart, OrderEntryData entry) Test if a cart has an applied promotion for the specified entry or grouped entry.- Parameters:
cart- the cartentry- the order entry- Returns:
- true if there is an applied promotion for the entry number
-
doesPotentialPromotionExistForOrderEntry
Test if a cart has an potential promotion for the specified entry number.- Parameters:
cart- the cartentryNumber- the entry number- Returns:
- true if there is an potential promotion for the entry number
-
doesPotentialPromotionExistForOrderEntryOrOrderEntryGroup
public static boolean doesPotentialPromotionExistForOrderEntryOrOrderEntryGroup(CartData cart, OrderEntryData entry) Test if a cart has an potential promotion for the specified entry or entry group.- Parameters:
cart- the cartentry- the entry- Returns:
- true if there is an potential promotion for the entry or entry group
-
doesPromotionExistForOrderEntry
public static boolean doesPromotionExistForOrderEntry(List<PromotionResultData> productPromotions, int entryNumber) -
doesPromotionExistForOrderEntry
protected static boolean doesPromotionExistForOrderEntry(Integer entryNumberToFind, PromotionResultData productPromotion) -
encodeUrl
Utility method that encodes given URL- Parameters:
url- the url to encode- Returns:
- encoded URL
-
encodeHTML
Utility method that encodes the given input as HTML- Parameters:
valueToBeEncoded- the value to encode- Returns:
- value encoded as HTML
-
sanitizeHtmlTagName
Validates that tag is a valid HTML tag name- Parameters:
tag- HTML tag name- Returns:
- tag if valid, div if it is not valid.
-
encodeJavaScript
Utility method that encodes the given input as HTML- Parameters:
valueToBeEncoded- the value to encode- Returns:
- value encoded as JavaScript
-
checkIfPickupEnabledForStore
public static boolean checkIfPickupEnabledForStore()Utility tag function to check if Pickup mode is enabled for the current base store.- Returns:
- boolean
-
getCurrentRequest
protected static javax.servlet.http.HttpServletRequest getCurrentRequest() -
isExtensionInstalled
-
isQuoteUserSalesRep
public static boolean isQuoteUserSalesRep() -
isQuoteUserSellerApprover
public static boolean isQuoteUserSellerApprover() -
getQuoteUserTypeIdentificationStrategy
protected static de.hybris.platform.commerceservices.order.strategies.QuoteUserTypeIdentificationStrategy getQuoteUserTypeIdentificationStrategy(javax.servlet.http.HttpServletRequest httpRequest) -
getQuoteUserIdentificationStrategy
protected static de.hybris.platform.commerceservices.order.strategies.QuoteUserIdentificationStrategy getQuoteUserIdentificationStrategy(javax.servlet.http.HttpServletRequest httpRequest) -
normalizedCode
Returns normalized code for selection data code- Parameters:
code-- Returns:
- code normalized according to replace condition
-
getImageForProductCode
public static ImageData getImageForProductCode(ProductData product, String productCode, String format) JSP EL Function to get an image for a Product in a specific format based on the product code.- Parameters:
product- The product.productCode- The desired product code.format- The desired format.- Returns:
- The image.
-
getImageData
-
arrayContainsInstance
Check if array contains instance.- Parameters:
stringArr- the string arraystring- the string instance- Returns:
- true, if contains
-