ScopeCostanti.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.scope;

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

  23. import org.openspcoop2.core.registry.constants.ScopeContesto;
  24. import org.openspcoop2.protocol.sdk.constants.ArchiveType;
  25. import org.openspcoop2.web.ctrlstat.costanti.CostantiControlStation;
  26. import org.openspcoop2.web.lib.mvc.Costanti;

  27. /**
  28.  * ScopeCostanti
  29.  *
  30.  * @author Poli Andrea (apoli@link.it)
  31.  * @author Giuliano Pintori (pintori@link.it)
  32.  * @author $Author$
  33.  * @version $Rev$, $Date$
  34.  */
  35. public class ScopeCostanti {
  36.    
  37.     private ScopeCostanti() {}

  38.     public static final String OBJECT_NAME_SCOPE = "scope";

  39.     public static final String SERVLET_NAME_SCOPE_ADD = OBJECT_NAME_SCOPE+Costanti.STRUTS_ACTION_SUFFIX_ADD;
  40.     public static final String SERVLET_NAME_SCOPE_CHANGE = OBJECT_NAME_SCOPE+Costanti.STRUTS_ACTION_SUFFIX_CHANGE;
  41.     public static final String SERVLET_NAME_SCOPE_DELETE = OBJECT_NAME_SCOPE+Costanti.STRUTS_ACTION_SUFFIX_DELETE;
  42.     public static final String SERVLET_NAME_SCOPE_LIST = OBJECT_NAME_SCOPE+Costanti.STRUTS_ACTION_SUFFIX_LIST;
  43.     private static final List<String> SERVLET_SCOPE = new ArrayList<>();
  44.     public static List<String> getServletScope() {
  45.         return SERVLET_SCOPE;
  46.     }
  47.     static{
  48.         SERVLET_SCOPE.add(SERVLET_NAME_SCOPE_ADD);
  49.         SERVLET_SCOPE.add(SERVLET_NAME_SCOPE_CHANGE);
  50.         SERVLET_SCOPE.add(SERVLET_NAME_SCOPE_DELETE);
  51.         SERVLET_SCOPE.add(SERVLET_NAME_SCOPE_LIST);
  52.     }
  53.    
  54.    
  55.     public static final String LABEL_SCOPE = "Scope";
  56.     public static final String LABEL_SCOPES = "Scope";
  57.    
  58.     /* NOME VISTA CUSTOM */
  59.     public static final String SCOPE_NOME_VISTA_CUSTOM_LISTA = "scope";
  60.    
  61.    
  62.     /* PARAMETRI */
  63.    
  64.     public static final String PARAMETRO_SCOPE_ID = "scopeId";
  65.     public static final String PARAMETRO_SCOPE_NOME = "scopeNome";
  66.     public static final String PARAMETRO_SCOPE_DESCRIZIONE = "scopeDescrizione";
  67.     public static final String PARAMETRO_SCOPE_TIPOLOGIA = "scopeTipologia";
  68.     public static final String PARAMETRO_SCOPE_NOME_ESTERNO = "scopeNomeEsterno";
  69.     public static final String PARAMETRO_SCOPE_CONTESTO = "scopeContesto";
  70.    
  71.    
  72.     /* LABEL PARAMETRI */
  73.    
  74.     public static final String LABEL_PARAMETRO_SCOPE_NOME = "Nome";
  75.     public static final String LABEL_PARAMETRO_SCOPE_DESCRIZIONE = "Descrizione";
  76.     public static final String LABEL_PARAMETRO_SCOPE_TIPOLOGIA = CostantiControlStation.LABEL_PARAMETRO_SCOPE_TIPOLOGIA;
  77.     public static final String LABEL_PARAMETRO_SCOPE_NOME_ESTERNO = "Identificativo Esterno";
  78.     public static final String LABEL_PARAMETRO_SCOPE_CONTESTO = CostantiControlStation.LABEL_PARAMETRO_SCOPE_CONTESTO;
  79.    
  80.     public static final String LABEL_SCOPE_ESPORTA_SELEZIONATI = "Esporta";
  81.     public static final String LABEL_SCOPE_ESPORTA_SELEZIONATI_ONCLICK = "Esporta('"+ArchiveType.SCOPE.name()+"')";
  82.    
  83.     private static final String VALUE_PARAMETRO_SCOPE_TIPOLOGIA_QUALSIASI = "qualsiasi" ;
  84.     public static final String DEFAULT_VALUE_PARAMETRO_SCOPE_TIPOLOGIA = VALUE_PARAMETRO_SCOPE_TIPOLOGIA_QUALSIASI ;
  85.     public static final String DEFAULT_VALUE_PARAMETRO_SCOPE_CONTESTO_UTILIZZO = ScopeContesto.QUALSIASI.getValue();
  86.    
  87.    
  88.     private static final List<String> SCOPE_TIPOLOGIA = new ArrayList<>();
  89.     public static List<String> getScopeTipologia() {
  90.         return SCOPE_TIPOLOGIA;
  91.     }
  92.     static {
  93.         SCOPE_TIPOLOGIA.add(VALUE_PARAMETRO_SCOPE_TIPOLOGIA_QUALSIASI);
  94.         SCOPE_TIPOLOGIA.add("interno");
  95.         SCOPE_TIPOLOGIA.add("esterno");
  96.     }
  97.    
  98.     public static final String SCOPE_TIPOLOGIA_LABEL_INTERNO = CostantiControlStation.SCOPE_TIPOLOGIA_LABEL_INTERNO;
  99.     public static final String SCOPE_TIPOLOGIA_LABEL_ESTERNO = CostantiControlStation.SCOPE_TIPOLOGIA_LABEL_ESTERNO;
  100.     public static final String SCOPE_TIPOLOGIA_LABEL_QUALSIASI = CostantiControlStation.LABEL_PARAMETRO_SCOPE_TIPOLOGIA_QUALSIASI;
  101.     private static final List<String> SCOPE_TIPOLOGIA_LABEL = new ArrayList<>();
  102.     public static List<String> getScopeTipologiaLabel() {
  103.         return SCOPE_TIPOLOGIA_LABEL;
  104.     }
  105.     static {
  106.         SCOPE_TIPOLOGIA_LABEL.add(SCOPE_TIPOLOGIA_LABEL_QUALSIASI);
  107.         SCOPE_TIPOLOGIA_LABEL.add(SCOPE_TIPOLOGIA_LABEL_INTERNO);
  108.         SCOPE_TIPOLOGIA_LABEL.add(SCOPE_TIPOLOGIA_LABEL_ESTERNO);
  109.     }
  110.    
  111.     private static final List<String> SCOPE_CONTESTO_UTILIZZO = new ArrayList<>();
  112.     public static List<String> getScopeContestoUtilizzo() {
  113.         return SCOPE_CONTESTO_UTILIZZO;
  114.     }
  115.     static {
  116.         SCOPE_CONTESTO_UTILIZZO.add(ScopeContesto.QUALSIASI.getValue());
  117.         SCOPE_CONTESTO_UTILIZZO.add(ScopeContesto.PORTA_APPLICATIVA.getValue());
  118.         SCOPE_CONTESTO_UTILIZZO.add(ScopeContesto.PORTA_DELEGATA.getValue());
  119.     }
  120.     public static final String SCOPE_CONTESTO_UTILIZZO_LABEL_EROGAZIONE = CostantiControlStation.SCOPE_CONTESTO_UTILIZZO_LABEL_EROGAZIONE;
  121.     public static final String SCOPE_CONTESTO_UTILIZZO_LABEL_FRUIZIONE = CostantiControlStation.SCOPE_CONTESTO_UTILIZZO_LABEL_FRUIZIONE;
  122.     public static final String SCOPE_CONTESTO_UTILIZZO_LABEL_QUALSIASI = CostantiControlStation.LABEL_PARAMETRO_SCOPE_CONTESTO_QUALSIASI;
  123.     private static final List<String> SCOPE_CONTESTO_UTILIZZO_LABEL = new ArrayList<>();
  124.     public static List<String> getScopeContestoUtilizzoLabel() {
  125.         return SCOPE_CONTESTO_UTILIZZO_LABEL;
  126.     }
  127.     static {
  128.         SCOPE_CONTESTO_UTILIZZO_LABEL.add(SCOPE_CONTESTO_UTILIZZO_LABEL_QUALSIASI);
  129.         SCOPE_CONTESTO_UTILIZZO_LABEL.add(SCOPE_CONTESTO_UTILIZZO_LABEL_EROGAZIONE);
  130.         SCOPE_CONTESTO_UTILIZZO_LABEL.add(SCOPE_CONTESTO_UTILIZZO_LABEL_FRUIZIONE);
  131.     }
  132.    
  133.     public static final String LABEL_IN_USO_BODY_HEADER_NESSUN_RISULTATO = "Lo scope non risulta utilizzato in alcuna configurazione";
  134.    
  135.     public static final String MESSAGE_METADATI_SCOPE_IDENTIFICATIVO_ESTERNO = ScopeCostanti.LABEL_PARAMETRO_SCOPE_NOME_ESTERNO + ": {0}, ";
  136.     public static final String MESSAGE_METADATI_SCOPE_SOLO_CONTESTO = ScopeCostanti.LABEL_PARAMETRO_SCOPE_CONTESTO +": {0}";
  137.     public static final String MESSAGE_METADATI_SCOPE_CON_TIPO = ScopeCostanti.LABEL_PARAMETRO_SCOPE_CONTESTO + ": {0}, "+ScopeCostanti.LABEL_PARAMETRO_SCOPE_TIPOLOGIA+": {1}";
  138. }