SPCoopArchiveImportUtils.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.protocol.spcoop.archive;

  21. import org.openspcoop2.core.id.IDServizio;
  22. import org.openspcoop2.core.id.IDSoggetto;
  23. import org.openspcoop2.protocol.sdk.ProtocolException;
  24. import org.openspcoop2.protocol.sdk.registry.IRegistryReader;
  25. import org.openspcoop2.protocol.sdk.registry.RegistryNotFound;
  26. import org.openspcoop2.protocol.spcoop.sica.SICAtoOpenSPCoopContext;
  27. import org.openspcoop2.protocol.spcoop.sica.SICAtoOpenSPCoopUtilities;

  28. import it.gov.spcoop.sica.dao.AccordoServizioComposto;
  29. import it.gov.spcoop.sica.dao.AccordoServizioParteComune;
  30. import it.gov.spcoop.sica.dao.AccordoServizioParteSpecifica;
  31. import it.gov.spcoop.sica.manifest.ElencoPartecipanti;
  32. import it.gov.spcoop.sica.manifest.ElencoServiziComponenti;
  33. import it.gov.spcoop.sica.manifest.ElencoServiziComposti;
  34. import it.gov.spcoop.sica.manifest.driver.TipiDocumentoConversazione;

  35. /**
  36.  * SPCoopArchiveImportUtils
  37.  *
  38.  * @author Poli Andrea (apoli@link.it)
  39.  * @author $Author$
  40.  * @version $Rev$, $Date$
  41.  */
  42. public class SPCoopArchiveImportUtils {


  43.     /* ------------ SetCodiceIPA -------------------------- */
  44.    
  45.     public static void setIDSoggettoFromCodiceIPA(AccordoServizioParteComune aspc,SICAtoOpenSPCoopContext contextSICA,IRegistryReader registryReader) throws Exception{
  46.        
  47.         // Imposto CodiceIPA memorizzato per Referente
  48.         if(aspc.getManifesto()!=null && aspc.getManifesto().getParteComune()!=null &&
  49.                 aspc.getManifesto().getParteComune().getPubblicatore()!=null){
  50.             String codiceIPAReferente = SICAtoOpenSPCoopUtilities.removeURI_IDSoggettoSica(aspc.getManifesto().getParteComune().getPubblicatore().toString());
  51.             IDSoggetto soggettoReferente =  null;
  52.             try{
  53.                 soggettoReferente = registryReader.getIdSoggettoByCodiceIPA(codiceIPAReferente);
  54.                 contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoReferente, codiceIPAReferente);
  55.             }catch(RegistryNotFound dNotF){
  56.                 throw new ProtocolException("Il soggetto referente con Codice IPA ["+codiceIPAReferente+"] non esiste");
  57.             }
  58.         }
  59.     }
  60.    
  61.     public static void setIDSoggettoFromCodiceIPA(AccordoServizioComposto asc,SICAtoOpenSPCoopContext contextSICA,IRegistryReader registryReader) throws Exception{
  62.        
  63.         // Imposto CodiceIPA memorizzato per Referente
  64.         if(asc.getManifesto()!=null &&
  65.                 asc.getManifesto().getPubblicatore()!=null){
  66.             String codiceIPAReferente = SICAtoOpenSPCoopUtilities.removeURI_IDSoggettoSica(asc.getManifesto().getPubblicatore().toString());
  67.             IDSoggetto soggettoReferente =  null;
  68.             try{
  69.                 soggettoReferente = registryReader.getIdSoggettoByCodiceIPA(codiceIPAReferente);
  70.                 contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoReferente, codiceIPAReferente);
  71.             }catch(RegistryNotFound dNotF){
  72.                 throw new ProtocolException("Il soggetto referente con Codice IPA ["+codiceIPAReferente+"] non esiste");
  73.             }
  74.         }
  75.         // Imposto CodiceIPA memorizzato per erogatori servizi componenti
  76.         if(asc.getManifesto()!=null && asc.getManifesto().getServiziComponenti()!=null ){
  77.             ElencoServiziComponenti sComponenti = asc.getManifesto().getServiziComponenti();
  78.             for(int i=0; i<sComponenti.sizeServizioComponenteList(); i++){
  79.                 String servComponente = sComponenti.getServizioComponente(i).toString();
  80.                 String codiceIPASoggettoErogatoreServizioComponente = SICAtoOpenSPCoopUtilities.readDNSoggettoFromUriAccordo(servComponente);
  81.                 IDSoggetto soggettoErogatoreServizioComponente = null;
  82.                 try{
  83.                     soggettoErogatoreServizioComponente = registryReader.getIdSoggettoByCodiceIPA(codiceIPASoggettoErogatoreServizioComponente);
  84.                     contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoErogatoreServizioComponente, codiceIPASoggettoErogatoreServizioComponente);
  85.                 }catch(RegistryNotFound dNotF){
  86.                     throw new ProtocolException("Il soggetto erogatore con Codice IPA ["+codiceIPASoggettoErogatoreServizioComponente+"] non esiste (servizio componente: "+servComponente+")");
  87.                 }
  88.             }
  89.         }
  90.     }
  91.    
  92.     public static void setIDServizioFromURI_APS(AccordoServizioComposto asc,SICAtoOpenSPCoopContext contextSICA,IRegistryReader registryReader) throws Exception{
  93.        
  94.         // Imposto ServizioSPCoop memorizzato per servizi componenti
  95.         if(asc.getManifesto()!=null && asc.getManifesto().getServiziComponenti()!=null ){
  96.             ElencoServiziComponenti sComponenti = asc.getManifesto().getServiziComponenti();
  97.             for(int i=0; i<sComponenti.sizeServizioComponenteList(); i++){
  98.                 String servComponente = sComponenti.getServizioComponente(i).toString();
  99.                 IDServizio idAccordoServizioParteSpecifica = SICAtoOpenSPCoopUtilities.idAccordoServizioParteSpecifica_sicaToOpenspcoop(registryReader, servComponente, contextSICA);
  100.                 contextSICA.addMappingServizioToUriAPS(registryReader, idAccordoServizioParteSpecifica);
  101.             }
  102.         }
  103.     }
  104.    
  105.     public static void setIDSoggettoFromCodiceIPA(it.gov.spcoop.sica.dao.AccordoCooperazione ac,SICAtoOpenSPCoopContext contextSICA,IRegistryReader registryReader) throws Exception{
  106.          // Imposto CodiceIPA memorizzato per Coordinatore
  107.          if(ac.getManifesto()!=null && ac.getManifesto().getCoordinatore()!=null){
  108.              String codiceIPACoordinatore = SICAtoOpenSPCoopUtilities.removeURI_IDSoggettoSica(ac.getManifesto().getCoordinatore().toString());
  109.              IDSoggetto soggettoCoordinatore =  null;
  110.              try{
  111.                  soggettoCoordinatore = registryReader.getIdSoggettoByCodiceIPA(codiceIPACoordinatore);
  112.                  contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoCoordinatore, codiceIPACoordinatore);
  113.              }catch(RegistryNotFound dNotF){
  114.                  throw new ProtocolException("Il soggetto coordinatore con Codice IPA ["+codiceIPACoordinatore+"] non esiste");
  115.              }
  116.          }
  117.          // Imposto CodiceIPA per Partecipanti
  118.          if(ac.getManifesto()!=null && ac.getManifesto().getElencoPartecipanti()!=null ){
  119.              ElencoPartecipanti elencoPartecipanti = ac.getManifesto().getElencoPartecipanti();
  120.              for(int i=0; i<elencoPartecipanti.sizePartecipanteList(); i++){
  121.                  String codiceIPASoggettoPartecipante = SICAtoOpenSPCoopUtilities.removeURI_IDSoggettoSica(elencoPartecipanti.getPartecipante(i).toString());
  122.                  IDSoggetto soggettoPartecipante =  null;
  123.                  try{
  124.                      soggettoPartecipante = registryReader.getIdSoggettoByCodiceIPA(codiceIPASoggettoPartecipante);
  125.                      contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoPartecipante, codiceIPASoggettoPartecipante);
  126.                  }catch(RegistryNotFound dNotF){
  127.                      throw new ProtocolException("Il soggetto partecipante con Codice IPA ["+codiceIPASoggettoPartecipante+"] non esiste");
  128.                  }
  129.              }
  130.          }
  131.          // Imposto CodiceIPA per erogatori servizi composti
  132.          if(ac.getManifesto()!=null && ac.getManifesto().getServiziComposti()!=null ){
  133.              ElencoServiziComposti sComposti = ac.getManifesto().getServiziComposti();
  134.              for(int i=0; i<sComposti.sizeServizioCompostoList(); i++){
  135.                  String uriServizioComposto = sComposti.getServizioComposto(i).toString();
  136.                  String codiceIPASoggettoErogatoreServizioComposto = SICAtoOpenSPCoopUtilities.readDNSoggettoFromUriAccordo(uriServizioComposto);
  137.                  IDSoggetto soggettoErogatoreServizioComposto = null;
  138.                  try{
  139.                      soggettoErogatoreServizioComposto = registryReader.getIdSoggettoByCodiceIPA(codiceIPASoggettoErogatoreServizioComposto);
  140.                      contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoErogatoreServizioComposto, codiceIPASoggettoErogatoreServizioComposto);
  141.                  }catch(RegistryNotFound dNotF){
  142.                      throw new ProtocolException("Il soggetto erogatore con Codice IPA ["+codiceIPASoggettoErogatoreServizioComposto+"] non esiste (servizio composto: "+uriServizioComposto+")");
  143.                  }
  144.              }
  145.          }
  146.     }
  147.    
  148.     public static void setIDSoggettoFromCodiceIPA(AccordoServizioParteSpecifica asps,SICAtoOpenSPCoopContext contextSICA,IRegistryReader registryReader) throws Exception{
  149.         // Imposto CodiceIPA memorizzato per Erogatore
  150.         if(asps.getManifesto()!=null && asps.getManifesto().getParteSpecifica()!=null &&
  151.                 asps.getManifesto().getParteSpecifica().getErogatore()!=null){
  152.              String codiceIPAErogatore = SICAtoOpenSPCoopUtilities.removeURI_IDSoggettoSica(asps.getManifesto().getParteSpecifica().getErogatore().toString());
  153.              IDSoggetto soggettoErogatore =  null;
  154.              try{
  155.                  soggettoErogatore = registryReader.getIdSoggettoByCodiceIPA(codiceIPAErogatore);
  156.                  contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoErogatore, codiceIPAErogatore);
  157.              }catch(RegistryNotFound dNotF){
  158.                  throw new ProtocolException("Il soggetto erogatore con Codice IPA ["+codiceIPAErogatore+"] non esiste");
  159.              }
  160.         }
  161.         // Imposto CodiceIPA memorizzato per referente Accordo di Servizio Parte Comune
  162.         if(asps.getManifesto()!=null && asps.getManifesto().getParteSpecifica()!=null &&
  163.                 asps.getManifesto().getParteSpecifica().getRiferimentoParteComune()!=null){
  164.              String uriRiferimentoParteComune = asps.getManifesto().getParteSpecifica().getRiferimentoParteComune().toString();
  165.              String codiceIPASoggettoReferenteParteComune = SICAtoOpenSPCoopUtilities.readDNSoggettoFromUriAccordo(uriRiferimentoParteComune);
  166.              IDSoggetto soggettoReferenteParteComune = null;
  167.              try{
  168.                  soggettoReferenteParteComune = registryReader.getIdSoggettoByCodiceIPA(codiceIPASoggettoReferenteParteComune);
  169.                  contextSICA.addMappingSoggettoSPCoopToCodiceIPA(soggettoReferenteParteComune, codiceIPASoggettoReferenteParteComune);
  170.              }catch(RegistryNotFound dNotF){
  171.                  throw new ProtocolException("Il soggetto referente con Codice IPA ["+codiceIPASoggettoReferenteParteComune+"] non esiste (parte comune: "+uriRiferimentoParteComune+")");
  172.              }
  173.         }

  174.     }
  175.    
  176.    
  177.    
  178.    
  179.    
  180.     /* ------------ Validazione -------------------------- */
  181.    
  182.     public static void validazioneContenuti(AccordoServizioParteComune aspc) throws Exception{
  183.        
  184.         if(aspc.getInterfacciaConcettuale()==null){
  185.             throw new Exception("WSDL Concettuale non presente");
  186.         }
  187.         if(aspc.getInterfacciaLogicaLatoErogatore()==null){
  188.             throw new Exception("WSDL Logico Erogatore non presente");
  189.         }
  190.        
  191.         byte[] wsdlConcettuale = aspc.getInterfacciaConcettuale().getContenuto();
  192.         if(wsdlConcettuale==null){
  193.             throw new Exception("WSDL Concettuale non presente nell'archivio");
  194.         }
  195.         if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlConcettuale)){
  196.             wsdlConcettuale=null;
  197.         }
  198.         aspc.getInterfacciaConcettuale().setContenuto(wsdlConcettuale);
  199.                    
  200.         byte[] wsdlLogicoErogatore = aspc.getInterfacciaLogicaLatoErogatore().getContenuto();
  201.         if(wsdlLogicoErogatore==null){
  202.             throw new Exception("WSDL Logico Erogatore non presente nell'archivio");
  203.         }
  204.         if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlLogicoErogatore)){
  205.             wsdlLogicoErogatore=null;
  206.         }
  207.         aspc.getInterfacciaLogicaLatoErogatore().setContenuto(wsdlLogicoErogatore);
  208.        
  209.         byte[] wsdlLogicoFruitore = null;
  210.         if(aspc.getInterfacciaLogicaLatoFruitore()!=null){
  211.             wsdlLogicoFruitore = aspc.getInterfacciaLogicaLatoFruitore().getContenuto();
  212.             if(wsdlLogicoFruitore==null){
  213.                 throw new Exception("WSDL Logico Fruitore non presente nell'archivio");
  214.             }
  215.             if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlLogicoFruitore)){
  216.                 wsdlLogicoFruitore=null;
  217.             }
  218.         }
  219.         if(aspc.getInterfacciaLogicaLatoFruitore()!=null)
  220.             aspc.getInterfacciaLogicaLatoFruitore().setContenuto(wsdlLogicoFruitore);
  221.        
  222.         byte[] wsblConcettuale = null;
  223.         if(aspc.getConversazioneConcettuale()!=null &&
  224.                 TipiDocumentoConversazione.WSBL.toString().equals(aspc.getConversazioneConcettuale().getTipo())
  225.                 ){
  226.             wsblConcettuale = aspc.getConversazioneConcettuale().getContenuto();    
  227.             if(wsblConcettuale==null){
  228.                 throw new Exception("WSBL Concettuale non presente nell'archivio");
  229.             }
  230.         }
  231.         if(aspc.getConversazioneConcettuale()!=null)
  232.             aspc.getConversazioneConcettuale().setContenuto(wsblConcettuale);
  233.        
  234.         byte[] wsblLogicoErogatore = null;
  235.         if(aspc.getConversazioneLogicaErogatore()!=null &&
  236.                 TipiDocumentoConversazione.WSBL.toString().equals(aspc.getConversazioneLogicaErogatore().getTipo())
  237.                 ){
  238.             wsblLogicoErogatore = aspc.getConversazioneLogicaErogatore().getContenuto();        
  239.             if(wsblLogicoErogatore==null){
  240.                 throw new Exception("WSBL Logico Erogatore non presente nell'archivio");
  241.             }
  242.         }
  243.         if(aspc.getConversazioneLogicaErogatore()!=null)
  244.             aspc.getConversazioneLogicaErogatore().setContenuto(wsblLogicoErogatore);
  245.        
  246.         byte[] wsblLogicoFruitore = null;
  247.         if(aspc.getConversazioneLogicaFruitore()!=null &&
  248.                 TipiDocumentoConversazione.WSBL.toString().equals(aspc.getConversazioneLogicaFruitore().getTipo())
  249.                 ){
  250.             wsblLogicoFruitore = aspc.getConversazioneLogicaFruitore().getContenuto();  
  251.             if(wsblLogicoFruitore==null){
  252.                 throw new Exception("WSBL Logico Fruitore non presente nell'archivio");
  253.             }
  254.         }
  255.         if(aspc.getConversazioneLogicaFruitore()!=null)
  256.             aspc.getConversazioneLogicaFruitore().setContenuto(wsblLogicoFruitore);

  257.         // il resto della validazione viene effettuata di base dal prodotto
  258.        
  259.     }
  260.    
  261.     public static void validazioneContenuti(AccordoServizioComposto asc) throws Exception{
  262.        
  263.         if(asc.getInterfacciaConcettuale()==null){
  264.             throw new Exception("WSDL Concettuale non presente");
  265.         }
  266.         if(asc.getInterfacciaLogicaLatoErogatore()==null){
  267.             throw new Exception("WSDL Logico Erogatore non presente");
  268.         }
  269.        
  270.         byte[] wsdlConcettuale = asc.getInterfacciaConcettuale().getContenuto();
  271.         if(wsdlConcettuale==null){
  272.             throw new Exception("WSDL Concettuale non presente nell'archivio");
  273.         }
  274.         if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlConcettuale)){
  275.             wsdlConcettuale=null;
  276.         }
  277.         asc.getInterfacciaConcettuale().setContenuto(wsdlConcettuale);
  278.                    
  279.         byte[] wsdlLogicoErogatore = asc.getInterfacciaLogicaLatoErogatore().getContenuto();
  280.         if(wsdlLogicoErogatore==null){
  281.             throw new Exception("WSDL Logico Erogatore non presente nell'archivio");
  282.         }
  283.         if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlLogicoErogatore)){
  284.             wsdlLogicoErogatore=null;
  285.         }
  286.         asc.getInterfacciaLogicaLatoErogatore().setContenuto(wsdlLogicoErogatore);
  287.        
  288.         byte[] wsdlLogicoFruitore = null;
  289.         if(asc.getInterfacciaLogicaLatoFruitore()!=null){
  290.             wsdlLogicoFruitore = asc.getInterfacciaLogicaLatoFruitore().getContenuto();
  291.             if(wsdlLogicoFruitore==null){
  292.                 throw new Exception("WSDL Logico Fruitore non presente nell'archivio");
  293.             }
  294.             if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlLogicoFruitore)){
  295.                 wsdlLogicoFruitore=null;
  296.             }
  297.         }
  298.         if(asc.getInterfacciaLogicaLatoFruitore()!=null)
  299.             asc.getInterfacciaLogicaLatoFruitore().setContenuto(wsdlLogicoFruitore);
  300.        
  301.         byte[] wsblConcettuale = null;
  302.         if(asc.getConversazioneConcettuale()!=null &&
  303.                 TipiDocumentoConversazione.WSBL.toString().equals(asc.getConversazioneConcettuale().getTipo())
  304.                 ){
  305.             wsblConcettuale = asc.getConversazioneConcettuale().getContenuto();
  306.             if(wsblConcettuale==null){
  307.                 throw new Exception("WSBL Concettuale non presente nell'archivio");
  308.             }
  309.         }
  310.         if(asc.getConversazioneConcettuale()!=null)
  311.             asc.getConversazioneConcettuale().setContenuto(wsblConcettuale);
  312.        
  313.         byte[] wsblLogicoErogatore = null;
  314.         if(asc.getConversazioneLogicaErogatore()!=null &&
  315.                 TipiDocumentoConversazione.WSBL.toString().equals(asc.getConversazioneLogicaErogatore().getTipo())
  316.                 ){
  317.             wsblLogicoErogatore = asc.getConversazioneLogicaErogatore().getContenuto();    
  318.             if(wsblLogicoErogatore==null){
  319.                 throw new Exception("WSBL Logico Erogatore non presente nell'archivio");
  320.             }
  321.         }
  322.         if(asc.getConversazioneLogicaErogatore()!=null)
  323.             asc.getConversazioneLogicaErogatore().setContenuto(wsblLogicoErogatore);
  324.        
  325.         byte[] wsblLogicoFruitore = null;
  326.         if(asc.getConversazioneLogicaFruitore()!=null &&
  327.                 TipiDocumentoConversazione.WSBL.toString().equals(asc.getConversazioneLogicaFruitore().getTipo())
  328.                 ){
  329.             wsblLogicoFruitore = asc.getConversazioneLogicaFruitore().getContenuto();  
  330.             if(wsblLogicoFruitore==null){
  331.                 throw new Exception("WSBL Logico Fruitore non presente nell'archivio");
  332.             }
  333.         }
  334.         if(asc.getConversazioneLogicaFruitore()!=null)
  335.             asc.getConversazioneLogicaFruitore().setContenuto(wsblLogicoFruitore);
  336.        
  337.         // il resto della validazione viene effettuata di base dal prodotto
  338.     }
  339.    
  340.     public static void validazioneContenuti(AccordoServizioParteSpecifica aps) throws Exception{
  341.        
  342.         if(aps.getPortiAccessoErogatore()==null && aps.getPortiAccessoFruitore()==null){
  343.             throw new Exception("Nessun WSDL Implementativo presente");
  344.         }
  345.                        
  346.         //implementativo erogatore
  347.         if(aps.getPortiAccessoErogatore()!=null){
  348.             byte[]  wsdlImplementativo = aps.getPortiAccessoErogatore().getContenuto();
  349.             if(wsdlImplementativo==null){
  350.                 throw new Exception("WSDL Implementativo Erogatore non presente nell'archivio");
  351.             }
  352.             if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlImplementativo)){
  353.                 wsdlImplementativo=null;
  354.             }
  355.             aps.getPortiAccessoErogatore().setContenuto(wsdlImplementativo);
  356.         }
  357.        
  358.         //implementativo fruitore
  359.         if(aps.getPortiAccessoFruitore()!=null){
  360.             byte[]  wsdlImplementativo = aps.getPortiAccessoFruitore().getContenuto();
  361.             if(wsdlImplementativo==null){
  362.                 throw new Exception("WSDL Implementativo Fruitore non presente nell'archivio");
  363.             }
  364.             if(SICAtoOpenSPCoopUtilities.isWsdlEmpty(wsdlImplementativo)){
  365.                 wsdlImplementativo=null;
  366.             }
  367.             aps.getPortiAccessoFruitore().setContenuto(wsdlImplementativo);
  368.         }

  369.     }
  370.    
  371.    
  372.    
  373.    
  374.    
  375.    
  376.    
  377.    
  378.    
  379.     /* -------------------- InfoServices -------------------------------- */
  380.    
  381.     // Metodi oramai gestiti direttamente dall'import
  382.    
  383.     @Deprecated
  384.     public static boolean isInfoEGovPresenti(AccordoServizioParteComune aspc){
  385.         boolean infoEgovPresenti = false;
  386.         if(aspc!=null){
  387.             it.gov.spcoop.sica.dao.Documento docSICA = null;
  388.             for(int j=0; j<aspc.sizeAllegati(); j++){
  389.                 docSICA = aspc.getAllegato(j);
  390.                 if(it.gov.spcoop.sica.wscp.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  391.                     infoEgovPresenti = true;
  392.                     break;
  393.                 }
  394.                 else if(it.cnipa.collprofiles.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  395.                     infoEgovPresenti = true;
  396.                     break;
  397.                 }
  398.             }
  399.             if(infoEgovPresenti==false){
  400.                 for(int j=0; j<aspc.sizeSpecificheSemiformali(); j++){
  401.                     docSICA = aspc.getSpecificaSemiformale(j);
  402.                     if(it.gov.spcoop.sica.wscp.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  403.                         infoEgovPresenti = true;
  404.                         break;
  405.                     }
  406.                     else if(it.cnipa.collprofiles.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  407.                         infoEgovPresenti = true;
  408.                         break;
  409.                     }
  410.                 }
  411.             }
  412.         }
  413.         return infoEgovPresenti;
  414.     }
  415.    
  416.     @Deprecated
  417.     public static boolean isInfoEGovPresenti(AccordoServizioComposto asc){
  418.         boolean infoEgovPresenti = false;
  419.         if(asc!=null){
  420.             it.gov.spcoop.sica.dao.Documento docSICA = null;
  421.             for(int j=0; j<asc.sizeAllegati(); j++){
  422.                 docSICA = asc.getAllegato(j);
  423.                 if(it.gov.spcoop.sica.wscp.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  424.                     infoEgovPresenti = true;
  425.                     break;
  426.                 }
  427.                 else if(it.cnipa.collprofiles.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  428.                     infoEgovPresenti = true;
  429.                     break;
  430.                 }
  431.             }
  432.             if(infoEgovPresenti==false){
  433.                 for(int j=0; j<asc.sizeSpecificheSemiformali(); j++){
  434.                     docSICA = asc.getSpecificaSemiformale(j);
  435.                     if(it.gov.spcoop.sica.wscp.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  436.                         infoEgovPresenti = true;
  437.                         break;
  438.                     }
  439.                     else if(it.cnipa.collprofiles.driver.XMLUtils.isProfiloCollaborazioneEGOV(docSICA.getContenuto())){
  440.                         infoEgovPresenti = true;
  441.                         break;
  442.                     }
  443.                 }
  444.             }
  445.         }
  446.         return infoEgovPresenti;
  447.     }
  448.    
  449. }