Examples of ProductOption


Examples of org.broadleafcommerce.core.catalog.domain.ProductOption

        if (currentTypeIndex == options.size()) {
            result.add(currentPermutation);
            return result;
        }
       
        ProductOption currentOption = options.get(currentTypeIndex);
        if (!currentOption.getUseInSkuGeneration()) {
            //This flag means do not generate skus and so do not create permutations for this productoption,
            //end it here and return the current list of permutations.
            result.addAll(generatePermutations(currentTypeIndex + 1, currentPermutation, options));
            return result;
        }
        for (ProductOptionValue option : currentOption.getAllowedValues()) {
            List<ProductOptionValue> permutation = new ArrayList<ProductOptionValue>();
            permutation.addAll(currentPermutation);
            permutation.add(option);
            result.addAll(generatePermutations(currentTypeIndex + 1, permutation, options));
        }
        if (currentOption.getAllowedValues().size() == 0) {
            //There are still product options left in our array to compute permutations, even though this productOption does not have any values associated.
            result.addAll(generatePermutations(currentTypeIndex + 1, currentPermutation, options));
        }
       
        return result;
View Full Code Here

Examples of org.simplecart.shopcart.catalog.ProductOption

                    ActionMessages.GLOBAL_MESSAGE,
                    new ActionMessage("error.databaseDAO"));
        }
       
        // find product objects and attach to request
        ProductOption option = odao.findById(cartForm.getOptionId(),false);

        // *** create a new ShopcartItem for this ProductOption and amount
        ShopcartItem item =
                new SimpleShopcartItem(
                option.getId(),
                cartForm.getAmount(),
                option.getName(),
                option.getDescription(),
                option.getDescription(),
                option.getUnitPriceActualRetail());
        shopcart.addItem(item);
       
        // *** commit and close Hibernate session
        HibernateUtility.commitTransaction();
        HibernateUtility.closeSession();
View Full Code Here

Examples of org.simplecart.shopcart.catalog.ProductOption

        // create the line items and add to order
        Shopcart shopcart = (Shopcart) session.getAttribute(Constants.SHOPCART);
        Iterator cartItems = shopcart.getItems().iterator();
        ShopcartItem currentItem;
        SalesOrderLineItem currentLineItem;
        ProductOption currentOption;

        // get a DAO for the new Stake
        InternetProductOptionDAO optionDAO = new InternetProductOptionDAO();
       
        while (cartItems.hasNext()) {
View Full Code Here

Examples of org.simplecart.shopcart.catalog.ProductOption

                (HttpServletRequest) pageContext.getRequest();
        StringBuffer url = new StringBuffer(request.getContextPath());
        url.append(config.getPrefix());
        url.append(page);
        url.append(".do");
        ProductOption option = null;
        try {
            option = (ProductOption) pageContext.findAttribute(name);
        } catch (ClassCastException e) {
            option = null;
        }
        if (option == null && !this.activity.equals("enter"))
            throw new JspException
                    (messages.getMessage("error.generalMessage", name));
        if (page.indexOf("?") < 0)
            url.append("?");
        else
            url.append("&");
        url.append("activity=");
        url.append(this.activity);
        if (!this.activity.equals("enter")) {
            url.append("&optionId=");
            url.append(TagUtils.getInstance().filter(option.getId().toString()));
        }
       
        // Generate the hyperlink start element
        HttpServletResponse response =
                (HttpServletResponse) pageContext.getResponse();
View Full Code Here

Examples of org.simplecart.shopcart.catalog.ProductOption

       
        // extract id from the request
        Long id = Long.decode(request.getParameter("optionId"));
       
        // get ProductOption object
        ProductOption option = loadOption(id);
       
        // create a optionForm from a CatalogItemForm
        optionForm = (CatalogItemForm) form;
       
        // copy properties to form-bean
        PropertyUtils.copyProperties(optionForm, option);
        PropertyUtils.copyProperties(optionForm, option.getSearchDetails());
        optionForm.setActivity(Constants.EDIT_PAGE_KEY);
        optionForm.setId(option.getId());
       
        // create DAO instance
        pdao = new InternetProductDAO();
        if (pdao == null){
            errors.add(
View Full Code Here

Examples of org.simplecart.shopcart.catalog.ProductOption

       
        // extract id from the request
        Long id = Long.decode(request.getParameter("optionId"));
       
        // get ProductOption object
        ProductOption option = loadOption(id);
       
        // create a optionForm from a CatalogItemForm
        optionForm = (CatalogItemForm) form;
       
        // copy properties to form-bean
        PropertyUtils.copyProperties(optionForm, option);
        PropertyUtils.copyProperties(optionForm, option.getSearchDetails());
        optionForm.setActivity(Constants.DELETE_PAGE_KEY);
        optionForm.setId(option.getId());
       
        // create DAO instance
        pdao = new InternetProductDAO();
        if (pdao == null){
            errors.add(
View Full Code Here

Examples of org.simplecart.shopcart.catalog.ProductOption

                    ActionMessages.GLOBAL_MESSAGE,
                    new ActionMessage("error.database"));
            return null;
        }
       
        ProductOption option = null;
       
        try {
            // find stake objects and attach to request
            option = dao.findById(id, false);
            Hibernate.initialize(option.getSearchDetails());
           
            // close transaction and session
            HibernateUtility.commitTransaction();
            HibernateUtility.closeSession();
        } catch (HibernateException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.