Package org.hoteia.qalingo.core.domain

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


   
    public Company getCompanyById(final Long companyId, Object... params) {
        Criteria criteria = createDefaultCriteria(Company.class);
        FetchPlan fetchPlan = handleCompanySpecificFetchMode(criteria, params);
        criteria.add(Restrictions.eq("id", companyId));
        Company company = (Company) criteria.uniqueResult();
        if(company != null){
            company.setFetchPlan(fetchPlan);
        }
        return company;
    }
View Full Code Here


   
    public Company getCompanyByCode(final String companyCode, Object... params) {
        Criteria criteria = createDefaultCriteria(Company.class);
        FetchPlan fetchPlan = handleCompanySpecificFetchMode(criteria, params);
        criteria.add(Restrictions.eq("code", handleCodeValue(companyCode)));
        Company company = (Company) criteria.uniqueResult();
        if(company != null){
            company.setFetchPlan(fetchPlan);
        }
        return company;
    }
View Full Code Here

       
        if (company.getId() != null) {
            if(em.contains(company)){
                em.refresh(company);
            }
            Company mergedCompany = em.merge(company);
            em.flush();
            return mergedCompany;
        } else {
            em.persist(company);
            return company;
View Full Code Here

        }

        // CHECK BACKOFFICE LANGUAGES
        String backofficeLocalizationCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_LOCALE_CODE);
        // LOCALIZATIONS
        Company company = getCurrentCompany(request);
        if (company != null) {
            Localization localization = company.getLocalization(backofficeLocalizationCode);
            if (localization != null) {
                engineBoSession.setCurrentBackofficeLocalization(localization);
            }
        }
View Full Code Here

    public void updateCurrentCompany(final HttpServletRequest request, final Company company) throws Exception {
        if (company != null) {
            final EngineBoSession engineBoSession = getCurrentBoSession(request);
            if(engineBoSession != null){
                Company reloadedCompany = userService.getCompanyById(company.getId().toString());
                engineBoSession.setCurrentCompany(reloadedCompany);
                updateCurrentBoSession(request, engineBoSession);
            }
        }
    }
View Full Code Here

            User user = getCurrentUser(request);
            if (user != null) {
                requestData.setUser(user);
            }

            Company company = getCurrentCompany(request);
            if (company != null) {
                requestData.setCompany(company);
            }

            requestData.setBackofficeLocalization(getCurrentBackofficeLocalization(requestData));
View Full Code Here

        String jSessionId = request.getSession().getId();
        engineBoSession.setjSessionId(jSessionId);
        initDefaultBoMarketPlace(request);

        // Default Localization
        Company company = getCurrentCompany(request);
        if (company != null) {
            // USER IS LOGGED
            engineBoSession.setCurrentBackofficeLocalization(company.getDefaultLocalization());
        } else {
            Localization defaultLocalization = localizationService.getLocalizationByCode("en");
            engineBoSession.setCurrentBackofficeLocalization(defaultLocalization);
        }
View Full Code Here

            final MarketPlace currentMarketPlace = requestData.getMarketPlace();
            final Market currentMarket = requestData.getMarket();
            final MarketArea currentMarketArea = requestData.getMarketArea();
            final Localization currentLocalization = requestData.getMarketAreaLocalization();
            final User user = requestData.getUser();
            final Company company = requestData.getCompany();
           
            if(user != null){
                modelAndView.getModelMap().put(ModelConstants.AUTHENTICATED_USER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanUser(requestData, user));
            }
           
            modelAndView.getModelMap().put(ModelConstants.LEGAl_TERMS_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanLegalTerms(requestData));
           
            modelAndView.getModelMap().put(ModelConstants.HEADER_CART, backofficeViewBeanFactory.buildViewBeanHeaderCart(requestData));
           
            // ALL MARKETPLACES
            modelAndView.getModelMap().put(ModelConstants.MARKET_PLACES_VIEW_BEAN, backofficeViewBeanFactory.buildListViewBeanMarketPlace(requestData));

            // MARKETS FOR THE CURRENT MARKETPLACE
            Set<Market> marketList = currentMarketPlace.getMarkets();
            modelAndView.getModelMap().put(ModelConstants.MARKETS_VIEW_BEAN, backofficeViewBeanFactory.buildListViewBeanMarket(requestData, currentMarketPlace, new ArrayList<Market>(marketList)));

            // MARKET AREAS FOR THE CURRENT MARKET
            Set<MarketArea> marketAreaList = currentMarket.getMarketAreas();
            modelAndView.getModelMap().put(ModelConstants.MARKET_AREAS_VIEW_BEAN, backofficeViewBeanFactory.buildListViewBeanMarketArea(requestData, currentMarket, new ArrayList<MarketArea>(marketAreaList)));

            // LOCALIZATIONS FOR THE CURRENT MARKET AREA
            modelAndView.getModelMap().put(ModelConstants.MARKET_AREA_LANGUAGES_VIEW_BEAN, backofficeViewBeanFactory.buildListViewBeanLocalizationByMarketArea(requestData, currentLocalization));

            // RETAILERS FOR THE CURRENT MARKET AREA
            modelAndView.getModelMap().put(ModelConstants.MARKET_AREA_RETAILERS_VIEW_BEAN, backofficeViewBeanFactory.buildListViewBeanRetailerByMarketArea(requestData));

            // CURRENCIES FOR THE CURRENT MARKET AREA
            modelAndView.getModelMap().put(ModelConstants.MARKET_AREA_CURRENCIES_VIEW_BEAN, backofficeViewBeanFactory.buildListViewBeanCurrenciesByMarketArea(requestData));

            // CURRENT MARKET AREA
            modelAndView.getModelMap().put(ModelConstants.MARKET_AREA_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanMarketArea(requestData, currentMarketArea));

            // BACKOFFICE LOCALIZATIONS
            List<Localization> backofficeLocalizations = new ArrayList<Localization>();
            if(company != null){
                backofficeLocalizations = new ArrayList<Localization>(company.getLocalizations());
            } else {
                backofficeLocalizations.add(localizationService.getLocalizationByCode("en"));
                backofficeLocalizations.add(localizationService.getLocalizationByCode("fr"));
            }
            modelAndView.getModelMap().put(ModelConstants.BACKOFFICE_LOCALIZATION_VIEW_BEAN, backofficeViewBeanFactory.buildListViewBeanLocalization(requestData, backofficeLocalizations));
View Full Code Here

     *
     */
    public List<CompanyViewBean> buildListViewBeanCompany(final RequestData requestData, final List<Company> companys) throws Exception {
        final List<CompanyViewBean> companyViewBeans = new ArrayList<CompanyViewBean>();
        for (Iterator<Company> iterator = companys.iterator(); iterator.hasNext();) {
            Company company = (Company) iterator.next();
            companyViewBeans.add(buildViewBeanCompany(requestData, company));
        }
        return companyViewBeans;
    }
View Full Code Here

    // THEME
    try {
        final RequestData requestData = requestUtil.getRequestData(request);
      User user = requestData.getUser();
      if(user !=null){
        final Company company = user.getCompany();
        if(company != null
            && StringUtils.isNotEmpty(company.getTheme())){
          String themeFolder = company.getTheme();
          requestUtil.updateCurrentTheme(request, themeFolder);
        }
      }
     
    } catch (Exception e) {
View Full Code Here

TOP

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

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.