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

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


    public GeolocContextResponse getGeolocMarketArea(@Context HttpServletRequest request) {
        GeolocContextResponse geolocContextResponse = new GeolocContextResponse();
       
        try {
            GeolocDataPojo geolocDataPojo = marketPojoService.getGeolocDataByRemoteAddress(request.getRemoteAddr());
            MarketAreaPojo marketAreaPojo = marketPojoService.getMarketAreaByGeolocData(geolocDataPojo);
            geolocContextResponse.setMarketArea(marketAreaPojo);
           
        } catch (Exception e) {
            logger.error("Some error during the Geoloc Context.", e);
           
View Full Code Here


    @Path("marketarea/set/{marketAreaCode}")
    @Produces(MediaType.APPLICATION_JSON)
    public ContextPojo selectMarketArea(@PathParam("marketAreaCode") final String marketAreaCode) {
        ContextPojo context = new ContextPojo();

        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);

        MarketPojo selectedMarket = marketPojoService.getMarketByCode(selectedMarketArea.getMarket().getCode());

        MarketPlacePojo selectedMarketPlace = marketPojoService.getMarketPlaceByCode(selectedMarket.getMarketPlace().getCode());

        // MARKET PLACE LIST
        buildMarketPlace(context, selectedMarketPlace);
View Full Code Here

        LocalizationPojo selectedLocalization = localizationPojoService.getLocalizationByCode(localizationCode);

        RetailerPojo selectedRetailer = retailerPojoService.getRetailerByCode(retailerCode);
       
        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);

        MarketPojo selectedMarket = marketPojoService.getMarketByCode(selectedMarketArea.getMarket().getCode());

        MarketPlacePojo selectedMarketPlace = marketPojoService.getMarketPlaceByCode(selectedMarket.getMarketPlace().getCode());

        // MARKET PLACE LIST
        buildMarketPlace(context, selectedMarketPlace);
View Full Code Here

        LocalizationPojo selectedLocalization = localizationPojoService.getLocalizationByCode(localizationCode);

        RetailerPojo selectedRetailer = retailerPojoService.getRetailerByCode(retailerCode);

        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);

        MarketPojo selectedMarket = marketPojoService.getMarketByCode(selectedMarketArea.getMarket().getCode());

        MarketPlacePojo selectedMarketPlace = marketPojoService.getMarketPlaceByCode(selectedMarket.getMarketPlace().getCode());

        // MARKET PLACE LIST
        buildMarketPlace(context, selectedMarketPlace);
View Full Code Here

    @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

    private void buildMarketArea(ContextPojo context, MarketPojo selectedMarket, MarketAreaPojo selectedMarketArea){
        List<MarketAreaPojo> marketAreas = new ArrayList<MarketAreaPojo>();
       
        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);
            }
        }
       
        context.setMarketAreas(marketAreas);
View Full Code Here

    @Path("marketarea/set/{marketAreaCode}")
    @Produces(MediaType.APPLICATION_JSON)
    public CmsContextPojo selectMarketArea(@PathParam("marketAreaCode") final String marketAreaCode) {
        CmsContextPojo cmsContext = new CmsContextPojo();

        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);

        MarketPojo selectedMarket = marketPojoService.getMarketByCode(selectedMarketArea.getMarket().getCode());

        MarketPlacePojo selectedMarketPlace = marketPojoService.getMarketPlaceByCode(selectedMarket.getMarketPlace().getCode());

        // MARKET PLACE LIST
        buildMarketPlace(cmsContext, selectedMarketPlace);
View Full Code Here

        LocalizationPojo selectedLocalization = localizationPojoService.getLocalizationByCode(localizationCode);

        RetailerPojo selectedRetailer = retailerPojoService.getRetailerByCode(retailerCode);
       
        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);

        MarketPojo selectedMarket = marketPojoService.getMarketByCode(selectedMarketArea.getMarket().getCode());

        MarketPlacePojo selectedMarketPlace = marketPojoService.getMarketPlaceByCode(selectedMarket.getMarketPlace().getCode());

        // MARKET PLACE LIST
        buildMarketPlace(cmsContext, selectedMarketPlace);
View Full Code Here

        LocalizationPojo selectedLocalization = localizationPojoService.getLocalizationByCode(localizationCode);

        RetailerPojo selectedRetailer = retailerPojoService.getRetailerByCode(retailerCode);

        MarketAreaPojo selectedMarketArea = marketPojoService.getMarketAreaByCode(marketAreaCode);

        MarketPojo selectedMarket = marketPojoService.getMarketByCode(selectedMarketArea.getMarket().getCode());

        MarketPlacePojo selectedMarketPlace = marketPojoService.getMarketPlaceByCode(selectedMarket.getMarketPlace().getCode());

        // MARKET PLACE LIST
        buildMarketPlace(cmsContext, selectedMarketPlace);
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.