Package org.hoteia.qalingo.core.pojo.market

Examples of org.hoteia.qalingo.core.pojo.market.MarketAreaPojo


    @Path("catalog/categories/{marketAreaCode}")
    @Produces(MediaType.APPLICATION_JSON)
    public CmsCategoriesPojo categoriesByMarketArea(@PathParam("marketAreaCode") final String marketAreaCode) {
        CmsCategoriesPojo cmsCategories = new CmsCategoriesPojo();

        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);
        if(selectedMarketArea != null){
            selectedMarketArea.setMarket(null);
            selectedMarketArea.setRetailers(null);
            selectedMarketArea.setLocalizations(null);
           
            cmsCategories.setMarketArea(selectedMarketArea);
            List<CatalogCategoryPojo> categories = selectedMarketArea.getCatalog().getSortedRootCatalogCategories();
            for (Iterator<CatalogCategoryPojo> iterator = categories.iterator(); iterator.hasNext();) {
                CatalogCategoryPojo catalogCategoryPojo = (CatalogCategoryPojo) iterator.next();
                catalogCategoryPojo.setCatalogCategoryGlobalAttributes(null);
                catalogCategoryPojo.setCatalogCategoryMarketAreaAttributes(null);
                catalogCategoryPojo.setProductMarketings(null);
            }
            cmsCategories.setCatalogCategories(categories);
           
            CatalogPojo catalog = selectedMarketArea.getCatalog();
            catalog.setSortedRootCatalogCategories(null);
            catalog.setSortedAllCatalogCategories(null);
            cmsCategories.setCatalog(catalog);
        }
View Full Code Here


    @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);

        }
View Full Code Here

        cmsContext.setMarkets(markets);
    }
   
    private void buildMarketArea(CmsContextPojo cmsContext, MarketPojo selectedMarket, MarketAreaPojo selectedMarketArea){
        List<MarketAreaPojo> marketAreas = new ArrayList<MarketAreaPojo>();
        MarketAreaPojo masterArea = new MarketAreaPojo();
        masterArea.setCode("MASTER_MARKET_AREA");
        masterArea.setName("Master Market Area");
        if(selectedMarket == null){
            masterArea.setSelected(true);
        }
        marketAreas.add(masterArea);
       
        if(selectedMarket != null){
            for (Iterator<MarketAreaPojo> iterator = selectedMarket.getMarketAreas().iterator(); iterator.hasNext();) {
                MarketAreaPojo marketAreaPojo = (MarketAreaPojo) iterator.next();
                MarketAreaPojo marketArea = marketPojoService.getMarketAreaByCode(marketAreaPojo.getCode());
                if(selectedMarketArea != null
                        && marketArea.getCode().equals(selectedMarketArea.getCode())){
                    marketArea.setSelected(true);
                }
                marketArea.setMarket(null);
                marketArea.setRetailers(null);
                marketArea.setLocalizations(null);
                marketAreas.add(marketArea);
            }
        }
       
        cmsContext.setMarketAreas(marketAreas);
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.pojo.market.MarketAreaPojo

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.