public void DeletePubTargets(bool deleteAll = false) { var pubTargets = GetPublicationTargets(); if (deleteAll) { foreach (var pt in pubTargets) { _core.Delete(pt.Id); } } else { foreach (var target in _targets) { var pubTarget = pubTargets.SingleOrDefault(pt => pt.Title == target.Name); // Do not add when publish target is existing if (pubTarget != null) { //Store _core.Delete(pubTarget.Id); } } } }
/// <summary> /// Processes the core service record. /// </summary> /// <remarks>Used for proper error handling of core service fault exception.</remarks> protected override void ProcessCoreServiceRecord() { BatchesFilterData filter = new BatchesFilterData() { BaseColumns = CoreService.Client.ListBaseColumns.Default }; IEnumerable <BatchData> batchDatas = CoreServiceClient.GetSystemWideList(filter).Cast <BatchData>().ToList(); foreach (var batchData in batchDatas) { if (All || batchData.TotalNumberOfOperations == batchData.NumberOfDoneOperations) { CoreServiceClient.Delete(batchData.Id); WriteObject(batchData); } } }
/// <summary> /// Processes the core service record. /// </summary> /// <remarks>Used for proper error handling of core service fault exception.</remarks> protected override void ProcessCoreServiceRecord() { PublishTransactionsFilterData filter = new PublishTransactionsFilterData() { EndDate = Before }; IEnumerable <PublishTransactionData> list = CoreServiceClient.GetSystemWideList(filter).Cast <PublishTransactionData>(); foreach (var publishTransactionData in list) { if ((!Successful && !Failed) || (Successful && publishTransactionData.State == PublishTransactionState.Success) || (Failed && publishTransactionData.State == PublishTransactionState.Failed)) { CoreServiceClient.Delete(publishTransactionData.Id); WriteObject(publishTransactionData); } } }
/// <summary> /// Deletes the object for the specified <see cref="T:TcmCoreService.Misc.TcmUri" /> from Tridion /// </summary> /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param> internal void Delete(TcmUri uri) { mClient.Delete(uri); }