Class DefaultProductSearchFacade
- java.lang.Object
-
- de.hybris.platform.cmssmarteditwebservices.products.facade.impl.DefaultProductSearchFacade
-
- All Implemented Interfaces:
ProductSearchFacade
public class DefaultProductSearchFacade extends java.lang.Object implements ProductSearchFacade
Default implementation of theProductSearchFacade
interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultProductSearchFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ItemData
buildItemData(java.lang.String code, java.lang.String typeCode)
Returns theItemData
object that represents a product with its unique identifier code.SearchResult<CategoryData>
findProductCategories(java.lang.String text, PageableData pageableData)
Method to find product categories using a free-text form.SearchResult<ProductData>
findProducts(java.lang.String text, PageableData pageableData)
Method to find products using a free-text form.protected CatalogVersionService
getCatalogVersionService()
protected Converter<CategoryData,CategoryData>
getCategoryDataConverter()
protected CMSAdminSiteService
getCmsAdminSiteService()
ProductData
getProductByUid(java.lang.String uid)
Method to get a product by its product uid.CategoryData
getProductCategoryByUid(java.lang.String uid)
Method to get a category by its category uid.protected Converter<ProductData,ProductData>
getProductDataConverter()
protected ProductSearchFacade
getProductSearchFacade()
protected UniqueItemIdentifierService
getUniqueItemIdentifierService()
protected void
setCatalogVersionInSession(CatalogVersionModel catalogVersion)
Sets the catalog version in the session so we can reuse ProductSearchFacade correctly.void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setCategoryDataConverter(Converter<CategoryData,CategoryData> categoryDataConverter)
void
setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
void
setProductDataConverter(Converter<ProductData,ProductData> productDataConverter)
void
setProductSearchFacade(ProductSearchFacade productSearchFacade)
void
setUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService)
-
-
-
Method Detail
-
getProductByUid
public ProductData getProductByUid(java.lang.String uid)
Description copied from interface:ProductSearchFacade
Method to get a product by its product uid. It expects the base site to be previously identified usingBaseSiteService.setCurrentBaseSite(String, boolean)
and the catalog version to be stored inSessionService
CatalogConstants.SESSION_CATALOG_VERSIONS
. For your convenience, useCatalogVersionService.setSessionCatalogVersion(String, String)
.- Specified by:
getProductByUid
in interfaceProductSearchFacade
- Parameters:
uid
- the product uid- Returns:
- the Product data object.
-
findProducts
public SearchResult<ProductData> findProducts(java.lang.String text, PageableData pageableData)
Description copied from interface:ProductSearchFacade
Method to find products using a free-text form. It also supports pagination. It expects the base site to be previously identified usingBaseSiteService.setCurrentBaseSite(String, boolean)
and the catalog version to be stored inSessionService
CatalogConstants.SESSION_CATALOG_VERSIONS
. For your convenience, useCatalogVersionService.setSessionCatalogVersion(String, String)
.- Specified by:
findProducts
in interfaceProductSearchFacade
- Parameters:
text
- The free-text string to be used on the product searchpageableData
- the pagination object- Returns:
- the search result object.
-
getProductCategoryByUid
public CategoryData getProductCategoryByUid(java.lang.String uid)
Description copied from interface:ProductSearchFacade
Method to get a category by its category uid. It expects the base site to be previously identified usingBaseSiteService.setCurrentBaseSite(String, boolean)
and the catalog version to be stored inSessionService
CatalogConstants.SESSION_CATALOG_VERSIONS
. For your convenience, useCatalogVersionService.setSessionCatalogVersion(String, String)
.- Specified by:
getProductCategoryByUid
in interfaceProductSearchFacade
- Parameters:
uid
- the product category uid- Returns:
- the Category data object containing the resulting list and the pagination object.
-
findProductCategories
public SearchResult<CategoryData> findProductCategories(java.lang.String text, PageableData pageableData)
Description copied from interface:ProductSearchFacade
Method to find product categories using a free-text form. It also supports pagination. It expects the base site to be previously identified usingBaseSiteService.setCurrentBaseSite(String, boolean)
and the catalog version to be stored inSessionService
CatalogConstants.SESSION_CATALOG_VERSIONS
. For your convenience, useCatalogVersionService.setSessionCatalogVersion(String, String)
.- Specified by:
findProductCategories
in interfaceProductSearchFacade
- Parameters:
text
- The free-text string to be used on the product category searchpageableData
- the pagination object- Returns:
- the search result object containing the resulting list and the pagination object.
-
setCatalogVersionInSession
protected void setCatalogVersionInSession(CatalogVersionModel catalogVersion)
Sets the catalog version in the session so we can reuse ProductSearchFacade correctly.- Parameters:
catalogVersion
- the catalog version to be set in the session
-
buildItemData
protected ItemData buildItemData(java.lang.String code, java.lang.String typeCode)
Returns theItemData
object that represents a product with its unique identifier code.- Parameters:
code
- the unique identifier codetypeCode
- the TYPE CODE of the Item model- Returns:
- the item data object that represents the product
-
getProductSearchFacade
protected ProductSearchFacade getProductSearchFacade()
-
setProductSearchFacade
public void setProductSearchFacade(ProductSearchFacade productSearchFacade)
-
getCategoryDataConverter
protected Converter<CategoryData,CategoryData> getCategoryDataConverter()
-
setCategoryDataConverter
public void setCategoryDataConverter(Converter<CategoryData,CategoryData> categoryDataConverter)
-
getProductDataConverter
protected Converter<ProductData,ProductData> getProductDataConverter()
-
setProductDataConverter
public void setProductDataConverter(Converter<ProductData,ProductData> productDataConverter)
-
getUniqueItemIdentifierService
protected UniqueItemIdentifierService getUniqueItemIdentifierService()
-
setUniqueItemIdentifierService
public void setUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getCmsAdminSiteService
protected CMSAdminSiteService getCmsAdminSiteService()
-
setCmsAdminSiteService
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
-
-