Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.CatalogVirtual


    private MarketArea marketArea;
    private Retailer retailer;
   
    @Before
    public void setUp() throws Exception {
        virtualCatalog = new CatalogVirtual();
        virtualCatalog.setId(new Long("1"));
        virtualCatalog.setCode("V_CAT_XXX");
       
        marketArea = new MarketArea();
        marketArea.setId(new Long("1"));
View Full Code Here


    private MarketArea marketArea;
    private Retailer retailer;
   
    @Before
    public void setUp() throws Exception {
        virtualCatalog = new CatalogVirtual();
        virtualCatalog.setId(new Long("1"));
        virtualCatalog.setCode("V_CAT_XXX");
       
        marketArea = new MarketArea();
        marketArea.setId(new Long("1"));
View Full Code Here

        logger.debug("Found catalog {} for catalogCode {}", catalog, catalogCode);
        return buildMasterCatalog(catalog);
    }
   
    public CatalogPojo getVirtualCatalogByCode(final String catalogCode) {
        final CatalogVirtual catalog = catalogService.getVirtualCatalogByCode(catalogCode);
        logger.debug("Found catalog {} for catalogCode {}", catalog, catalogCode);
        return buildVirtualCatalog(catalog);
    }
View Full Code Here

       
        FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);
       
        criteria.add(Restrictions.eq("id", virtualCatalogId));
       
        CatalogVirtual catalogVirtual = (CatalogVirtual) criteria.uniqueResult();
        if(catalogVirtual != null){
            catalogVirtual.setFetchPlan(fetchPlan);
        }
        return catalogVirtual;
    }
View Full Code Here

       
        criteria.setFetchMode("catalogMaster", FetchMode.JOIN);
        criteria.createAlias("marketArea", "marketArea", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("marketArea.id", marketAreaId));

        CatalogVirtual catalogVirtual = (CatalogVirtual) criteria.uniqueResult();
        if(catalogVirtual != null){
            catalogVirtual.setFetchPlan(fetchPlan);
        }
    return catalogVirtual;
  }
View Full Code Here

       
        FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);

        criteria.add(Restrictions.eq("code", virtualCatalogCode));

        CatalogVirtual catalog = (CatalogVirtual) criteria.uniqueResult();
        if(catalog != null){
            catalog.setFetchPlan(fetchPlan);
        }
        return catalog;
    }
View Full Code Here

        catalogVirtual.setDateUpdate(new Date());
        if (catalogVirtual.getId() != null) {
            if(em.contains(catalogVirtual)){
                em.refresh(catalogVirtual);
            }
            CatalogVirtual mergedCatalogVirtual = em.merge(catalogVirtual);
            em.flush();
            return mergedCatalogVirtual;
        } else {
            em.persist(catalogVirtual);
            return catalogVirtual;
View Full Code Here

        MenuViewBean menu = new MenuViewBean();
        menu.setName(getSpecificMessage(ScopeWebMessage.HEADER_MENU, "home", locale));
        menu.setUrl(urlService.generateUrl(FoUrls.HOME, requestData));
        menuViewBeans.add(menu);

        CatalogVirtual catalogVirtual = catalogService.getVirtualCatalogbyMarketAreaId(marketArea.getId());
        if (catalogVirtual != null) {
            final List<CatalogCategoryVirtual> catalogCategories = catalogVirtual.getSortedRootCatalogCategories();
            if (catalogCategories != null) {
                for (Iterator<CatalogCategoryVirtual> iteratorCatalogCategory = catalogCategories.iterator(); iteratorCatalogCategory.hasNext();) {
                    final CatalogCategoryVirtual catalogCategory = (CatalogCategoryVirtual) iteratorCatalogCategory.next();
                    final CatalogCategoryVirtual catalogCategoryReloaded = catalogCategoryService.getVirtualCatalogCategoryById(catalogCategory.getId(), categoryFetchPlan);
                   
View Full Code Here

            } catch (Exception e) {
                logger.error("", e);
            }
           
        } else if("virtual".equals(catalogType)){
            final CatalogVirtual catalogVirtual = catalogService.getVirtualCatalogById(currentMarketArea.getCatalog().getId());

            Set<CatalogCategoryVirtual> catalogCategories = new HashSet<CatalogCategoryVirtual>();
            if(catalogVirtual.getCatalogCategories() != null){
                for (Iterator<CatalogCategoryVirtual> iterator = catalogVirtual.getCatalogCategories().iterator(); iterator.hasNext();) {
                    CatalogCategoryVirtual categoryVirtual = (CatalogCategoryVirtual) iterator.next();
                    CatalogCategoryVirtual reloadedCategoryVirtual = catalogCategoryService.getVirtualCatalogCategoryById(categoryVirtual.getId(), new FetchPlan(categoryVirtualFetchPlans));
                    Set<CatalogCategoryVirtual> reloadedSubCategories = new HashSet<CatalogCategoryVirtual>();
                    if(reloadedCategoryVirtual.getSortedChildCatalogCategories() != null){
                        for (Iterator<CatalogCategoryVirtual> iteratorSubCategories = reloadedCategoryVirtual.getSortedChildCatalogCategories().iterator(); iteratorSubCategories.hasNext();) {
                            CatalogCategoryVirtual subCategory = (CatalogCategoryVirtual) iteratorSubCategories.next();
                            CatalogCategoryVirtual reloadedSubCategory = catalogCategoryService.getVirtualCatalogCategoryById(subCategory.getId(), new FetchPlan(categoryVirtualFetchPlans));
                            reloadedSubCategories.add(reloadedSubCategory);
                        }
                    }
                    reloadedCategoryVirtual.setCatalogCategories(reloadedSubCategories);
                    catalogCategories.add(reloadedCategoryVirtual);
                }
            }
            catalogVirtual.setCatalogCategories(new HashSet<CatalogCategoryVirtual>(catalogCategories));
           
            try {
                catalogPojo = (CatalogPojo) catalogPojoService.buildVirtualCatalog(catalogVirtual);
            } catch (Exception e) {
                logger.error("", e);
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.CatalogVirtual

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.