ConfigurazioneAuditingFiltriList.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */


  20. package org.openspcoop2.web.ctrlstat.servlet.config;

  21. import java.util.List;

  22. import javax.servlet.http.HttpServletRequest;
  23. import javax.servlet.http.HttpServletResponse;
  24. import javax.servlet.http.HttpSession;

  25. import org.apache.struts.action.Action;
  26. import org.apache.struts.action.ActionForm;
  27. import org.apache.struts.action.ActionForward;
  28. import org.apache.struts.action.ActionMapping;
  29. import org.openspcoop2.core.commons.Liste;
  30. import org.openspcoop2.web.ctrlstat.core.ControlStationCore;
  31. import org.openspcoop2.web.ctrlstat.servlet.GeneralHelper;
  32. import org.openspcoop2.web.ctrlstat.core.ConsoleSearch;
  33. import org.openspcoop2.web.lib.audit.dao.Filtro;
  34. import org.openspcoop2.web.lib.audit.web.AuditCostanti;
  35. import org.openspcoop2.web.lib.audit.web.AuditHelper;
  36. import org.openspcoop2.web.lib.mvc.ForwardParams;
  37. import org.openspcoop2.web.lib.mvc.GeneralData;
  38. import org.openspcoop2.web.lib.mvc.PageData;
  39. import org.openspcoop2.web.lib.mvc.ServletUtils;

  40. /**
  41.  * filtriList
  42.  *
  43.  * @author Andrea Poli (apoli@link.it)
  44.  * @author Stefano Corallo (corallo@link.it)
  45.  * @author Sandra Giangrandi (sandra@link.it)
  46.  * @author $Author$
  47.  * @version $Rev$, $Date$
  48.  *
  49.  */
  50. public final class ConfigurazioneAuditingFiltriList extends Action {

  51.     @Override
  52.     public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

  53.         HttpSession session = request.getSession(true);

  54.         // Inizializzo PageData
  55.         PageData pd = new PageData();

  56.         GeneralHelper generalHelper = new GeneralHelper(session);

  57.         // Inizializzo GeneralData
  58.         GeneralData gd = generalHelper.initGeneralData(request);

  59.         //  String userLogin = ServletUtils.getUserLoginFromSession(session);  

  60.         try {
  61.             ConfigurazioneHelper confHelper = new ConfigurazioneHelper(request, pd, session);

  62.             ConfigurazioneCore confCore = new ConfigurazioneCore();

  63.             // Preparo il menu
  64.             confHelper.makeMenu();

  65.             // Preparo la lista
  66.             ConsoleSearch ricerca = (ConsoleSearch) ServletUtils.getSearchObjectFromSession(request, session, ConsoleSearch.class);

  67.             int idLista = Liste.FILTRI;

  68.             ricerca = confHelper.checkSearchParameters(idLista, ricerca);

  69.             List<Filtro> lista = null;
  70.             lista = confCore.filtriList(ricerca);

  71.             AuditHelper ah = new AuditHelper(request, pd, session);
  72.             ah.prepareFiltriList(ricerca, lista, idLista);

  73.             // salvo l'oggetto ricerca nella sessione
  74.             ServletUtils.setSearchObjectIntoSession(request, session, ricerca);
  75.             ServletUtils.setGeneralAndPageDataIntoSession(request, session, gd, pd);
  76.            
  77.             // Forward control to the specified success URI
  78.             return ServletUtils.getStrutsForward (mapping, AuditCostanti.OBJECT_NAME_CONFIGURAZIONE_AUDITING_FILTRI,
  79.                     ForwardParams.LIST());
  80.         } catch (Exception e) {
  81.             return ServletUtils.getStrutsForwardError(ControlStationCore.getLog(), e, pd, request, session, gd, mapping,
  82.                     AuditCostanti.OBJECT_NAME_CONFIGURAZIONE_AUDITING_FILTRI, ForwardParams.LIST());
  83.         }  
  84.     }
  85. }