Package org.broadleafcommerce.common.extension

Examples of org.broadleafcommerce.common.extension.ExtensionResultStatusType


    public List<Product> getActiveProducts() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blCategoryEntityExtensionManager")) {
            CategoryEntityExtensionManager extensionManager = (CategoryEntityExtensionManager) context.getAdditionalProperties().get("blCategoryEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getActiveProducts(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<Product>) holder.getResult();
            }
        }
        List<Product> result = new ArrayList<Product>();
        for (CategoryProductXref product : allProductXrefs) {
            if (product.getProduct().isActive()) {
                result.add(product.getProduct());
            }
        }
        return Collections.unmodifiableList(result);
    }
View Full Code Here


    public List<Product> getAllProducts() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blCategoryEntityExtensionManager")) {
            CategoryEntityExtensionManager extensionManager = (CategoryEntityExtensionManager) context.getAdditionalProperties().get("blCategoryEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getAllProducts(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<Product>) holder.getResult();
            }
        }
        List<Product> result = new ArrayList<Product>();
        for (CategoryProductXref product : allProductXrefs) {
            result.add(product.getProduct());
        }
        return Collections.unmodifiableList(result);
    }
View Full Code Here

    protected DatabaseResourceResolverExtensionManager extensionManager;

    @Override
    public InputStream getResourceAsStream(TemplateProcessingParameters params, String resourceName) {
        ExtensionResultHolder erh = new ExtensionResultHolder();
        ExtensionResultStatusType result = extensionManager.getProxy().resolveResource(erh, params, resourceName);
        if (result ==  ExtensionResultStatusType.HANDLED) {
            return (InputStream) erh.getContextMap().get(DatabaseResourceResolverExtensionHandler.IS_KEY);
        }
        return null;
    }
View Full Code Here

    public List<CategoryProductXref> getAllParentCategoryXrefs() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManager) context.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getAllParentCategoryXrefs(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<CategoryProductXref>) holder.getResult();
            }
        }
        return allParentCategoryXrefs;
View Full Code Here

    public List<Category> getAllParentCategories() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManager) context.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getAllParentCategories(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<Category>) holder.getResult();
            }
        }
        List<Category> parents = new ArrayList<Category>();
View Full Code Here

    public List<RelatedProduct> getCrossSaleProducts() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManager) context.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getCrossSaleProducts(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<RelatedProduct>) holder.getResult();
            }
        }
        return crossSaleProducts;
View Full Code Here

    public List<RelatedProduct> getUpSaleProducts() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManager) context.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getUpSaleProducts(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<RelatedProduct>) holder.getResult();
            }
        }
        return upSaleProducts;
View Full Code Here

    public List<ProductOptionXref> getProductOptionXrefs() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManager) context.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getProductOptionXrefs(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<ProductOptionXref>) holder.getResult();
            }
        }
        return productOptions;
View Full Code Here

    public List<ProductOption> getProductOptions() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManager) context.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getProductOptions(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<ProductOption>) holder.getResult();
            }
        }
        List<ProductOption> response = new ArrayList<ProductOption>();
View Full Code Here

    public OfferCode readOfferCodeByCode(String code) {
        OfferCode offerCode = null;
        Query query = null;

        ExtensionResultHolder<Query> resultHolder = new ExtensionResultHolder<Query>();
        ExtensionResultStatusType extensionResult =
                extensionManager.getProxy().createReadOfferCodeByCodeQuery(em, resultHolder, code, true, "query.Offer");

        if (extensionResult != null && ExtensionResultStatusType.HANDLED.equals(extensionResult)) {
            query = resultHolder.getResult();
        } else {
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.extension.ExtensionResultStatusType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.