OperazioniCostanti.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.operazioni;

  21. import java.util.List;
  22. import java.util.ArrayList;

  23. import org.openspcoop2.web.lib.mvc.Costanti;
  24. import org.openspcoop2.web.lib.mvc.ForwardParams;

  25. /**
  26.  * OperazioniCostanti
  27.  *
  28.  * @author Pintori Giuliano (pintori@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. public class OperazioniCostanti {
  33.    
  34.     private OperazioniCostanti() {}
  35.    

  36.     /* OBJECT NAME */

  37.     public static final String OBJECT_NAME_OPERAZIONI = "operazioni";
  38.    
  39.     public static final ForwardParams TIPO_OPERAZIONE_OPERAZIONI = ForwardParams.OTHER("");
  40.     public static final ForwardParams TIPO_OPERAZIONE_DETAIL = ForwardParams.OTHER("Detail");

  41.     /* SERVLET NAME */
  42.     public static final String SERVLET_NAME_OPERAZIONI = OBJECT_NAME_OPERAZIONI+".do";
  43.    
  44.     public static final String SERVLET_NAME_OPERAZIONI_DELETE = OBJECT_NAME_OPERAZIONI+Costanti.STRUTS_ACTION_SUFFIX_DELETE;
  45.     public static final String SERVLET_NAME_OPERAZIONI_LIST = OBJECT_NAME_OPERAZIONI+Costanti.STRUTS_ACTION_SUFFIX_LIST;
  46.     private static final List<String> SERVLET_OPERAZIONI = new ArrayList<>();
  47.     public static List<String> getServletOperazioni() {
  48.         return SERVLET_OPERAZIONI;
  49.     }
  50.     static{
  51.         SERVLET_OPERAZIONI.add(SERVLET_NAME_OPERAZIONI);
  52.         SERVLET_OPERAZIONI.add(SERVLET_NAME_OPERAZIONI_DELETE);
  53.         SERVLET_OPERAZIONI.add(SERVLET_NAME_OPERAZIONI_LIST);
  54.     }

  55.     /* ATTRIBUTI SESSIONE */
  56.    
  57.     public static final String SESSION_ATTRIBUTE_FORM_BEAN = "formBean";
  58.     public static final String SESSION_ATTRIBUTE_FILTER_SEARCH = "filterSearch";
  59.    
  60.     /* LABEL GENERALI */
  61.    
  62.     public static final String LABEL_OPERAZIONI = "Coda Configurazioni";
  63.     public static final String LABEL_OPERAZIONI_CONFIGURAZIONI = "Configurazioni";
  64.     public static final String LABEL_OPERAZIONI_RISULTATI_RICERCA = "Risultati ricerca";
  65.     public static final String LABEL_OPERAZIONI_PARAMETRO_ERRORE = "Errore";
  66.     public static final String LABEL_OPERAZIONI_RICHIESTA_IL = "Richiesta il ";
  67.     public static final String LABEL_OPERAZIONI_DETTAGLI = "Dettagli";
  68.     public static final String LABEL_PARAMETRI = "Parametri";
  69.     public static final String LABEL_OPERAZIONI_ESEGUITA_IL = "Eseguita il";
  70.     public static final String LABEL_OPERAZIONI_ELIMINATA_IL = "Eliminata il";
  71.    
  72.     /* PARAMETRI */
  73.    
  74.     public static final String PARAMETRO_OPERAZIONI_OPERAZIONE = "op";
  75.     public static final String PARAMETRO_OPERAZIONI_ID = "idOp";
  76.     public static final String PARAMETRO_OPERAZIONI_UTENTE = "user";
  77.     public static final String PARAMETRO_OPERAZIONI_METHOD = "method";
  78.     public static final String PARAMETRO_OPERAZIONI_PAGE_SIZE = "pageSize";
  79.     public static final String PARAMETRO_OPERAZIONI_ACTION = "action";
  80.     public static final String PARAMETRO_OPERAZIONI_NEW_SEARCH = "newSearch";
  81.     public static final String PARAMETRO_OPERAZIONI_PAR = "par";
  82.     public static final String PARAMETRO_OPERAZIONI_WAIT_TIME = "waitTime";
  83.     public static final String PARAMETRO_OPERAZIONI_TEMPO_ESECUZIONE = "timexecute";
  84.     public static final String PARAMETRO_OPERAZIONI_ERRORE = "errore";
  85.    
  86.    
  87.     /*  LABEL PARAMETRI */
  88.    
  89.     public static final String LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE = "Tipo";
  90.     public static final String LABEL_PARAMETRO_OPERAZIONI_UTENTE = "Utente";
  91.    
  92.     public static final String LABEL_PARAMETRO_OPERAZIONI_UTENTE_ALL = "--";
  93.    
  94.     public static final String LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_IN_CODA = "In Coda";
  95.     public static final String LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_ESEGUITE = "Eseguite";
  96.     public static final String LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_ATTESA = "In Attesa";
  97.     public static final String LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_INVALIDE = "Invalide";
  98.     public static final String LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_FALLITE = "Fallite";
  99.    
  100.     private static final String[] LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_LIST = {
  101.         LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_IN_CODA,
  102.         LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_ESEGUITE,
  103.         LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_ATTESA,
  104.         LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_INVALIDE,
  105.         LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_FALLITE
  106.     };
  107.     public static String[] getLabelParametroOperazioniOperazioneList() {
  108.         return LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_LIST;
  109.     }


  110.     public static final String LABEL_PARAMETRO_OPERAZIONI_WAITING_TIME = "Waiting Time";
  111.     public static final String LABEL_PARAMETRO_OPERAZIONI_NUOVA_PASSWORD = "NuovaPassword";
  112.     public static final String LABEL_PARAMETRO_OPERAZIONI_PASSWORD = "Password";
  113.    
  114.    
  115.     /* LABEL COLONNE TABELLA SCHERMATA LIST */
  116.    
  117.     public static final String LABEL_PARAMETRO_OPERAZIONI_ID = "Id";
  118.     public static final String LABEL_PARAMETRO_OPERAZIONI_HOST = "Coda";
  119.     public static final String LABEL_PARAMETRO_OPERAZIONI_DATA_RICHIESTA = "Data di Richiesta";
  120.     public static final String LABEL_PARAMETRO_OPERAZIONI_DATA_ESECUZIONE = "Data di Esecuzione";
  121.     public static final String LABEL_PARAMETRO_OPERAZIONI_ELIMINATA = "Dettagli";
  122.     public static final String LABEL_PARAMETRO_OPERAZIONI_ELIMINAZIONE_OPERATORE = "Eliminata dall'utente";
  123.    
  124.    
  125.     /*LABEL PULSANTI */

  126.     public static final String LABEL_OPERAZIONI_BUTTON_OK = "Ok";
  127.     public static final String LABEL_OPERAZIONI_BUTTON_ESEGUI_OPERAZIONE_1 = "EseguiOp(1)";
  128.     public static final String LABEL_OPERAZIONI_BUTTON_ANNULLA = "Annulla";
  129.     public static final String LABEL_OPERAZIONI_BUTTON_ANNULLA_1 = "Annulla(1)";
  130.        
  131.     /* VALORI DEFAULT PARAMETRI*/
  132.    
  133.     public static final String DEFAULT_VALUE_PARAMETRO_OPERAZIONI_WAIT_TIME_WAIT = "WAIT";
  134.    
  135.     public static final String PARAMETRO_OPERAZIONI_UTENTE_ALL = "*";
  136.    
  137.     public static final String PARAMETRO_OPERAZIONI_OPERAZIONE_IN_CODA = "coda";
  138.     public static final String PARAMETRO_OPERAZIONI_OPERAZIONE_ESEGUITE = "eseguite";
  139.     public static final String PARAMETRO_OPERAZIONI_OPERAZIONE_ATTESA = "attesa";
  140.     public static final String PARAMETRO_OPERAZIONI_OPERAZIONE_INVALIDE = "invalide";
  141.     public static final String PARAMETRO_OPERAZIONI_OPERAZIONE_FALLITE = "fallite";
  142.    
  143.     private static final String[] PARAMETRO_OPERAZIONI_OPERAZIONE_LIST = {
  144.         PARAMETRO_OPERAZIONI_OPERAZIONE_IN_CODA,
  145.         PARAMETRO_OPERAZIONI_OPERAZIONE_ESEGUITE,
  146.         PARAMETRO_OPERAZIONI_OPERAZIONE_ATTESA,
  147.         PARAMETRO_OPERAZIONI_OPERAZIONE_INVALIDE,
  148.         PARAMETRO_OPERAZIONI_OPERAZIONE_FALLITE
  149.     };
  150.     public static String[] getParametroOperazioniOperazioneList() {
  151.         return PARAMETRO_OPERAZIONI_OPERAZIONE_LIST;
  152.     }


  153.     public static final String DEFAULT_VALUE_FORM_BEAN_METHOD_DETAILS = "details";
  154.     public static final String DEFAULT_VALUE_FORM_BEAN_METHOD_FORM = "form";
  155.    
  156.     public static final String DEFAULT_VALUE_FALSE = "false";

  157.    
  158.     public static final String ERRORE_TIPO_OPERAZIONE_SCONOSCIUTO = "Tipo selezionato sconosciuto. Selezionare un tipo tra: "
  159.             + LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_IN_CODA + ", "
  160.             + LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_ESEGUITE + ", "
  161.             + LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_ATTESA + ", "
  162.             + LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_INVALIDE + "o "
  163.             + LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_FALLITE + "." ;
  164.    
  165.    
  166.     public static String getTipoOperazioneLabelFromValue(String op){
  167.         for (int i = 0; i < PARAMETRO_OPERAZIONI_OPERAZIONE_LIST.length; i++) {
  168.             if(PARAMETRO_OPERAZIONI_OPERAZIONE_LIST[i].equals(op))
  169.                 return LABEL_PARAMETRO_OPERAZIONI_OPERAZIONE_LIST[i];
  170.         }
  171.        
  172.         return "";
  173.     }
  174. }