SoggettiCredenzialiList.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.soggetti;

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

  24. import org.apache.struts.action.Action;
  25. import org.apache.struts.action.ActionForm;
  26. import org.apache.struts.action.ActionForward;
  27. import org.apache.struts.action.ActionMapping;
  28. import org.openspcoop2.core.registry.Soggetto;
  29. import org.openspcoop2.web.ctrlstat.core.ControlStationCore;
  30. import org.openspcoop2.web.ctrlstat.servlet.GeneralHelper;
  31. import org.openspcoop2.web.lib.mvc.ForwardParams;
  32. import org.openspcoop2.web.lib.mvc.GeneralData;
  33. import org.openspcoop2.web.lib.mvc.PageData;
  34. import org.openspcoop2.web.lib.mvc.ServletUtils;

  35. /**
  36.  * SoggettiCredenzialiList
  37.  *
  38.  * @author Andrea Poli (apoli@link.it)
  39.  * @author Giuliano Pintori (pintori@link.it)
  40.  * @author $Author$
  41.  * @version $Rev$, $Date$
  42.  *
  43.  */
  44. public final class SoggettiCredenzialiList extends Action {

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

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

  48.         // Inizializzo PageData
  49.         PageData pd = new PageData();

  50.         GeneralHelper generalHelper = new GeneralHelper(session);

  51.         // Inizializzo GeneralData
  52.         GeneralData gd = generalHelper.initGeneralData(request);

  53.         try {

  54.             // ctrlstatHelper ch = new ctrlstatHelper(request, pd, con, session);
  55.             // Preparo il menu
  56.             // ch.makeMenu();
  57.             SoggettiHelper soggettiHelper = new SoggettiHelper(request, pd, session);
  58.             soggettiHelper.makeMenu();
  59.            
  60.             String id = soggettiHelper.getParameter(SoggettiCostanti.PARAMETRO_SOGGETTO_ID);
  61.             int idSogg = Integer.parseInt(id);

  62.             SoggettiCore soggettiCore = new SoggettiCore();
  63.            
  64.             Soggetto soggettoRegistry = soggettiCore.getSoggettoRegistro(idSogg);
  65.            
  66.             soggettiHelper.prepareSoggettiCredenzialiList(soggettoRegistry, id);
  67.        
  68.             ServletUtils.setGeneralAndPageDataIntoSession(request, session, gd, pd);
  69.            
  70.             return ServletUtils.getStrutsForward(mapping, SoggettiCostanti.OBJECT_NAME_SOGGETTI_CREDENZIALI, ForwardParams.LIST());

  71.         } catch (Exception e) {
  72.             return ServletUtils.getStrutsForwardError(ControlStationCore.getLog(), e, pd, request, session, gd, mapping,
  73.                     SoggettiCostanti.OBJECT_NAME_SOGGETTI_CREDENZIALI, ForwardParams.LIST());
  74.         }
  75.     }
  76. }