Skip to content

Commit d04e395

Browse files
committed
Merge branch 'rc' of https://github.com/BEXIS2/Core into rc
2 parents 340289e + bcecff2 commit d04e395

File tree

26 files changed

+287
-54
lines changed

26 files changed

+287
-54
lines changed

BExIS++.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,8 +1606,8 @@ Global
16061606
{37402CAB-EB81-4D08-8791-8653949C0FEB} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
16071607
EndGlobalSection
16081608
GlobalSection(ExtensibilityGlobals) = postSolution
1609-
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.2.1.505.2\lib\NET35
16101609
SolutionGuid = {9B6E4921-8EBA-487D-A098-3E473A0EAC64}
1610+
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.2.1.505.2\lib\NET35
16111611
EndGlobalSection
16121612
GlobalSection(SubversionScc) = preSolution
16131613
Svn-Managed = True

Components/IO/BExIS.Io.Transform.Output/OutputDataStructureManager.cs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@
55
using BExIS.Dlm.Services.DataStructure;
66
using BExIS.Dlm.Services.Meanings;
77
using BExIS.IO.DataType.DisplayPattern;
8+
using DocumentFormat.OpenXml.Drawing.Charts;
9+
using DocumentFormat.OpenXml.Math;
810
using Newtonsoft.Json;
911
using System;
1012
using System.Collections.Generic;
1113
using System.Data;
14+
using System.IO;
1215
using System.Linq;
16+
using System.Text;
17+
using System.Web.Configuration;
18+
using Vaiona.Utils.Cfg;
19+
using DataTable = System.Data.DataTable;
1320

1421
namespace BExIS.IO.Transform.Output
1522
{
@@ -426,16 +433,36 @@ public static string GetDataStructureAsJson(long id)
426433
return JsonConvert.SerializeObject(new DataStructureDataTable(id));
427434
}
428435

429-
//public static string GetVariableListAsJson(long id)
430-
//{
431-
// return JsonConvert.SerializeObject(new DataStructureDataList(id), Newtonsoft.Json.Formatting.Indented);
432-
//}
433436

434437
public static DataStructureDataList GetVariableList(long id)
435438
{
436439
return new DataStructureDataList(id);
437440
}
438441

442+
public static string GenerateDataStructureAsText(long datastructureId)
443+
{
444+
StringBuilder stringBuilder = new StringBuilder();
445+
446+
using (var dataStructureManager = new DataStructureManager())
447+
{
448+
StructuredDataStructure dataStructure = new StructuredDataStructure();
449+
dataStructure = dataStructureManager.StructuredDataStructureRepo.Get(datastructureId);
450+
451+
if (dataStructure != null)
452+
{
453+
stringBuilder.AppendLine(String.Join(",", dataStructure.Variables.Select(v => v.Label)));
454+
stringBuilder.AppendLine(String.Join(",", dataStructure.Variables.Select(v => v.Unit?.Name)));
455+
stringBuilder.AppendLine(String.Join(",", dataStructure.Variables.Select(v => v.Description)));
456+
stringBuilder.AppendLine(String.Join(",", dataStructure.Variables.Select(v => v.DataType?.Name)));
457+
stringBuilder.AppendLine(String.Join(",", dataStructure.Variables.Select(v => v.IsValueOptional? "optional" : "mandatory")));
458+
stringBuilder.AppendLine(String.Join(",", dataStructure.Variables.Select(v => v.IsKey?"primary key":"")));
459+
}
460+
}
461+
462+
return stringBuilder.ToString();
463+
}
464+
465+
439466
public static string GenerateDataStructure(long datasetId)
440467
{
441468
string path = "";

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"type": "module",
5252
"dependencies": {
5353
"@bexis2/bexis2-core-ui": "0.4.58",
54-
"@bexis2/bexis2-rpm-ui": "0.2.13",
54+
"@bexis2/bexis2-rpm-ui": "0.2.14",
5555
"@floating-ui/dom": "1.6.8",
5656
"@fortawesome/free-solid-svg-icons": "6.6.0",
5757
"@sveltejs/adapter-static": "3.0.2",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class DatasetOutController : ApiController
4747
/// </summary>
4848
[BExISApiAuthorize]
4949
[HttpGet]
50-
[Route("")]
50+
[GetRoute("")]
5151
[ResponseType(typeof(ApiSimpleDatasetModel))]
5252
public IEnumerable<ApiSimpleDatasetModel> Get()
5353
{

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,24 @@ public ActionResult GenerateZip(long id, long versionid, string format,bool with
274274
DataStructure dataStructure = dataStructureManager.StructuredDataStructureRepo.Get(dataStructureId);
275275

276276
string dataStructurePath = "";
277-
dataStructurePath = storeGeneratedFilePathToContentDiscriptor(id, datasetVersion,
278-
"datastructure", ".json");
277+
dataStructurePath = storeGeneratedFilePathToContentDiscriptor(id, datasetVersion,"datastructure", ".json");
279278
string datastructureFilePath = AsciiWriter.CreateFile(dataStructurePath);
280279

280+
// generate json
281281
string json = OutputDataStructureManager.GetDataStructureAsJson(dataStructureId);
282-
283282
AsciiWriter.AllTextToFile(datastructureFilePath, json);
284283

284+
// generate txt
285+
dataStructurePath = storeGeneratedFilePathToContentDiscriptor(id, datasetVersion,"datastructure", ".csv");
286+
datastructureFilePath = AsciiWriter.CreateFile(dataStructurePath);
287+
288+
string txt = OutputDataStructureManager.GenerateDataStructureAsText(dataStructureId);
289+
290+
AsciiWriter.AllTextToFile(datastructureFilePath, txt);
291+
292+
// generate html
285293
generateDataStructureHtml(datasetVersion);
294+
286295
}
287296

288297
#endregion
@@ -342,7 +351,7 @@ public ActionResult GenerateZip(long id, long versionid, string format,bool with
342351
{
343352
string path = Path.Combine(AppConfiguration.DataPath, filteredFilePath);
344353
string ext = Path.GetExtension(filteredFilePath).ToLower();
345-
string name = IOHelper.GetFileName(FileType.PrimaryData, id, datasetVersionNumber, dataStructureId)+"filtered"+ ext;
354+
string name = IOHelper.GetFileName(FileType.PrimaryData, id, datasetVersionNumber, dataStructureId)+"_filtered"+ ext;
346355

347356
archive.AddFileToArchive(filteredFilePath, name);
348357
}
@@ -573,8 +582,7 @@ private void generateDataStructureHtml(DatasetVersion dsv)
573582
byte[] content = Encoding.ASCII.GetBytes(view.ToString());
574583

575584
string dynamicPathOfMD = "";
576-
dynamicPathOfMD = storeGeneratedFilePathToContentDiscriptor(dsv.Dataset.Id, dsv,
577-
"datastructure", ".html");
585+
dynamicPathOfMD = storeGeneratedFilePathToContentDiscriptor(dsv.Dataset.Id, dsv,"datastructure", ".html");
578586
string metadataFilePath = AsciiWriter.CreateFile(dynamicPathOfMD);
579587

580588
AsciiWriter.AllTextToFile(metadataFilePath, view.ToString());

Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bexis2/bexis2-rpm-ui",
3-
"version": "0.2.13",
3+
"version": "0.2.14",
44
"private": false,
55
"scripts": {
66
"dev": "vite dev",

Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
enforcePrimaryKey="true"
2626
changeablePrimaryKey="true"
2727
updateDescriptionByTemplate="false"
28+
showDarwinCoreValidation="true"
2829
>
2930
%sveltekit.body%
3031
</div>

Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/lib/components/datastructure/services.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@ export const getConstraints = async () => {
206206
}
207207
};
208208

209+
export const getDWCList = async () => {
210+
try {
211+
const response = await Api.get('/rpm/DataStructure/getDWCRequirements');
212+
return response.data;
213+
} catch (error) {
214+
console.error(error);
215+
}
216+
};
217+
209218
// go to a internal action
210219
export const goTo = async (url: string) => {
211220
window.open(host + url, '_self').focus();

0 commit comments

Comments
 (0)