Package org.broadleafcommerce.common.extension

Examples of org.broadleafcommerce.common.extension.ExtensionResultHolder


    @Override
    public boolean hasAllChildCategories(){
        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().hasAllChildCategories(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (Boolean) holder.getResult();
            }
        }
        return !allChildCategoryXrefs.isEmpty();
    }
View Full Code Here


    @Deprecated
    public List<Category> getChildCategories() {
        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().getChildCategories(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<Category>) holder.getResult();
            }
        }
        if (legacyChildCategories.isEmpty()) {
            for (CategoryXref category : allChildCategoryXrefs) {
                if (category.getSubCategory().isActive()) {
View Full Code Here

    @Override
    public boolean hasChildCategories() {
        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().hasChildCategories(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (Boolean) holder.getResult();
            }
        }
        return !getChildCategoryXrefs().isEmpty();
    }
View Full Code Here

    }

    @Override
    public void updateAndValidateCart(Order cart) {
        if (extensionManager != null) {
            ExtensionResultHolder erh = new ExtensionResultHolder();
            extensionManager.getProxy().updateAndValidateCart(cart, erh);
            Boolean clearCart = (Boolean) erh.getContextMap().get("clearCart");
            Boolean repriceCart = (Boolean) erh.getContextMap().get("repriceCart");
            Boolean saveCart = (Boolean) erh.getContextMap().get("saveCart");
            if (clearCart != null && clearCart.booleanValue()) {
                orderService.cancelOrder(cart);
                cart = orderService.createNewCartForCustomer(cart.getCustomer());
            } else {
                try {
View Full Code Here

        }
       
        // If we didn't find a generator that could handle this file, let's see if we can
        // look it up from our known locations
            if (!match) {
                ExtensionResultHolder erh = new ExtensionResultHolder();
                extensionManager.getProxy().getOverrideResource(file, erh);
                if (erh.getContextMap().get(ResourceRequestExtensionHandler.RESOURCE_ATTR) != null) {
                    foundResources.put(file, (Resource) erh.getContextMap().get(ResourceRequestExtensionHandler.RESOURCE_ATTR));
                    match = true;
                }
            }

        // If we didn't find an override for this file, let's see if we can
View Full Code Here

            }
        }

        AbstractThymeleafView view = null;
       
        ExtensionResultHolder erh = new ExtensionResultHolder();
        extensionManager.getProxy().overrideView(erh);
        String templateOverride = (String) erh.getContextMap().get(EXTENSION_TEMPLATE_ATTR_NAME);

        if (templateOverride != null && isAjaxRequest()) {
            view = (AbstractThymeleafView) super.loadView(templateOverride, locale);
            view.addStaticVariable("wrappedTemplate", viewName);
        } else {
View Full Code Here

    @Override
    public List<ProductOptionXref> getProductXrefs() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductOptionEntityExtensionManager")) {
            ProductOptionEntityExtensionManager extensionManager = (ProductOptionEntityExtensionManager) context.getAdditionalProperties().get("blProductOptionEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getProductXrefs(this, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (List<ProductOptionXref>) holder.getResult();
            }
        }

        return products;
    }
View Full Code Here

    }

    @Override
    public Category findCategoryByURI(String uri) {
        if (extensionManager != null) {
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().findCategoryByURI(uri, holder);
            if (ExtensionResultStatusType.HANDLED.equals(result)) {
                return (Category) holder.getResult();
            }
        }
        Query query;
        query = em.createNamedQuery("BC_READ_CATEGORY_OUTGOING_URL");
        query.setParameter("currentDate", getCurrentDateAfterFactoringInDateResolution());
View Full Code Here

    }
   
    protected String getUpdatedEntityId(TranslatedEntity entity, String entityId) {
        Class<?> clazz = entityConfiguration.lookupEntityClass(entity.getType());

        ExtensionResultHolder erh = new ExtensionResultHolder();
        try {
            Long id = Long.parseLong(entityId);
            ExtensionResultStatusType result = extensionManager.getProxy().overrideRequestedId(erh, em, clazz, id);
            if (result.equals(ExtensionResultStatusType.HANDLED)) {
                return String.valueOf((Long) erh.getResult());
            }
        } catch (NumberFormatException e) {
            // The ID was not a Long, which means we can't override it. We'll return the default value below.
        }
View Full Code Here

                }
            }
        }
       
        if (unminifiedResource == null) {
            ExtensionResultHolder erh = new ExtensionResultHolder();
            extensionManager.getProxy().getOverrideResource(path, erh);
            if (erh.getContextMap().get(ResourceRequestExtensionHandler.RESOURCE_ATTR) != null) {
                unminifiedResource = (Resource) erh.getContextMap().get(ResourceRequestExtensionHandler.RESOURCE_ATTR);
            }
        }
       
        if (unminifiedResource == null) {
            unminifiedResource = super.getResource(request);
View Full Code Here

TOP

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

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.