public DeleteDataset ( System.Int64 datasetId, string username, bool rollbackCheckout ) : bool | ||
datasetId | System.Int64 | The identifier of the dataset to be checked-in. |
username | string | The username that performs the check-in, which should be the same as the check-out username. |
rollbackCheckout | bool | Determines whether latest uncommitted changes should be rolled back or checked in before marking the dataset as deleted. |
리턴 | bool |
/// <summary> /// Deletes a dataset, which means the dataset is marked as deleted, but is not physically removed from the database. /// </summary> /// <param name="id">the identifier of the dataset to be purged.</param> /// <remarks>When a dataset is deleted, it is consodered as non-exisiting, but for the sake or provenance, citation, history, etc, it is not removed froom the database. /// The function to recover a deleted dataset, will not be provided.</remarks> /// <returns></returns> public ActionResult Delete(long id) { ViewBag.Title = PresentationModel.GetViewTitleForTenant("Delete", this.Session.GetTenant()); try { DatasetManager dm = new DatasetManager(); if (dm.DeleteDataset(id, this.ControllerContext.HttpContext.User.Identity.Name, true)) { // during the delete permissions are not removed, to allow purging the dataset later on. // it is a safe operation, because deleted datasets are not returned by the DLM anyway. // Javad and Sven decided on 22.11.2016. //try //{ // PermissionManager pm = new PermissionManager(); // pm.DeleteDataPermissionsByEntity(1, id); //} //catch //{ // ViewData.ModelState.AddModelError("", string.Format("Dataset {0} was deleted, but its permissions were not altered. You need to remove them manually from the data permission management.", id)); //} try { ISearchProvider provider = IoCFactory.Container.ResolveForSession<ISearchProvider>() as ISearchProvider; provider?.UpdateSingleDatasetIndex(id, IndexingAction.DELETE); } catch { ViewData.ModelState.AddModelError("", string.Format("Dataset {0} was deleted, but it is still indexed for searching. You need to reindex the search via the managemnet console.", id)); } } else { ViewData.ModelState.AddModelError("", string.Format("Dataset {0} could not be deleted. Details: Internal system error!", id)); } } catch (Exception ex) { ViewData.ModelState.AddModelError("", string.Format("Dataset {0} could not be deleted. Details: {1}", id, ex.Message)); } return View(); //return RedirectToAction("List"); }
private void deleteDataset(long dsId) { DatasetManager dm = new DatasetManager(); dm.DeleteDataset(dsId, "Javad", false); }