From 12459de7359c1f766cf3814bd65c91f468f66c54 Mon Sep 17 00:00:00 2001 From: david schoene Date: Thu, 26 Mar 2026 08:15:55 +0100 Subject: [PATCH 1/2] #2423 --- .../src/routes/datastructure/tableDatasets.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/routes/datastructure/tableDatasets.svelte b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/routes/datastructure/tableDatasets.svelte index 20b26efa01..b769c6db40 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/routes/datastructure/tableDatasets.svelte +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/routes/datastructure/tableDatasets.svelte @@ -10,7 +10,7 @@ From e73f5ee6bd198cfc4348070ed4d0f2e8994d1ee1 Mon Sep 17 00:00:00 2001 From: david schoene Date: Thu, 26 Mar 2026 15:50:14 +0100 Subject: [PATCH 2/2] #2424 fix name issue by download package when using baxeis2 in tag mode --- Components/IO/BExIS.Io/IoHelper.cs | 21 ++++++++++--------- .../Controllers/DataController.cs | 6 +++++- .../Controllers/ExportController.cs | 21 ++++++++++++------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Components/IO/BExIS.Io/IoHelper.cs b/Components/IO/BExIS.Io/IoHelper.cs index 942599e19b..a1c29115f2 100644 --- a/Components/IO/BExIS.Io/IoHelper.cs +++ b/Components/IO/BExIS.Io/IoHelper.cs @@ -35,7 +35,7 @@ public static string GetDynamicStoreFilePath(long datasetId, long datasetVersion return Path.Combine(storePath, fileName + extention); } - public static string GetFileName(FileType type, long datasetId, int versionNr, long datastructureId, string title = "") + public static string GetFileName(FileType type, long datasetId, int versionNr, long datastructureId, string title = "", double tagNr = 0, bool useTags = false, bool useMinor = false) { string appName = GeneralSettings.ApplicationName; if (string.IsNullOrEmpty(appName)) appName = "BEXIS2"; @@ -45,41 +45,42 @@ public static string GetFileName(FileType type, long datasetId, int versionNr, l string downloadTitle = FileNameUtility.SanitizeFileName(title,'-'); - + string versionOrTagLabel = useTags? "t"+tagNr : "v" + versionNr; // tag vs version? + // if tag active but not tag is set, t0 switch (type) { case FileType.Metadata: // filename should contain: application name, dataset ID, and version ID - downloadName = string.Format("{0}_{1}_v{2}_metadata", appName, datasetId, versionNr); + downloadName = string.Format("{0}_{1}_{2}_metadata", appName, datasetId, versionOrTagLabel); break; case FileType.MetadataExport: // filename should contain: application name, dataset ID, and version ID - downloadName = string.Format("{0}_{1}_v{2}_metadata_{3}", appName, datasetId, versionNr, title); + downloadName = string.Format("{0}_{1}_{2}_metadata_{3}", appName, datasetId, versionOrTagLabel, title); break; case FileType.DataStructure: downloadName = string.Format("{0}_{1}_data_structure_{2}", appName, datasetId, datastructureId); break; case FileType.PrimaryData: - downloadName = string.Format("{0}_{1}_v{2}_data", appName, datasetId, versionNr); + downloadName = string.Format("{0}_{1}_{2}_data", appName, datasetId, versionOrTagLabel); break; case FileType.PrimaryDataFiles: - downloadName = string.Format("{0}_{1}_v{2}_data_{3}", appName, datasetId, versionNr, title); + downloadName = string.Format("{0}_{1}_v{2}_data_{3}", appName, datasetId, versionOrTagLabel, title); break; case FileType.Attachments: - downloadName = string.Format("{0}_{1}_v{2}_attachment_{3}", appName, datasetId, versionNr, title); + downloadName = string.Format("{0}_{1}_{2}_attachment_{3}", appName, datasetId, versionOrTagLabel, title); break; case FileType.Bundle: - downloadName = string.Format("{0}_{1}_v{2}_{3}_{4}", appName, datasetId, versionNr, downloadTitle, downloadDate); + downloadName = string.Format("{0}_{1}_{2}_{3}_{4}", appName, datasetId, versionOrTagLabel, downloadTitle, downloadDate); break; case FileType.Manifest: - downloadName = string.Format("{0}_{1}_v{2}_general_metadata", appName, datasetId, versionNr); + downloadName = string.Format("{0}_{1}_{2}_general_metadata", appName, datasetId, versionOrTagLabel); break; default: - downloadName = string.Format("{0}_{1}_v{2}_{3}", appName, datasetId, versionNr, title); + downloadName = string.Format("{0}_{1}_{2}_{3}", appName, datasetId, versionOrTagLabel, title); break; } diff --git a/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/DataController.cs b/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/DataController.cs index c8e8fce67b..8ec53e88e3 100644 --- a/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/DataController.cs +++ b/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/DataController.cs @@ -628,7 +628,11 @@ public ActionResult DownloadZip(long id, string format, long version = -1,bool w { if (this.IsAccessible("DIM", "Export", "GenerateZip")) { - var actionresult = this.Run("DIM", "Export", "GenerateZip", new RouteValueDictionary() { { "id", id }, { "versionid", version }, { "format", format }, { "withFilter", withFilter }, { "withUnits", withUnits } }); + var moduleSettings = ModuleManager.GetModuleSettings("Ddm"); + bool useTags = (Boolean)moduleSettings.GetValueByKey("use_tags"); + bool useMinorTag = (Boolean)moduleSettings.GetValueByKey("use_minor"); + + var actionresult = this.Run("DIM", "Export", "GenerateZip", new RouteValueDictionary() { { "id", id }, { "versionid", version }, { "format", format }, { "withFilter", withFilter }, { "withUnits", withUnits },{"useTags", useTags}, { "useMinor", useMinorTag} }); return actionresult; } diff --git a/Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Controllers/ExportController.cs b/Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Controllers/ExportController.cs index 5b88de07f2..4ca9409508 100644 --- a/Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Controllers/ExportController.cs +++ b/Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Controllers/ExportController.cs @@ -192,7 +192,7 @@ public ActionResult SimpleDataStructure(long id) } } - public ActionResult GenerateZip(long id, long versionid, string format,bool withFilter = false, bool withUnits = false) + public ActionResult GenerateZip(long id, long versionid, string format, bool withFilter = false, bool withUnits = false, bool useTags = false, bool useMinor = false) { XmlDatasetHelper xmlDatasetHelper = new XmlDatasetHelper(); DatasetManager dm = new DatasetManager(); @@ -213,7 +213,12 @@ public ActionResult GenerateZip(long id, long versionid, string format,bool with long dataStructureId = 0; int datasetVersionNumber = dm.GetDatasetVersionNr(datasetVersionId); DatasetVersion datasetVersion = datasetManager.GetDatasetVersion(datasetVersionId); - string title = ""; + + double tagNr = datasetVersion.Tag!=null?datasetVersion.Tag.Nr:0; + + + string title = ""; + #region Metadata @@ -298,7 +303,7 @@ public ActionResult GenerateZip(long id, long versionid, string format,bool with #region zip file - string zipName = IOHelper.GetFileName(FileType.Bundle, id, datasetVersionNumber, dataStructureId, title); //publishingManager.GetZipFileName(id, datasetVersionNumber); + string zipName = IOHelper.GetFileName(FileType.Bundle, id, datasetVersionNumber, dataStructureId, title,tagNr,useTags,useMinor); //publishingManager.GetZipFileName(id, datasetVersionNumber); // add suffix if filter is in use if (isFilterInUse & withFilter) zipName += "_filtered"; @@ -326,15 +331,15 @@ public ActionResult GenerateZip(long id, long versionid, string format,bool with { if (cd.Name.Equals("metadata")) { - name = IOHelper.GetFileName(FileType.Metadata, id, datasetVersionNumber, dataStructureId) + ext; + name = IOHelper.GetFileName(FileType.Metadata, id, datasetVersionNumber, dataStructureId,"", tagNr, useTags, useMinor) + ext; } else if (cd.Name.Equals("datastructure")) { - name = IOHelper.GetFileName(FileType.DataStructure, id, datasetVersionNumber, dataStructureId) + ext; + name = IOHelper.GetFileName(FileType.DataStructure, id, datasetVersionNumber, dataStructureId,"", tagNr, useTags, useMinor) + ext; } else if (cd.Name.Contains("generated")) { - name = IOHelper.GetFileName(FileType.PrimaryData, id, datasetVersionNumber, dataStructureId) + ext; + name = IOHelper.GetFileName(FileType.PrimaryData, id, datasetVersionNumber, dataStructureId, "", tagNr, useTags, useMinor) + ext; } else // all other files from unstructured and attachments // get filename from path @@ -356,7 +361,7 @@ public ActionResult GenerateZip(long id, long versionid, string format,bool with { string path = Path.Combine(AppConfiguration.DataPath, filteredFilePath); string ext = Path.GetExtension(filteredFilePath).ToLower(); - string name = IOHelper.GetFileName(FileType.PrimaryData, id, datasetVersionNumber, dataStructureId)+"_filtered"+ ext; + string name = IOHelper.GetFileName(FileType.PrimaryData, id, datasetVersionNumber, dataStructureId, "", tagNr, useTags, useMinor)+"_filtered"+ ext; archive.AddFileToArchive(filteredFilePath, name); } @@ -389,7 +394,7 @@ public ActionResult GenerateZip(long id, long versionid, string format,bool with if (manifest != null) { - string manifestFileName = IOHelper.GetFileName(FileType.Manifest, id, datasetVersionNumber, dataStructureId); + string manifestFileName = IOHelper.GetFileName(FileType.Manifest, id, datasetVersionNumber, dataStructureId,"", tagNr, useTags, useMinor); string manifestPath = OutputDatasetManager.GetDynamicDatasetStorePath(id, datasetVersionNumber, "general_metadata", ".json"); string fullFilePath = Path.Combine(AppConfiguration.DataPath, manifestPath);