Пример #1
0
        /// <summary>
        /// Modifica dei metadati di un fascicolo
        /// </summary>
        /// <param name="fascicolo"></param>
        /// <param name="refreshAclIfUpdate">
        /// Se true, indica di aggiornare le entries dell'ACL associata al nodo titolario
        /// </param>
        /// <returns></returns>
        public bool ModifyProject(DocsPaVO.fascicolazione.Fascicolo fascicolo, bool refreshAclIfUpdate)
        {
            bool retValue = false;

            try
            {
                // Solo gli attributi del fascicolo procedimentale può essere modificato in documentum
                if (fascicolo.tipo == "P")
                {
                    // Reperimento identity del fascicolo procedimentale
                    ObjectIdentity identity = Dfs4DocsPa.getFascicoloProcedimentaleIdentityById(fascicolo.systemID);

                    DataObject dataObject = new DataObject(identity);

                    // Impostazione proprietà fascicolo
                    dataObject.Properties.Properties.AddRange(Dfs4DocsPa.getFascicoloProcedimentaleProperties(fascicolo));

                    DataPackage dataPackage = new DataPackage(dataObject);

                    IObjectService objectService = this.GetServiceInstance <IObjectService>(true);
                    dataPackage = objectService.Update(dataPackage, null);

                    retValue = (dataPackage.DataObjects.Count == 1);

                    if (retValue)
                    {
                        if (refreshAclIfUpdate)
                        {
                            // Aggiornamento delle entries dell'acl associata al fascicolo
                            this.RefreshAclFascicolo(fascicolo);
                        }

                        logger.Debug(string.Format("Documentum.ModifyProject: modificato fascicolo con id {0}", fascicolo.systemID));
                    }
                }
                else
                {
                    retValue = true;
                }
            }
            catch (Exception ex)
            {
                retValue = false;

                logger.Debug(string.Format("Errore in Documentum.ModifyProject:\n{0}", ex.ToString()));
            }

            return(retValue);
        }
Пример #2
0
        /// <summary>
        /// Rimozione di un fascicolo in un DCTM
        /// </summary>
        /// <param name="fascicolo"></param>
        /// <returns></returns>
        public bool DeleteProject(Fascicolo fascicolo)
        {
            bool retValue = false;

            try
            {
                // Rimozione oggetto fascicolo in DCTM
                DeleteProfile deleteProfile = new DeleteProfile();
                deleteProfile.IsDeepDeleteFolders           = true;
                deleteProfile.IsDeepDeleteChildrenInFolders = true;
                deleteProfile.IsDeepDeleteVdmInFolders      = true;

                OperationOptions opts = new OperationOptions();
                opts.DeleteProfile = deleteProfile;

                // Reperimento identity per il fascicolo
                ObjectIdentity identity = Dfs4DocsPa.getFascicoloProcedimentaleIdentityById(fascicolo.systemID);

                // Rimozione del fascicolo
                IObjectService objectService = DctmServiceFactory.GetServiceInstance <IObjectService>(UserManager.ImpersonateSuperUser());

                objectService.Delete(new ObjectIdentitySet(identity), opts);

                // Rimozione dell'ACL associata al fascicolo
                this.DeleteAcl(Dfs4DocsPa.getAclDefinition(fascicolo.systemID, ObjectTypes.FASCICOLO, this.InfoUtente));

                retValue = true;

                logger.Debug(string.Format("Documentum.DeleteFolder: rimosso fascicolo con id {0}", fascicolo.systemID));
            }
            catch (Exception ex)
            {
                retValue = false;

                logger.Debug(string.Format("Errore in Documentum.DeleteProject:\n{0}", ex.ToString()));
            }

            return(retValue);
        }