/// <summary> /// Cancellazione di un folder in DocsPa /// </summary> /// <param name="idProject">Identificativo univoco del folder</param> /// <remarks> /// /// PreCondizioni: /// Il folder è stato rimosso correttamente in DocsPa /// /// PostCondizioni: /// Il corrispondente oggetto in documentum per il folder /// è stato rimosso correttamente /// /// </remarks> /// <returns></returns> public bool DeleteFolder(DocsPaVO.fascicolazione.Folder folder) { bool retValue = false; try { DeleteProfile deleteProfile = new DeleteProfile(); deleteProfile.IsDeepDeleteFolders = true; deleteProfile.IsDeepDeleteChildrenInFolders = true; IObjectService objectService = this.GetServiceInstance <IObjectService>(false); OperationOptions opts = new OperationOptions(); opts.DeleteProfile = deleteProfile; // Reperimento identity per il sottofascicolo ObjectIdentity identity = Dfs4DocsPa.getSottofascicoloIdentityById(folder.systemID); objectService.Delete(new ObjectIdentitySet(identity), opts); retValue = true; logger.Debug(string.Format("Documentum.DeleteFolder: rimosso sottofascicolo con id {0}", folder.systemID)); } catch (Exception ex) { retValue = false; logger.Debug(string.Format("Errore in Documentum.DeleteFolder:\n{0}", ex.ToString())); } return(retValue); }
/* * Deletes all objects in createdObjectIdentities * This is intended for cleanup after completed test * */ public void DeleteCreatedObjects() { if (!isDataCleanedUp) { Console.WriteLine("Data created during test will not be deleted because SampleContentManager.isDataCleanedUp = false"); return; } if (createdObjectIdentities == null) { return; } try { DeleteProfile deleteProfile = new DeleteProfile(); deleteProfile.IsDeepDeleteFolders = true; deleteProfile.IsDeepDeleteChildrenInFolders = true; OperationOptions operationOptions = new OperationOptions(); operationOptions.DeleteProfile = deleteProfile; objectService.Delete(createdObjectIdentities, operationOptions); Console.WriteLine("Cleaned up the following sample data in repository (including all folder descendants):"); foreach (ObjectIdentity id in createdObjectIdentities.Identities) { Console.WriteLine(id.GetValueAsString()); } createdObjectIdentities.Identities.Clear(); } catch (FaultException <SerializableException> ex) { Console.WriteLine(String.Format("Got FaultException[{0}] with message: {1}\n", ex.Detail, ex.Message)); } catch (Exception exx) { Console.WriteLine(exx.StackTrace); } }
public void Delete_cmd_deletes_selected_profile() { var profileStore = new MemProfileStore(); DeleteProfile del = new DeleteProfile(profileStore); var existingProfile = profileStore.Retrieve().First(); del.DeleteProfileByName(existingProfile.Name); profileStore.Retrieve().Should().NotContain(existingProfile); }
public IAggregate Handle(DeleteProfile command) { var user = _userService.GetById(command.UserId); var aggregate = _domainRepository.GetById <ProfileAggregate>(command.Id); aggregate.Delete(user); return(aggregate); }
/// <summary> /// Creazione oggetto "DeleteProfile" necessario per rimuovere il cabinet dell'amministrazione /// </summary> /// <returns></returns> protected DeleteProfile CreateDeleteProfile() { DeleteProfile profile = new DeleteProfile(); profile.IsPopulateWithReferences = true; profile.IsDeepDeleteFolders = true; profile.IsDeepDeleteChildrenInFolders = true; profile.IsDeepDeleteVdmInFolders = true; profile.VersionStrategy = DeleteVersionStrategy.ALL_VERSIONS; profile.versionStrategySpecified = true; return(profile); }
public void ObjServiceDelete(String path) { ObjectPath docPath = new ObjectPath(path); ObjectIdentity objIdentity = new ObjectIdentity(); objIdentity.Value = docPath; objIdentity.RepositoryName = DefaultRepository; ObjectIdentitySet objectIdSet = new ObjectIdentitySet(objIdentity); DeleteProfile deleteProfile = new DeleteProfile(); deleteProfile.IsDeepDeleteFolders = true; deleteProfile.IsDeepDeleteChildrenInFolders = true; OperationOptions operationOptions = new OperationOptions(); operationOptions.DeleteProfile = deleteProfile; objectService.Delete(objectIdSet, operationOptions); }
/// <summary> /// Eliminazione di un nodo di titolario /// </summary> /// <param name="nodoTitolario"></param> /// <returns></returns> public bool DeleteNodoTitolario(OrgNodoTitolario nodoTitolario) { bool retValue = false; try { IObjectService objSrvc = this.GetObjectServiceInstance(); DeleteProfile deleteProfile = new DeleteProfile(); deleteProfile.IsDeepDeleteFolders = true; deleteProfile.IsDeepDeleteChildrenInFolders = true; OperationOptions opts = new OperationOptions(); opts.Profiles = new List <Profile>(); opts.Profiles.Add(deleteProfile); ObjectIdentitySet identitySet = new ObjectIdentitySet(); identitySet.Identities = new List <ObjectIdentity>(); identitySet.Identities.Add(Dfs4DocsPa.getNodoTitolarioIdentity(nodoTitolario.ID)); objSrvc.Delete(identitySet, opts); // Rimozione ACL nodo titolario this.DeleteAclNodoTitolario(nodoTitolario); // Rimozione di tutte le ACL degli eventuali // fascicoli procedimentali contenuti nel titolario this.ClearAclFascicoliNodoTitolario(nodoTitolario); retValue = true; logger.Debug(string.Format("Documentum.DeleteNodoTitolario: rimosso nodo di titolario con id {0}", nodoTitolario.ID)); } catch (Exception ex) { retValue = false; logger.Debug("Errore in Documentum.DeleteNodoTitolario: " + ex.ToString()); } return(retValue); }
public void DeleteTestCabinet(String repository) { if (!isDataCleanedUp) { Console.WriteLine("Test cabinet, folders, and sample images will not be deleted because SampleContentManager.isDataCleanedUp = false"); return; } DeleteProfile deleteProfile = new DeleteProfile(); deleteProfile.IsDeepDeleteFolders = true; deleteProfile.IsDeepDeleteChildrenInFolders = true; OperationOptions operationOptions = new OperationOptions(); operationOptions.DeleteProfile = deleteProfile; ObjectPath objectPath = new ObjectPath(testCabinetPath); ObjectIdentity sampleCabinetIdentity = new ObjectIdentity(objectPath, repository); ObjectIdentitySet objIdSet = new ObjectIdentitySet(); objIdSet.AddIdentity(sampleCabinetIdentity); objectService.Delete(objIdSet, operationOptions); Console.WriteLine("Deleted test cabinet " + testCabinetPath + " on " + repository); }
/// <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); }
private void DeleteProfileButton_Click(object sender, RoutedEventArgs e) => DeleteProfile?.Invoke(this, new EventArgs());
/* * Deletes all objects in createdObjectIdentities * This is intended for cleanup after completed test * */ public void DeleteCreatedObjects() { if (!isDataCleanedUp) { Console.WriteLine("Data created during test will not be deleted because SampleContentManager.isDataCleanedUp = false"); return; } if (createdObjectIdentities == null) { return; } try { DeleteProfile deleteProfile = new DeleteProfile(); deleteProfile.IsDeepDeleteFolders = true; deleteProfile.IsDeepDeleteChildrenInFolders = true; OperationOptions operationOptions = new OperationOptions(); operationOptions.DeleteProfile = deleteProfile; objectService.Delete(createdObjectIdentities, operationOptions); Console.WriteLine("Cleaned up the following sample data in repository (including all folder descendants):"); foreach (ObjectIdentity id in createdObjectIdentities.Identities) { Console.WriteLine(id.GetValueAsString()); } createdObjectIdentities.Identities.Clear(); } catch (FaultException<SerializableException> ex) { Console.WriteLine(String.Format("Got FaultException[{0}] with message: {1}\n", ex.Detail, ex.Message)); } catch (Exception exx) { Console.WriteLine(exx.StackTrace); } }