public class ProductDetailController extends AbstractImpersonationController
productdetails| Modifier and Type | Field and Description |
|---|---|
static String |
COMP_ID_BACKBUTTON |
static String |
COMP_ID_NEARBYATSGROUPBOX |
static String |
COMP_ID_REFRESH_STOCK_BUTTON |
static String |
COMP_ID_SIMILAR_BTN |
static String |
SETTING_BACK_REQUEST |
static String |
SETTING_IMAGE_FORMAT |
static String |
SETTING_NEARBY_POS_COUNT |
static String |
SETTING_SIMILAR_MAX_COUNT |
static String |
SETTING_SIMILAR_PAGE_SIZE |
static String |
SOCKET_IN_PRODUCT |
static String |
SOCKET_OUT_RELATED_PRODUCTS |
| Constructor and Description |
|---|
ProductDetailController() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
availabilityDataLoaded(ProductData product)
Checks if the given
ProductData has all the availability data. |
protected void |
clearView()
Reset the view of the widget.
|
protected PageableData |
createPageableData(int page,
int size,
String sort)
Creates a
PageableData instance for the product POS stock search. |
void |
doOnCreate()
onClose_later handler for the nearbyAtsGroupbox component
|
void |
findSimilarProducts()
On click handler for the browseSimilar button.
|
protected <any> |
getLiveAtsStoreFinderStockFacade()
Returns injected liveATSStoreFinderStockFacade
StoreFinderStockFacade |
protected String |
getLocalAts(List<PointOfServiceStockData> posStockData)
Returns availability count label for the current store.
|
protected List<PointOfServiceStockData> |
getNearbyPointOfServices(ProductData product,
boolean live)
Returns a list of all the point of services (with stock data) considered being nearby the current POS
|
protected String |
getPictureURL(ProductData product)
Get the URL of the image of the preferred format.
|
protected String |
getPOSName()
Returns the current user's default POS.
|
protected String |
getPreferedImageFormat() |
protected ImageData |
getPreferredImage(Collection<ImageData> availableImages)
Returns first occurrence if image data that matches the preferred image format.
|
protected ProductFacade |
getProductFacade()
Returns injected
ProductFacade |
protected ProductData |
getProductWithAvailabilityOptions(ProductData product)
Returns
ProductData with populated all availability data. |
protected <any> |
getStoreFinderStockFacade()
Returns injected storeFinderStockFacade
StoreFinderStockFacade |
protected String |
getStoreUid()
Returns the current user's default base store.
|
protected String |
getTotalAtsForPointOfServices(List<PointOfServiceStockData> posStockData)
Returns a string representing the sum of the stock levels of the specified point of services.
|
void |
refreshATS()
On click handler for the refresh ATS button.
|
void |
sendBackRequest()
On click handler for the BACK button.
|
void |
setLiveAtsStoreFinderStockFacade(<any> liveAtsStoreFinderStockFacade) |
void |
setProduct(ProductData product)
Displays product in the productDetails controller.
|
void |
setProductFacade(ProductFacade productFacade) |
void |
setStoreFinderStockFacade(<any> storeFinderStockFacade) |
protected void |
updatePOSData(List<PointOfServiceStockData> nearbyPointOfServices,
ProductData product)
Updates the values of current store availability, nearby stores availability and the global availability status
flag.
|
protected void |
updateView(ProductData product,
boolean liveATS)
Updates the view for the given
ProductData |
createImpersonationContext, executeInContext, getCatalogVersionService, getContextCatalogVersions, getContextCurrency, getContextLanguage, getImpersonationService, getInStoreService, getSearchRestrictionService, getSessionService, getUserService, setCatalogVersionService, setImpersonationService, setInStoreService, setSearchRestrictionService, setSessionService, setUserServicepublic static final String COMP_ID_REFRESH_STOCK_BUTTON
public static final String COMP_ID_SIMILAR_BTN
public static final String COMP_ID_NEARBYATSGROUPBOX
public static final String COMP_ID_BACKBUTTON
public static final String SOCKET_IN_PRODUCT
public static final String SOCKET_OUT_RELATED_PRODUCTS
public static final String SETTING_SIMILAR_PAGE_SIZE
public static final String SETTING_SIMILAR_MAX_COUNT
public static final String SETTING_NEARBY_POS_COUNT
public static final String SETTING_IMAGE_FORMAT
public static final String SETTING_BACK_REQUEST
public void setProduct(ProductData product)
product - public void doOnCreate()
protected void updateView(ProductData product, boolean liveATS)
ProductDataproduct - liveATS - - true if the ATS data for the nearby stores should be updated.protected void updatePOSData(List<PointOfServiceStockData> nearbyPointOfServices, ProductData product)
nearbyPointOfServices - product - protected ProductData getProductWithAvailabilityOptions(ProductData product)
ProductData with populated all availability data. If availabilityDataLoaded(ProductData)
evaluates true for the given product, the same product instance is returned.product - ProductDataprotected boolean availabilityDataLoaded(ProductData product)
ProductData has all the availability data.product - protected void clearView()
protected String getPictureURL(ProductData product)
ProductFacade call.product - ProductDataprotected String getPreferedImageFormat()
protected ImageData getPreferredImage(Collection<ImageData> availableImages)
availableImages - ImageData or null if availableImages is empty or if no image data from the collection
matches preferred image format.public void findSimilarProducts()
public void refreshATS()
public void sendBackRequest()
protected String getLocalAts(List<PointOfServiceStockData> posStockData)
posStockData - - stock data of the nearby stores.protected String getTotalAtsForPointOfServices(List<PointOfServiceStockData> posStockData)
posStockData - list of point of services (with stock info)protected List<PointOfServiceStockData> getNearbyPointOfServices(ProductData product, boolean live)
product - the product for which stock information is to be loadedgetPOSName()protected String getStoreUid()
protected String getPOSName()
protected PageableData createPageableData(int page, int size, String sort)
PageableData instance for the product POS stock search.page - size - sort - PageableDataprotected <any> getStoreFinderStockFacade()
StoreFinderStockFacadeStoreFinderStockFacadepublic void setStoreFinderStockFacade(<any> storeFinderStockFacade)
protected ProductFacade getProductFacade()
ProductFacadeProductFacadepublic void setProductFacade(ProductFacade productFacade)
productFacade - the productFacade to setprotected <any> getLiveAtsStoreFinderStockFacade()
StoreFinderStockFacadeStoreFinderStockFacadepublic void setLiveAtsStoreFinderStockFacade(<any> liveAtsStoreFinderStockFacade)
Copyright © 2017 SAP SE. All Rights Reserved.