Package org.ofbiz.product.config.ProductConfigWrapper

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption


            while(iter.hasNext()){
                ConfigItem question = (ConfigItem)iter.next();
                List options = question.getOptions();
                Iterator itero = options.iterator();
                while(itero.hasNext()){
                    ConfigOption configoption = (ConfigOption)itero.next();
                    if (configoption.isSelected()){
                        listModel.addElement("  "+configoption.getDescription());
                    }
                }
            }
        }               
        m_configList.setModel(listModel);
View Full Code Here


                             
            List options = question.getOptions();
            Iterator itero = options.iterator();
           
            while(itero.hasNext()){
                ConfigOption configoption = (ConfigOption)itero.next();
                /*Debug.logInfo("Found option " + configoption.getDescription(), module);
                Debug.logInfo("IsAvailable: "+configoption.isAvailable()+
                    ", IsSelected: "+configoption.isSelected(), module);*/
                //configoption.getComponents()
            }
View Full Code Here

        result.put("productionRunId", productionRunId);

        Iterator options = config.getSelectedOptions().iterator();
        HashMap components = new HashMap();
        while (options.hasNext()) {
            ConfigOption co = (ConfigOption)options.next();
            //components.addAll(co.getComponents());
            Iterator selComponents = co.getComponents().iterator();
            while (selComponents.hasNext()) {
                Double componentQuantity = null;
                GenericValue selComponent = (GenericValue)selComponents.next();
                if (selComponent.get("quantity") != null) {
                    componentQuantity = selComponent.getDouble("quantity");
View Full Code Here

        result.put("productionRunId", productionRunId);

        Iterator options = config.getSelectedOptions().iterator();
        HashMap components = new HashMap();
        while (options.hasNext()) {
            ConfigOption co = (ConfigOption)options.next();
            //components.addAll(co.getComponents());
            Iterator selComponents = co.getComponents().iterator();
            while (selComponents.hasNext()) {
                Double componentQuantity = null;
                GenericValue selComponent = (GenericValue)selComponents.next();
                if (selComponent.get("quantity") != null) {
                    componentQuantity = selComponent.getDouble("quantity");
View Full Code Here

    public static boolean isProductInventoryAvailableByFacility(ProductConfigWrapper productConfig, String inventoryFacilityId, double quantity, LocalDispatcher dispatcher) throws GenericServiceException {
        boolean available = true;
        List options = productConfig.getSelectedOptions();
        Iterator optionsIt = options.iterator();
        while (optionsIt.hasNext()) {
            ConfigOption ci = (ConfigOption)optionsIt.next();
            List products = ci.getComponents();
            Iterator productsIt = products.iterator();
            while (productsIt.hasNext()) {
                GenericValue product = (GenericValue)productsIt.next();
                String productId = product.getString("productId");
                Double cmpQuantity = product.getDouble("quantity");
                double neededQty = 1.0;
                if (cmpQuantity != null) {
                    neededQty = quantity * cmpQuantity.doubleValue();
                }
                if (!isProductInventoryAvailableByFacility(productId, inventoryFacilityId, neededQty, dispatcher)) {
                    ci.setAvailable(false);
                }
            }
            if (!ci.isAvailable()) {
                available = false;
            }
        }
        return available;
    }
View Full Code Here

TOP

Related Classes of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

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.