Package fr.norsys.mapper.console.model

Examples of fr.norsys.mapper.console.model.GlobalFilter


   * Save the filter in the current intFilter
   * @param filter
   * @return
   */
  public void save(Filter filter) throws Exception {
    GlobalFilter globalFilter = (GlobalFilter) ExecutionContext.get().getSession().getAttribute(ConsoleCst.GLOBALFILTER);
    IntFilter intFilter = (IntFilter) ExecutionContext.get().getSession().getAttribute(ConsoleCst.INTFILTER);
    filterService.save(filter,intFilter);
    globalFilter.save(intFilter);
  }
View Full Code Here


      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    if (log.isDebugEnabled()) {
      log.debug("init method called");
    }
    GlobalFilter globalFilter;
    IntFilter intFilter;
    DynaActionForm filterForm = (DynaActionForm) form;
    String globalFilterValue = request.getParameter("val");
    // Initialisation du filtre global
    if (globalFilterValue == null || "".equals(globalFilterValue)) {
      // Aucun filtre n'�tait pass� en param�tre
      globalFilter = new GlobalFilter();
      intFilter = new IntFilter();
      globalFilter.save(intFilter);
    } else {
      // Test de la validit� du filtre
      String result = filterService.validateFilter(globalFilterValue);
      // Si la cha�ne est vide, le filtre est invalide
      if (result.equals("")) {
        globalFilter = new GlobalFilter();
        intFilter = new IntFilter();
        globalFilter.save(intFilter);
      } else { // La valeur du filtre est valide
        globalFilter = new GlobalFilter();
        globalFilter.init(globalFilterValue, result);
        intFilter = globalFilter.getFirst();
      }
    }
    filterForm.set(ConsoleCst.GLOBALFILTER, globalFilter);
    filterForm.set(ConsoleCst.INTFILTER, intFilter);
    request.getSession().setAttribute(ConsoleCst.INTFILTER_SESSION_BEAN,
        globalFilter.getFilterList());
    request.getSession().setAttribute(ConsoleCst.FILTER_SESSION_BEAN,
        intFilter.getFilterList());
    request.getSession()
        .setAttribute(ConsoleCst.GLOBALFILTER, globalFilter);
    request.getSession().setAttribute(ConsoleCst.INTFILTER, intFilter);
View Full Code Here

    }
    DynaActionForm filterForm = (DynaActionForm) form;
    // Transmission des attributs de filtre au formulaire
    IntFilter intFilter = (IntFilter) request.getSession().getAttribute(
        ConsoleCst.INTFILTER);
    GlobalFilter globalFilter = (GlobalFilter) request.getSession()
        .getAttribute(ConsoleCst.GLOBALFILTER);
    request.getSession().setAttribute(ConsoleCst.FILTER_SESSION_BEAN,
        intFilter.getFilterList());
    request.getSession().setAttribute(ConsoleCst.INTFILTER_SESSION_BEAN,
        globalFilter.getFilterList());
    filterForm.set(ConsoleCst.FILTER_REQUEST_BEAN, new Filter());
    return mapping.findForward(indexForward);
  }
View Full Code Here

      log.debug("delete method called");
    }
    String id = request.getParameter("id");
    // Suppression de l'attribut de filtre
    if (id != null && !"".equals(id)) {
      GlobalFilter globalFilter = (GlobalFilter) request.getSession()
          .getAttribute(ConsoleCst.GLOBALFILTER);
      IntFilter intFilter = (IntFilter) request.getSession()
          .getAttribute(ConsoleCst.INTFILTER);
      filterService.delete(id, intFilter);
      globalFilter.save(intFilter);
      request.getSession().setAttribute(ConsoleCst.INTFILTER, intFilter);
      request.getSession().setAttribute(ConsoleCst.GLOBALFILTER,
          globalFilter);
      // Mise � jour du formulaire
      request.getSession().setAttribute(ConsoleCst.FILTER_SESSION_BEAN,
View Full Code Here

      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    if (log.isDebugEnabled()) {
      log.debug("intSave method called");
    }
    GlobalFilter globalFilter = (GlobalFilter) request.getSession()
        .getAttribute(ConsoleCst.GLOBALFILTER);
    // Si le filtre global n'a aucun filtre vide, on en cr�e un
    if (!globalFilter.hasVoidFilter()) {
      IntFilter intFilter = (IntFilter) request.getSession()
          .getAttribute(ConsoleCst.INTFILTER);
      filterService.intAdd(intFilter, globalFilter);
      // Sauvegarde du nouveau filtre interm�diaire
      intFilter = new IntFilter();
      intFilter.changeOp("ET");
      filterService.intAdd(intFilter, globalFilter);
      request.getSession().setAttribute(ConsoleCst.INTFILTER, intFilter);
      request.getSession().setAttribute(
          ConsoleCst.INTFILTER_SESSION_BEAN,
          globalFilter.getFilterList());
      request.getSession().setAttribute(ConsoleCst.FILTER_SESSION_BEAN,
          intFilter.getFilterList());
    }
    return mapping.findForward(indexForward);
  }
View Full Code Here

      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    if (log.isDebugEnabled()) {
      log.debug("intDelete method called");
    }
    GlobalFilter globalFilter = (GlobalFilter) request.getSession()
        .getAttribute(ConsoleCst.GLOBALFILTER);
    String id = request.getParameter("intId");
    if (id != null && !"".equals(id)) {
      globalFilter.delete(id);
      IntFilter intFilter = globalFilter.getFirst();
      request.getSession().setAttribute(ConsoleCst.INTFILTER, intFilter);
      request.getSession().setAttribute(ConsoleCst.FILTER_SESSION_BEAN,
        intFilter.getFilterList());
      request.getSession().setAttribute(
          ConsoleCst.INTFILTER_SESSION_BEAN,
          globalFilter.getFilterList());
    }
    return mapping.findForward(indexForward);
  }
View Full Code Here

      log.debug("selectFilter method called");
    }
    // Changement du filtre interm�diaire
    if ((request.getParameter("interFilter")) != null) {
      String id = request.getParameter("interFilter");
      GlobalFilter globalFilter = (GlobalFilter) request.getSession()
          .getAttribute(ConsoleCst.GLOBALFILTER);
      IntFilter intFilter = globalFilter.get(id);
      request.getSession().setAttribute(ConsoleCst.INTFILTER, intFilter);
      request.getSession().setAttribute(ConsoleCst.FILTER_SESSION_BEAN,
          intFilter.getFilterList());
    }
    return mapping.findForward(indexForward);
View Full Code Here

          .getAttribute(ConsoleCst.INTFILTER);
      // On effectue le changement d'op�rateur si et seulement s'il y a
      // au moins deux attributs de filtre
      if (intFilter.nbAttr() >= 2) {
        intFilter.changeOp(op);
        GlobalFilter globalFilter = (GlobalFilter) request.getSession()
            .getAttribute(ConsoleCst.GLOBALFILTER);
        globalFilter.save(intFilter);
      }
    }
    return mapping.findForward(indexForward);
  }
View Full Code Here

    if (log.isDebugEnabled()) {
      log.debug("selectGlobOp method called");
    }
    if ((request.getParameter("globOperator")) != null) {
      String op = request.getParameter("globOperator");
      GlobalFilter globalFilter = (GlobalFilter) request.getSession()
          .getAttribute(ConsoleCst.GLOBALFILTER);
      // On effectue le changement d'op�rateur si et seulement s'il y a
      // au moins deux filtres interm�diaires
      if (globalFilter.nbAttr() >= 2) {
        globalFilter.changeOp(op);
      }
    }
    return mapping.findForward(indexForward);
  }
View Full Code Here

TOP

Related Classes of fr.norsys.mapper.console.model.GlobalFilter

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.