Examples of ProductSkuForm


Examples of org.hoteia.qalingo.core.web.mvc.form.ProductSkuForm

    }
   
    public ProductSkuForm buildProductSkuForm(final RequestData requestData, final ProductMarketing productMarketing, final ProductSku productSku) throws Exception {
        final MarketArea currentMarketArea = requestData.getMarketArea();
       
        final ProductSkuForm productSkuForm = new ProductSkuForm();
        if(productSku != null){
           
            productSkuForm.setId(productSku.getId().toString());
            productSkuForm.setName(productSku.getName());
            productSkuForm.setCode(productSku.getCode());
            productSkuForm.setDescription(productSku.getDescription());

            List<ProductSkuAttribute> globalAttributes = productSku.getGlobalAttributes();
            for (Iterator<ProductSkuAttribute> iterator = globalAttributes.iterator(); iterator.hasNext();) {
                ProductSkuAttribute productSkuAttribute = (ProductSkuAttribute) iterator.next();
                productSkuForm.getGlobalAttributes().put(productSkuAttribute.getAttributeDefinition().getCode(), productSkuAttribute.getValueAsString());
            }
           
            List<ProductSkuAttribute> marketAreaAttributes = productSku.getMarketAreaAttributes(currentMarketArea.getId());
            for (Iterator<ProductSkuAttribute> iterator = marketAreaAttributes.iterator(); iterator.hasNext();) {
                ProductSkuAttribute productSkuAttribute = (ProductSkuAttribute) iterator.next();
                productSkuForm.getMarketAreaAttributes().put(productSkuAttribute.getAttributeDefinition().getCode(), productSkuAttribute.getValueAsString());
            }
        }
        if(productMarketing != null){
            productSkuForm.setProductMarketingId("" + productMarketing.getId());
        }
        return productSkuForm;
    }
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.