public string GetIri() { if (_csvwMetadata != null) { return(_csvwMetadata["url"].ToString()); } return(_uriService.GetDatasetIdentifier(_datasetInfo.OwnerId, _datasetInfo.RepositoryId, _datasetInfo.DatasetId)); }
public async Task <IActionResult> DeleteDataset(string ownerId, string repoId, string datasetId, bool confirmed = false) { DashboardViewModel.Area = "datasets"; DashboardViewModel.SelectedDatasetId = datasetId; DashboardViewModel.Heading = $"Delete Dataset: {datasetId}"; if (!confirmed) { return(View("Dashboard/DeleteDataset", this.DashboardViewModel)); } // Validate user name and authentication status var userId = User?.Identity?.Name; if (string.IsNullOrEmpty(userId)) { Log.Debug("DeleteDataset: No value found for user principal name"); return(Unauthorized()); } if (User?.Identity?.IsAuthenticated != true) { Log.Debug("DeleteDataset: User identity is not authenticated"); return(Unauthorized()); } var jobInfo = await _jobStore.SubmitDeleteJobAsync(new DeleteJobRequestInfo { UserId = userId, OwnerId = ownerId, RepositoryId = repoId, DatasetId = datasetId, DatasetIri = _uriService.GetDatasetIdentifier(ownerId, repoId, datasetId) }); if (jobInfo != null) { return(RedirectToRoute("RepoJobs", new { ownerId, repoId, jobInfo.JobId })); } ViewBag.StatusMessage = "Failed to delete dataset {datasetId}"; return(View("Dashboard/DeleteDataset", this.DashboardViewModel)); }