Package org.hoteia.qalingo.core.domain

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


  @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){
      initRuleDetailsPage(requestUtil.getRequestData(request), model, modelAndView, rule);
    } else {
      final String url = requestUtil.getLastRequestUrl(request);
View Full Code Here


  @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

  @RequestMapping(value = BoUrls.RULE_EDIT_URL, method = RequestMethod.POST)
  public ModelAndView submitRuleEdit(final HttpServletRequest request, final Model model, @Valid RuleForm ruleForm,
                BindingResult result, ModelMap modelMap) throws Exception {

    final String currentRuleCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_RULE_CODE);
    final AbstractRuleReferential rule = ruleReferentialService.getRuleReferentialByCode(currentRuleCode);
   
    if (result.hasErrors()) {
      return ruleEdit(request, model);
    }
   
View Full Code Here

   
    final List<RuleViewBean> ruleViewBeans = new ArrayList<RuleViewBean>();

    final List<AbstractRuleReferential> rules = ruleReferentialService.findRuleReferentials();
    for (Iterator<AbstractRuleReferential> iterator = rules.iterator(); iterator.hasNext();) {
      AbstractRuleReferential rule = (AbstractRuleReferential) iterator.next();
      ruleViewBeans.add(backofficeViewBeanFactory.buildViewBeanRule(requestUtil.getRequestData(request), rule));
    }
    ruleViewBeanPagedListHolder = new PagedListHolder<RuleViewBean>(ruleViewBeans);
    ruleViewBeanPagedListHolder.setPageSize(Constants.PAGE_SIZE);
        request.getSession().setAttribute(sessionKey, ruleViewBeanPagedListHolder);
View Full Code Here

  public AbstractRuleReferential getRuleReferentialByRuleType(String ruleType) {
    Session session = (Session) em.getDelegate();
    String sql = "FROM AbstractRuleReferential WHERE upper(ruleType) = upper(:ruleType)";
    Query query = session.createQuery(sql);
    query.setString("ruleType", ruleType);
    AbstractRuleReferential ruleReferential = (AbstractRuleReferential) query.uniqueResult();
    return ruleReferential;
  }
View Full Code Here

  public AbstractRuleReferential getRuleReferentialByCode(String code) {
    Session session = (Session) em.getDelegate();
    String sql = "FROM AbstractRuleReferential WHERE upper(code) = upper(:code)";
    Query query = session.createQuery(sql);
    query.setString("code", code);
    AbstractRuleReferential ruleReferential = (AbstractRuleReferential) query.uniqueResult();
    return ruleReferential;
  }
View Full Code Here

                    } else if (param instanceof Asset) {
                        Asset asset = (Asset) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_ASSET_ID, handleParamValue(asset.getId().toString()));
                        break;
                    } else if (param instanceof AbstractRuleReferential) {
                        AbstractRuleReferential rule = (AbstractRuleReferential) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_RULE_CODE, handleParamValue(rule.getCode().toString()));
                        break;
                    } else if (param instanceof Warehouse) {
                        Warehouse warehouse = (Warehouse) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_WAREHOUSE_CODE, handleParamValue(warehouse.getCode().toString()));
                        break;
View Full Code Here

TOP

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

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.