Skip to content

Commit 060770d

Browse files
committed
#855 add terms to download package if its registered in the tenant
1 parent a0a4e60 commit 060770d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Controllers/ExportController.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
using Vaiona.Logging;
3636
using Vaiona.Persistence.Api;
3737
using Vaiona.Utils.Cfg;
38+
using Vaiona.Web.Extensions;
3839
using Vaiona.Web.Mvc.Modularity;
3940
using static System.Net.Mime.MediaTypeNames;
4041

@@ -297,12 +298,13 @@ public ActionResult GenerateZip(long id, long versionid, string format)
297298
if (Directory.Exists(xsdPath))
298299
archive.AddFolderToArchive(xsdPath, "Schema");
299300

301+
#region manifest
300302
// manifest
301303
ApiDatasetHelper apiDatasetHelper = new ApiDatasetHelper();
302304
// get content
303305
ApiDatasetModel datasetModel = apiDatasetHelper.GetContent(datasetVersion, id, datasetVersionNumber, datasetVersion.Dataset.MetadataStructure.Id, dataStructureId);
304306
string manifest = JsonConvert.SerializeObject(datasetModel);
305-
307+
306308
if (manifest != null)
307309
{
308310
string manifestPath = OutputDatasetManager.GetDynamicDatasetStorePath(id,
@@ -316,6 +318,16 @@ public ActionResult GenerateZip(long id, long versionid, string format)
316318

317319
archive.AddFileToArchive(fullFilePath, "manifest.json");
318320
}
321+
#endregion
322+
323+
#region terms and conditions
324+
325+
string termsPath = this.Session.GetTenant().GetResourcePath("terms");
326+
327+
if(!string.IsNullOrEmpty(termsPath) && System.IO.File.Exists(termsPath))
328+
archive.AddFileToArchive(termsPath, "terms.txt");
329+
330+
#endregion terms and conditions
319331

320332
string title = datasetVersion.Title;
321333
title = String.IsNullOrEmpty(title) ? "unknown" : title;

0 commit comments

Comments
 (0)