Examples of CmsProductsPojo


Examples of org.hoteia.qalingo.core.pojo.cms.CmsProductsPojo

   
    @GET
    @Path("catalog/products/{marketAreaCode}/{categoryCode}")
    @Produces(MediaType.APPLICATION_JSON)
    public CmsProductsPojo productsByMarketArea(@PathParam("marketAreaCode") final String marketAreaCode, @PathParam("categoryCode") final String categoryCode) {
        CmsProductsPojo cmsProducts = new CmsProductsPojo();

        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);
        if(selectedMarketArea != null){
            selectedMarketArea.setMarket(null);
            selectedMarketArea.setRetailers(null);
            selectedMarketArea.setLocalizations(null);
           
            cmsProducts.setMarketArea(selectedMarketArea);
           
            List<CatalogCategoryPojo> categories = selectedMarketArea.getCatalog().getSortedRootCatalogCategories();
            for (Iterator<CatalogCategoryPojo> iterator = categories.iterator(); iterator.hasNext();) {
                CatalogCategoryPojo catalogCategoryPojo = (CatalogCategoryPojo) iterator.next();
                if(catalogCategoryPojo.getCode().equals(categoryCode)){
                    List<ProductMarketingPojo> products = catalogCategoryPojo.getProductMarketings();
                    for (Iterator<ProductMarketingPojo> iteratorProductMarketingPojo = products.iterator(); iteratorProductMarketingPojo.hasNext();) {
                        ProductMarketingPojo productMarketingPojo = (ProductMarketingPojo) iteratorProductMarketingPojo.next();
                        productMarketingPojo.setProductBrand(null);
                        productMarketingPojo.setProductMarketingMarketAreaAttributes(null);
                        productMarketingPojo.setProductMarketingGlobalAttributes(null);
                        productMarketingPojo.setProductSkus(null);
                        productMarketingPojo.setProductAssociationLinks(null);
                    }
                    cmsProducts.setProductMarketings(products);
                }
            }

            CatalogPojo catalog = selectedMarketArea.getCatalog();
            catalog.setSortedRootCatalogCategories(null);
            cmsProducts.setCatalog(catalog);

        }

        return cmsProducts;
    }
View Full Code Here

Examples of org.hoteia.qalingo.core.pojo.cms.CmsProductsPojo

   
    @GET
    @Path("catalog/products/{marketAreaCode}/{categoryCode}")
    @Produces(MediaType.APPLICATION_JSON)
    public CmsProductsPojo productsByMarketArea(@PathParam("marketAreaCode") final String marketAreaCode, @PathParam("categoryCode") final String categoryCode) {
        CmsProductsPojo cmsProducts = new CmsProductsPojo();

        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);
        if(selectedMarketArea != null){
            selectedMarketArea.setMarket(null);
            selectedMarketArea.setRetailers(null);
            selectedMarketArea.setLocalizations(null);
           
            cmsProducts.setMarketArea(selectedMarketArea);
           
            List<CatalogCategoryPojo> categories = selectedMarketArea.getCatalog().getSortedRootCatalogCategories();
            for (Iterator<CatalogCategoryPojo> iterator = categories.iterator(); iterator.hasNext();) {
                CatalogCategoryPojo catalogCategoryPojo = (CatalogCategoryPojo) iterator.next();
                if(catalogCategoryPojo.getCode().equals(categoryCode)){
                    List<ProductMarketingPojo> products = catalogCategoryPojo.getProductMarketings();
                    for (Iterator<ProductMarketingPojo> iteratorProductMarketingPojo = products.iterator(); iteratorProductMarketingPojo.hasNext();) {
                        ProductMarketingPojo productMarketingPojo = (ProductMarketingPojo) iteratorProductMarketingPojo.next();
                        productMarketingPojo.setProductBrand(null);
                        productMarketingPojo.setProductMarketingMarketAreaAttributes(null);
                        productMarketingPojo.setProductMarketingGlobalAttributes(null);
                        productMarketingPojo.setProductSkus(null);
                        productMarketingPojo.setProductAssociationLinks(null);
                    }
                    cmsProducts.setProductMarketings(products);
                }
            }

            CatalogPojo catalog = selectedMarketArea.getCatalog();
            catalog.setSortedRootCatalogCategories(null);
            cmsProducts.setCatalog(catalog);

        }

        return cmsProducts;
    }
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.