Example #1
0
        /// <summary>
        /// Reperimento proprietà per documento di tipo stampa registro
        /// </summary>
        /// <param name="schedaDoc"></param>
        /// <param name="infoUtente"></param>
        /// <returns></returns>
        public static CorteContentServices.CategoryType[] getDocumentStampaRegistroProperties(SchedaDocumento schedaDoc, InfoUtente infoUtente)
        {
            List <MetadataType> metaDataList = new List <MetadataType>();

            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoStampaRegistro.AUTORE, infoUtente.userId));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoStampaRegistro.DOC_NUMBER, schedaDoc.docNumber));

            if (schedaDoc.oggetto != null && !string.IsNullOrEmpty(schedaDoc.oggetto.descrizione))
            {
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoStampaRegistro.OGGETTO, schedaDoc.oggetto.descrizione));
            }

            //DATA_STAMPA
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoStampaRegistro.DATA_STAMPA, System.DateTime.Now.ToString("yyyy-MM-ddThh:mm:ss", new CultureInfo("it-IT"))));

            //COD_REGISTRO
            if (schedaDoc.registro != null)
            {
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoStampaRegistro.CODICE_REGISTRO,
                                                          DocsPaServices.DocsPaQueryHelper.getCodiceRegistroFromId(schedaDoc.registro.systemId)));
            }

            List <CategoryType> retValue = new List <CategoryType>();

            CategoryType categoryType = new CategoryType();

            categoryType.name         = DocsPaObjectType.ObjectTypes.CATEGOTY_STAMPA_REGISTRO;
            categoryType.metadataList = metaDataList.ToArray();
            retValue.Add(categoryType);

            return(retValue.ToArray());
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="info"></param>
        /// <param name="infoUtente"></param>
        /// <returns></returns>
        public static long createFolder(CorteContentServices.InfoNameType info, DocsPaVO.utente.InfoUtente infoUtente)
        {
            CorteContentServices.FolderCreateType        folderCreate    = new CorteContentServices.FolderCreateType();
            CorteContentServices.FolderCreateRequestType folderCreateReq = new CorteContentServices.FolderCreateRequestType();

            CorteContentServices.ItemIdResponseType itemResp;
            folderCreate.info          = new DocsPaDocumentale_OCS.CorteContentServices.InfoType();
            folderCreate.info.name     = info.name;
            folderCreate.info.location = info.location;
            folderCreate.info.state    = DocsPaDocumentale_OCS.CorteContentServices.StateType.Undefined;
            folderCreate.info.author   = infoUtente.userId;
            //controllare il formato
            //PS: sarebbe meglio se il formato lo mettesse OCS quando non viene specificato
            folderCreate.info.creationDate = System.DateTime.Now;

            folderCreateReq.folder          = folderCreate;
            folderCreateReq.userCredentials = OCSServices.OCSUtils.getApplicationUserCredentials();

            FolderManagementSOAPHTTPBinding wsFolder = OCSServiceFactory.GetDocumentServiceInstance <FolderManagementSOAPHTTPBinding>();

            itemResp = wsFolder.CreateFolder(folderCreateReq);

            OCSUtils.throwExceptionIfInvalidResult(itemResp.result);

            return(itemResp.itemId);
        }
Example #3
0
        /// <summary>
        /// Reperimento proprietà allegato
        /// </summary>
        /// <param name="allegato"></param>
        /// <param name="infoUtente"></param>
        /// <returns></returns>
        public static CorteContentServices.CategoryType[] getAttachmentProperties(Allegato allegato, InfoUtente infoUtente)
        {
            List <MetadataType> metaDataList = new List <MetadataType>();

            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoAllegato.AUTORE, infoUtente.userId));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoAllegato.DOC_NUMBER, DocsPaServices.DocsPaQueryHelper.getDocNumberDocumentoPrincipale(allegato.docNumber)));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoAllegato.ATTACHID, allegato.docNumber));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoAllegato.DESCRIZIONE, allegato.descrizione));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoAllegato.NUM_PAGINE, allegato.numeroPagine.ToString()));

            if (!string.IsNullOrEmpty(allegato.versionLabel))
            {
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoAllegato.CODICE, allegato.versionLabel.ToString()));
            }

            List <CategoryType> retValue = new List <CategoryType>();

            CategoryType categoryType = new CategoryType();

            categoryType.name         = DocsPaObjectType.ObjectTypes.CATEGOTY_ALLEGATO;
            categoryType.metadataList = metaDataList.ToArray();
            retValue.Add(categoryType);

            return(retValue.ToArray());
        }
Example #4
0
        /// <summary>
        /// Accesso ad OCS usando il metodo GetDocumentByName
        /// </summary>
        /// <param name="path"></param>
        /// <param name="name"></param>
        /// <param name="ocsCredentials">Credenziali per effettuare l'operazione in ocs</param>
        /// <returns></returns>
        private static long getIdOCSByPath(string path, string name, UserCredentialsType ocsCredentials)
        {
            CorteContentServices.DocumentNameSearchRequestType nameReq = new CorteContentServices.DocumentNameSearchRequestType();
            CorteContentServices.ItemIdResponseType            itemIdResp;

            nameReq.userCredentials        = ocsCredentials;
            nameReq.document               = new DocsPaDocumentale_OCS.CorteContentServices.DocumentNameSearchType();
            nameReq.document.info          = new DocsPaDocumentale_OCS.CorteContentServices.InfoType();
            nameReq.document.info.location = path;
            nameReq.document.info.name     = name;

            DocumentManagementSOAPHTTPBinding wsDocument = OCSServiceFactory.GetDocumentServiceInstance <DocumentManagementSOAPHTTPBinding>();

            itemIdResp = wsDocument.GetDocumentByName(nameReq);

            OCSUtils.throwExceptionIfInvalidResult(itemIdResp.result);

            return(itemIdResp.itemId);
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="infoUtente"></param>
        /// <param name="create"></param>
        /// <returns></returns>
        public static long getFolderIdByName(string name, DocsPaVO.utente.InfoUtente infoUtente, bool create)
        {
            long folderId = -1;

            CorteContentServices.FolderNameSearchRequestType folderReq = new CorteContentServices.FolderNameSearchRequestType();
            folderReq.userCredentials = OCSServices.OCSUtils.getApplicationUserCredentials();
            folderReq.folder          = new DocsPaDocumentale_OCS.CorteContentServices.FolderNameSearchType();
            folderReq.folder.info     = new DocsPaDocumentale_OCS.CorteContentServices.InfoNameType();

            int pos = name.LastIndexOf("/");

            if (pos > -1)
            {
                folderReq.folder.info.location = name.Substring(0, pos);
                folderReq.folder.info.name     = name.Substring(pos + 1);
            }

            FolderManagementSOAPHTTPBinding wsFolder = OCSServiceFactory.GetDocumentServiceInstance <FolderManagementSOAPHTTPBinding>();

            CorteContentServices.ItemIdResponseType response = wsFolder.GetFolderByName(folderReq);

            // non posso lanciare l'eccezione perchè se il folder non esiste devo crearlo
            //OCSUtils.throwExceptionIfInvalidResult(response.result);

            if (OCSUtils.isValidServiceResult(response.result))
            {
                folderId = response.itemId;
            }
            else
            {
                // Se il folder non esiste bisogna crearlo (se richiesto)
                if (create && response.result.code == OCSResultTypeCodes.PATH_ITEM_NOT_VALID)
                {
                    folderId = createFolder(folderReq.folder.info, infoUtente);
                }
            }

            return(folderId);
        }
Example #6
0
        /// <summary>
        /// Rimozione delle ACL per un documento
        /// </summary>
        /// <param name="idDocsPa">ID del documento in docspa</param>
        /// <param name="idOcs">ID del documento in ocs</param>
        /// <param name="infoUtente">Credenziali docspa</param>
        /// <param name="ocsCredentials">Credenziali per effettuare l'operazione in ocs</param>
        /// <returns></returns>
        public static bool removeAclDocument(string idDocsPa, long idOcs, InfoUtente infoUtente, UserCredentialsType ocsCredentials)
        {
            CorteContentServices.GrantsType            grants;
            CorteContentServices.ItemGrantsRequestType itemGrantsRequest;
            CorteContentServices.ItemGrantsType        itemGrantsType;
            CorteContentServices.ResultType            resultGrants;

            grants = OCSServices.OCSUtils.getAclSecurity(idDocsPa);

            itemGrantsRequest = new CorteContentServices.ItemGrantsRequestType();
            itemGrantsRequest.userCredentials = ocsCredentials;
            itemGrantsType           = new CorteContentServices.ItemGrantsType();
            itemGrantsType.itemId    = idOcs;
            itemGrantsType.grants    = grants;
            itemGrantsRequest.grants = itemGrantsType;

            DocumentManagementSOAPHTTPBinding wsDocumentInstance = OCSServiceFactory.GetDocumentServiceInstance <DocumentManagementSOAPHTTPBinding>();

            resultGrants = wsDocumentInstance.RemoveDocumentGrants(itemGrantsRequest);

            OCSUtils.throwExceptionIfInvalidResult(resultGrants);

            return(true);
        }
Example #7
0
        /// <summary>
        /// Ricerca dell'id in ocs del documento in docspa
        /// </summary>
        /// <param name="idDocsPa">
        /// Id del documento in docspa da cercare in ocs
        /// </param>
        /// <param name="documentCategoryName">
        /// Categoria di appartenenza del documento
        /// </param>
        /// <param name="categoryFieldName">
        /// Campo della categoria in base a cui cercare il documento
        /// </param>
        /// <param name="searchInCestino">
        /// Se true, indica di cercare il documento nel cestino
        /// </param>
        /// <param name="ocsCredentials"></param>
        /// <returns>
        /// Corrispondente id in ocs del documento
        /// </returns>
        public static long getIdDocument(string idDocsPa, string documentCategoryName, string categoryFieldName, bool searchInCestino, UserCredentialsType ocsCredentials)
        {
            long idOCS = -1;

            //Reperimento idOCS in base ad una ricerca
            CorteContentServices.FilterSearchRequestType searchDocumentRequest = new CorteContentServices.FilterSearchRequestType();

            searchDocumentRequest.userCredentials = ocsCredentials;
            searchDocumentRequest.filter          = new CorteContentServices.FilterSearchType();

            if (searchInCestino)
            {
                // Ricerca del documento nella cartella del cestino
                searchDocumentRequest.filter.folderPath = OCSConfigurations.GetPathCestino();
            }
            else
            {
                // Ricerca del documento a partire dalla root path della libreria ocs corrente
                searchDocumentRequest.filter.folderPath = OCSConfigurations.GetDocRootFolder();
            }

            searchDocumentRequest.filter.includeSubFolders          = true;
            searchDocumentRequest.filter.includeSubFoldersSpecified = true;
            searchDocumentRequest.filter.count           = 0;
            searchDocumentRequest.filter.countSpecified  = true;
            searchDocumentRequest.filter.offset          = 0;
            searchDocumentRequest.filter.offsetSpecified = true;
            searchDocumentRequest.filter.searchExpress   = new DocsPaDocumentale_OCS.CorteContentServices.searchExpress();
            searchDocumentRequest.filter.searchExpress.SearchExprType = new DocsPaDocumentale_OCS.CorteContentServices.SearchExprType();
            string leftOpCr1  = string.Format("[{0}:{1}]", documentCategoryName, categoryFieldName);
            string operatCr1  = "EQUAL";
            string rightOpCr1 = idDocsPa;

            searchDocumentRequest.filter.searchExpress.SearchExprType.leftOperand  = leftOpCr1;
            searchDocumentRequest.filter.searchExpress.SearchExprType.@operator    = operatCr1;
            searchDocumentRequest.filter.searchExpress.SearchExprType.rightOperand = rightOpCr1;

            searchDocumentRequest.filter.searchExpress.SearchExprType.sameLevelOperator = "AND";

            searchDocumentRequest.filter.searchExpress.SearchExprType.SearchExprType1 = new DocsPaDocumentale_OCS.CorteContentServices.SearchExprType();
            string operatCr2  = "HAS_CATEGORY";
            string rightOpCr2 = string.Format("[{0}]", documentCategoryName);

            searchDocumentRequest.filter.searchExpress.SearchExprType.SearchExprType1.@operator    = operatCr2;
            searchDocumentRequest.filter.searchExpress.SearchExprType.SearchExprType1.rightOperand = rightOpCr2;

            CorteContentServices.ItemSearchListResponseType listResult;

            DocumentManagementSOAPHTTPBinding wsDocument = OCSServiceFactory.GetDocumentServiceInstance <DocumentManagementSOAPHTTPBinding>();

            listResult = wsDocument.SearchDocuments(searchDocumentRequest);

            OCSUtils.throwExceptionIfInvalidResult(listResult.result);

            // Reperimento itemId
            if (listResult.items != null && listResult.items.Length == 1)
            {
                idOCS = listResult.items[0].itemId;
            }

            return(idOCS);
        }
Example #8
0
        /// <summary>
        /// Reperimento proprietà ocs contenenti i valori corrispondenti del documento
        /// </summary>
        /// <param name="schedaDoc"></param>
        /// <param name="infoUtente"></param>
        /// <returns></returns>
        public static CorteContentServices.CategoryType[] getDocumentProperties(SchedaDocumento schedaDoc, InfoUtente infoUtente)
        {
            // Lista attributi documento ocs
            List <MetadataType> metaDataList = new List <MetadataType>();

            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.AUTORE, infoUtente.userId));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DOC_NUMBER, schedaDoc.docNumber));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.OGGETTO, schedaDoc.oggetto.descrizione));
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.TIPO_PROTOCOLLO, schedaDoc.tipoProto));

            if (schedaDoc.tipoProto.Equals("A") || schedaDoc.tipoProto.Equals("P") || schedaDoc.tipoProto.Equals("I"))
            {
                if (schedaDoc.protocollo.numero != null)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.NUMERO_PROTOCOLLO, schedaDoc.protocollo.numero));
                }

                if (schedaDoc.protocollo.dataProtocollazione != null)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DATA_PROTOCOLLO, OCSServices.OCSUtils.getOCSDateStringFormat(schedaDoc.protocollo.dataProtocollazione)));
                }

                if (schedaDoc.protocollo.segnatura != null)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.SEGNATURA, schedaDoc.protocollo.segnatura));
                }

                if (schedaDoc.registro != null)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.CODICE_REGISTRO, DocsPaServices.DocsPaQueryHelper.getCodiceRegistroFromId(schedaDoc.registro.systemId)));
                }

                fetchMittentiDestinatari(schedaDoc, metaDataList);

                if (schedaDoc.tipoProto.Equals("A"))
                {
                    if (((DocsPaVO.documento.ProtocolloEntrata)schedaDoc.protocollo).dataProtocolloMittente != null)
                    {
                        metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DATA_PROTOCOLLO_MITTENTE, OCSServices.OCSUtils.getOCSDateStringFormat(((DocsPaVO.documento.ProtocolloEntrata)schedaDoc.protocollo).dataProtocolloMittente)));
                    }

                    //PROTOCOLLO_MITTENTE
                    if (((DocsPaVO.documento.ProtocolloEntrata)schedaDoc.protocollo).descrizioneProtocolloMittente != null)
                    {
                        metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.PROTOCOLLO_MITTENTE, ((DocsPaVO.documento.ProtocolloEntrata)schedaDoc.protocollo).descrizioneProtocolloMittente));
                    }

                    //DATA_ARRIVO
                    if (schedaDoc.documenti != null && schedaDoc.documenti.Count > 0)
                    {
                        if (schedaDoc.documenti[0] != null && ((DocsPaVO.documento.Documento)schedaDoc.documenti[0]).dataArrivo != null && !((DocsPaVO.documento.Documento)schedaDoc.documenti[0]).dataArrivo.Equals(""))
                        {
                            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DATA_ARRIVO, OCSServices.OCSUtils.getOCSDateStringFormat(((DocsPaVO.documento.Documento)schedaDoc.documenti[0]).dataArrivo)));
                        }
                    }
                }
            }

            //gestione documento collegato ORA RIGUARDA ANCHE I DOCUMENTI GRIGI
            if (schedaDoc.rispostaDocumento != null)
            {
                string risposta = schedaDoc.rispostaDocumento.docNumber;
                if (!String.IsNullOrEmpty(schedaDoc.rispostaDocumento.segnatura))
                {
                    risposta = schedaDoc.rispostaDocumento.segnatura;
                }
                if (!String.IsNullOrEmpty(risposta))
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.RISPOSTA_A, risposta));
                }
            }

            //NOTE --  reperimento ultima nota visibile a tutti
            foreach (DocsPaVO.Note.InfoNota item in schedaDoc.noteDocumento)
            {
                if (item.TipoVisibilita.Equals(DocsPaVO.Note.TipiVisibilitaNotaEnum.Tutti))
                {
                    if (!string.IsNullOrEmpty(item.Testo))
                    {
                        metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.NOTE, item.Testo));
                    }
                    break;
                }
            }

            //TIPO_DOCUMENTO
            if (schedaDoc.tipologiaAtto != null)
            {
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.TIPO_DOCUMENTO, schedaDoc.tipologiaAtto.descrizione));
            }

            //PAROLE_CHIAVE
            if (schedaDoc.paroleChiave != null)
            {
                List <string> items = new List <string>();
                foreach (DocsPaVO.documento.ParolaChiave item in schedaDoc.paroleChiave)
                {
                    if (!string.IsNullOrEmpty(item.descrizione))
                    {
                        items.Add(item.descrizione);
                    }
                }

                if (items.Count > 0)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.PAROLE_CHIAVE, items.ToArray()));
                }
            }

            //ANNULLAMENTO
            if (schedaDoc.protocollo != null && schedaDoc.protocollo.protocolloAnnullato != null &&
                schedaDoc.protocollo.protocolloAnnullato.dataAnnullamento != null)
            {
                //DATA
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DATA_ANNULLAMENTO_PROTOCOLLO, OCSServices.OCSUtils.getOCSDateStringFormat(schedaDoc.protocollo.protocolloAnnullato.dataAnnullamento)));

                //MOTIVO
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.NOTE_ANNULLAMENTO_PROTOCOLLO,
                                                          schedaDoc.protocollo.protocolloAnnullato.autorizzazione));
            }

            //PROTOCOLLO_EMERGENZA
            if (schedaDoc.protocollo != null && schedaDoc.datiEmergenza != null &&
                schedaDoc.datiEmergenza.dataProtocollazioneEmergenza != null)
            {
                //DATA
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DATA_PROTOCOLLO_EMERGENZA,
                                                          OCSServices.OCSUtils.getOCSDateStringFormat(schedaDoc.datiEmergenza.dataProtocollazioneEmergenza)));

                //MOTIVO
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.PROTOCOLLO_EMERGENZA, schedaDoc.datiEmergenza.protocolloEmergenza));
            }

            //ABBATANGELI GIANLUIGI
            //COD_EXT_APP
            if (!string.IsNullOrEmpty(schedaDoc.codiceApplicazione))
            {
                metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.COD_EXT_APP, schedaDoc.codiceApplicazione));
            }

            //PREDISPOSTO ALLA PROTOCOLLAZIONE
            string predispostoProtoc = "NO";

            if (schedaDoc.predisponiProtocollazione)
            {
                predispostoProtoc = "SI";
            }
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.PREDISPOSTO_PROTOCOLLAZIONE, predispostoProtoc));

            //LIVELLO RISERVATEZZA  //privato-personale
            string livello_riservatezza = "";

            if (schedaDoc.privato != null && schedaDoc.privato.Equals("1"))
            {
                livello_riservatezza = "PRIVATO";
            }
            if (schedaDoc.personale != null && schedaDoc.personale.Equals("1"))
            {
                livello_riservatezza = "PERSONALE";
            }
            metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.LIVELLO_RISERVATEZZA, livello_riservatezza));

            List <CategoryType> retValue = new List <CategoryType>();

            CategoryType categoryType = new CategoryType();

            categoryType.name         = DocsPaObjectType.ObjectTypes.CATEGOTY_PROTOCOLLO;
            categoryType.metadataList = metaDataList.ToArray();
            retValue.Add(categoryType);

            return(retValue.ToArray());
        }
Example #9
0
        /// <summary>
        /// Caricamento nella lista delle proprietà ocs
        /// della descrizione dei mittenti / destinatari del documento
        /// </summary>
        /// <param name="schedaDocumento"></param>
        /// <param name="metaDataList"></param>
        private static void fetchMittentiDestinatari(DocsPaVO.documento.SchedaDocumento schedaDocumento, List <MetadataType> metaDataList)
        {
            if (schedaDocumento.tipoProto.Equals("A"))
            {
                // Se il documento è in ingresso, viene reperito solo il mittente
                DocsPaVO.documento.ProtocolloEntrata pe = (DocsPaVO.documento.ProtocolloEntrata)schedaDocumento.protocollo;

                if (pe.mittente != null && pe.mittente.descrizione != null)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.MITTENTE, pe.mittente.ToString()));
                }
            }
            else if (schedaDocumento.tipoProto.Equals("P"))
            {
                // Se il documento è in uscita, vengono reperiti sia il mittente che i destinatari (anche per conoscenza)
                DocsPaVO.documento.ProtocolloUscita pu = (DocsPaVO.documento.ProtocolloUscita)schedaDocumento.protocollo;
                if (pu.mittente != null && pu.mittente.descrizione != null)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.MITTENTE, pu.mittente.ToString()));
                }

                if (pu.destinatari != null && pu.destinatari.Count > 0)
                {
                    List <string> destList = new List <string>();
                    foreach (DocsPaVO.utente.Corrispondente item in pu.destinatari)
                    {
                        destList.Add(item.ToString());
                    }
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DESTINATARI, destList.ToArray()));
                }

                if (pu.destinatariConoscenza != null && pu.destinatariConoscenza.Count > 0)
                {
                    List <string> destList = new List <string>();
                    foreach (DocsPaVO.utente.Corrispondente item in pu.destinatariConoscenza)
                    {
                        destList.Add(item.ToString());
                    }
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DESTINATARI_CC, destList.ToArray()));
                }
            }
            else if (schedaDocumento.tipoProto.Equals("I"))
            {
                // Se il documento è interno, vengono reperiti sia il mittente che i destinatari (anche per conoscenza)
                DocsPaVO.documento.ProtocolloInterno pi = (DocsPaVO.documento.ProtocolloInterno)schedaDocumento.protocollo;
                if (pi.mittente != null && pi.mittente.descrizione != null)
                {
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.MITTENTE, pi.mittente.ToString()));
                }

                if (pi.destinatari != null && pi.destinatari.Count > 0)
                {
                    List <string> destList = new List <string>();
                    foreach (DocsPaVO.utente.Corrispondente item in pi.destinatari)
                    {
                        destList.Add(item.ToString());
                    }
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DESTINATARI, destList.ToArray()));
                }

                if (pi.destinatariConoscenza != null && pi.destinatariConoscenza.Count > 0)
                {
                    List <string> destList = new List <string>();
                    foreach (DocsPaVO.utente.Corrispondente item in pi.destinatariConoscenza)
                    {
                        destList.Add(item.ToString());
                    }
                    metaDataList.Add(OCSUtils.getMetadataItem(DocsPaObjectType.TypeDocumentoProtocollo.DESTINATARI_CC, destList.ToArray()));
                }
            }
        }