class CentralViewResolverProductImpl implements CentralViewResolver {

    @Override
    public Pair<String, String> resolveMainPanelRendererLabel(final Map parameters) {
        if (parameters.containsKey(WebParametersKeys.SKU_ID)) {
            final long skuId = NumberUtils.toLong(HttpUtil.getSingleValue(parameters.get(WebParametersKeys.SKU_ID)));

            if (skuId > 0L) {
                final ProductSku sku = productService.getSkuById(skuId, true); // Need to load it the same way as central view does
                if (sku != null) {
                    final String template = sku.getProduct().getProducttype().getUitemplate();
                    if (StringUtils.isNotBlank(template)) {
                        return new Pair<>(template, CentralViewLabel.SKU);
                    }
                    return DEFAULT_S;
                }
            }
        } else if (parameters.containsKey(WebParametersKeys.PRODUCT_ID)) {
            final long prodId = NumberUtils.toLong(HttpUtil.getSingleValue(parameters.get(WebParametersKeys.PRODUCT_ID)));
            if (prodId > 0L) {
                final Product product = productService.getProductById(prodId, true);  // Need to load it the same way as central view does
                if (product != null) {
                    final String template = product.getProducttype().getUitemplate();
                    if (StringUtils.isNotBlank(template)) {
                        return new Pair<>(template, CentralViewLabel.PRODUCT);
                    }
                    return DEFAULT_P;
                }
            }
        }
        return null;
    }

    public  CentralViewResolverProductImpl(final ProductService productService);

}