ConfigurazioneExtended.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.ArrayList;
  22. import java.util.List;

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

  25. import org.openspcoop2.web.ctrlstat.core.ControlStationCore;
  26. import org.openspcoop2.web.ctrlstat.plugins.IExtendedFormServlet;
  27. import org.openspcoop2.web.ctrlstat.plugins.servlet.AbstractServletNewWindowChangeExtended;
  28. import org.openspcoop2.web.ctrlstat.servlet.ConsoleHelper;
  29. import org.openspcoop2.web.lib.mvc.ForwardParams;
  30. import org.openspcoop2.web.lib.mvc.PageData;
  31. import org.openspcoop2.web.lib.mvc.Parameter;

  32. /**
  33.  * routing
  34.  *
  35.  * @author Andrea Poli (apoli@link.it)
  36.  * @author $Author$
  37.  * @version $Rev$, $Date$
  38.  *
  39.  */
  40. public final class ConfigurazioneExtended extends AbstractServletNewWindowChangeExtended {

  41.     @Override
  42.     protected ConsoleHelper getConsoleHelper(HttpServletRequest request,
  43.             PageData pd, HttpSession session) throws Exception {
  44.         return new ConfigurazioneHelper(request, pd, session);
  45.     }

  46.     @Override
  47.     protected ControlStationCore getConsoleCore() throws Exception {
  48.         return new ConfigurazioneCore();
  49.     }

  50.     @Override
  51.     protected IExtendedFormServlet getExtendedServlet(ControlStationCore core, String uniqueId) throws Exception{
  52.         List<IExtendedFormServlet> list = core.getExtendedServletConfigurazione();
  53.         for (IExtendedFormServlet iExtendedFormServlet : list) {
  54.             if(uniqueId.equals(iExtendedFormServlet.getUniqueID())){
  55.                 return iExtendedFormServlet;
  56.             }
  57.         }
  58.         return null;
  59.     }
  60.    
  61.     @Override
  62.     protected List<Parameter> getTitle(Object object,HttpServletRequest request, HttpSession session) throws Exception {
  63.         List<Parameter> lstParam = new ArrayList<>();
  64.         lstParam.add(new Parameter(ConfigurazioneCostanti.LABEL_CONFIGURAZIONE_GENERALE, ConfigurazioneCostanti.SERVLET_NAME_CONFIGURAZIONE_GENERALE));
  65.         return lstParam;
  66.     }

  67.     @Override
  68.     protected Object getObject(ControlStationCore core,HttpServletRequest request) throws Exception {
  69.         ConfigurazioneCore c = (ConfigurazioneCore) core;
  70.         return c.getConfigurazioneGenerale();
  71.     }

  72.     @Override
  73.     protected String getObjectName() throws Exception {
  74.         return ConfigurazioneCostanti.OBJECT_NAME_CONFIGURAZIONE_GENERALE_EXTENDED;
  75.     }

  76.     @Override
  77.     protected ForwardParams getForwardParams() throws Exception {
  78.         return ConfigurazioneCostanti.TIPO_OPERAZIONE_CONFIGURAZIONE_GENERALE_EXTENDED;
  79.     }


  80. }