Package org.hoteia.qalingo.core.web.servlet

Examples of org.hoteia.qalingo.core.web.servlet.ModelAndViewThemeDevice


  public ModelAndView submitMasterCatalogCategoryForm(final HttpServletRequest request, final Model model, @Valid @ModelAttribute(ModelConstants.CATALOG_CATEGORY_FORM) CatalogCategoryForm catalogCategoryForm,
                          BindingResult result, ModelMap modelMap) throws Exception {
   
    // TODO : Denis : refactoring, clean
   
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.MASTER_CATEGORY_EDIT.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
        final Retailer currentRetailer = requestData.getMarketAreaRetailer();
        final Localization currentLocalization = requestData.getMarketAreaLocalization();
        final Locale locale = requestData.getLocale();
View Full Code Here


  @Autowired
  private ProductService productMarketingService;
 
  @RequestMapping(value = BoUrls.ASSET_DETAILS_URL, method = RequestMethod.GET)
  public ModelAndView assetDetails(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.ASSET_DETAILS.getVelocityPage());

    final String currentAssetId = request.getParameter(RequestConstants.REQUEST_PARAMETER_ASSET_ID);
    final Asset asset = productMarketingService.getProductMarketingAssetById(currentAssetId);
   
    if(asset != null){
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = BoUrls.ASSET_EDIT_URL, method = RequestMethod.GET)
  public ModelAndView display(final HttpServletRequest request, final HttpServletResponse response, ModelMap modelMap) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.ASSET_EDIT.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
    final String currentAssetId = request.getParameter(RequestConstants.REQUEST_PARAMETER_ASSET_ID);
    if(StringUtils.isNotEmpty(currentAssetId)){
      final Asset asset = productMarketingService.getProductMarketingAssetById(currentAssetId);

      modelAndView.addObject(ModelConstants.ASSET_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanAsset(requestUtil.getRequestData(request), asset));
      modelAndView.addObject(ModelConstants.ASSET_FORM, backofficeFormFactory.buildProductMarketingAssetForm(requestData, asset));
      return modelAndView;
    } else {
      final String urlRedirect = backofficeUrlService.generateUrl(BoUrls.HOME, requestUtil.getRequestData(request));
          return new ModelAndView(new RedirectView(urlRedirect));
    }
View Full Code Here

    @Autowired
    private WarehouseService warehouseService;
   
  @RequestMapping(value = BoUrls.DELIVERY_METHOD_LIST_URL, method = RequestMethod.GET)
  public ModelAndView deliveryMethodList(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.DELIVERY_METHOD_LIST.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea marketArea = requestData.getMarketArea();
       
    displayList(request, model, requestData);
   
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = BoUrls.DELIVERY_METHOD_DETAILS_URL, method = RequestMethod.GET)
  public ModelAndView deliveryMethodDetails(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.DELIVERY_METHOD_DETAILS.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
   
    final String deliveryMethodCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_DELIVERY_METHOD_CODE);
   
        // SANITY CHECK
        if(StringUtils.isEmpty(deliveryMethodCode)){
            final String urlRedirect = backofficeUrlService.generateUrl(BoUrls.DELIVERY_METHOD_LIST, requestData);
            return new ModelAndView(new RedirectView(urlRedirect));
        }
       
    final DeliveryMethod deliveryMethod = deliveryMethodService.getDeliveryMethodByCode(deliveryMethodCode);
   
        // SANITY CHECK
    if(deliveryMethod != null){
          modelAndView.addObject(ModelConstants.DELIVERY_METHOD_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanDeliveryMethod(requestData, deliveryMethod));
    } else {
      final String url = requestUtil.getLastRequestUrl(request);
      return new ModelAndView(new RedirectView(url));
    }
   
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = BoUrls.DELIVERY_METHOD_EDIT_URL, method = RequestMethod.GET)
  public ModelAndView deliveryMethodEdit(final HttpServletRequest request, final Model model, @ModelAttribute(ModelConstants.DELIVERY_METHOD_FORM) DeliveryMethodForm deliveryMethodForm) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.DELIVERY_METHOD_EDIT.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String deliveryMethodCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_DELIVERY_METHOD_CODE);
        if(StringUtils.isNotEmpty(deliveryMethodCode)){
            // EDIT MODE
View Full Code Here

  @Autowired
  private RuleReferentialService ruleReferentialService;

  @RequestMapping(value = BoUrls.RULE_LIST_URL, method = RequestMethod.GET)
  public ModelAndView ruleList(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.RULE_LIST.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
   
    String url = request.getRequestURI();
    String page = request.getParameter(Constants.PAGINATION_PAGE_PARAMETER);
    String sessionKey = "PagedListHolder_Rules";
   
    PagedListHolder<RuleViewBean> ruleViewBeanPagedListHolder = new PagedListHolder<RuleViewBean>();
   
        if(StringUtils.isEmpty(page)){
          ruleViewBeanPagedListHolder = initList(request, sessionKey);
       
        } else {
          ruleViewBeanPagedListHolder = (PagedListHolder) request.getSession().getAttribute(sessionKey);
          if (ruleViewBeanPagedListHolder == null) {
            ruleViewBeanPagedListHolder = initList(request, sessionKey);
          }
          int pageTarget = new Integer(page).intValue() - 1;
          int pageCurrent = ruleViewBeanPagedListHolder.getPage();
          if (pageCurrent < pageTarget) {
            for (int i = pageCurrent; i < pageTarget; i++) {
              ruleViewBeanPagedListHolder.nextPage();
        }
          } else if (pageCurrent > pageTarget) {
            for (int i = pageTarget; i < pageCurrent; i++) {
              ruleViewBeanPagedListHolder.previousPage();
        }
          }
        }
    modelAndView.addObject(Constants.PAGINATION_PAGE_URL, url);
    modelAndView.addObject(Constants.PAGINATION_PAGE_PAGED_LIST_HOLDER, ruleViewBeanPagedListHolder);
   
        return modelAndView;
  }
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = BoUrls.RULE_DETAILS_URL, method = RequestMethod.GET)
  public ModelAndView ruleDetails(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.RULE_DETAILS.getVelocityPage());

    final String currentRuleCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_RULE_CODE);
    final AbstractRuleReferential rule = ruleReferentialService.getRuleReferentialByCode(currentRuleCode);
   
    if(rule != null){
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = BoUrls.RULE_EDIT_URL, method = RequestMethod.GET)
  public ModelAndView ruleEdit(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.RULE_EDIT.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
    final String currentRuleCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_RULE_CODE);
    final AbstractRuleReferential rule = ruleReferentialService.getRuleReferentialByCode(currentRuleCode);

    modelAndView.addObject(ModelConstants.RULE_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanRule(requestData, rule));
    modelAndView.addObject(ModelConstants.RULE_FORM, backofficeFormFactory.buildRuleForm(requestData, rule));
    return modelAndView;
  }
View Full Code Here

    @Autowired
    protected ServerService serverService;
 
  @RequestMapping(BoUrls.MONITORING_URL)
  public ModelAndView searchMonitoring(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.MONITORING.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
       
    List<ServerStatus> severList = serverService.findServerList();
    modelAndView.addObject("severList", severList);
   
    List<ServerStatus> severStatusList = serverService.findServerStatus();
    modelAndView.addObject("severStatusList", severStatusList);
   
        return modelAndView;
  }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.servlet.ModelAndViewThemeDevice

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.