Skip to content

Commit 4ab5696

Browse files
committed
Merge branch 'rc' of https://github.com/BEXIS2/Core into rc
2 parents 05a26c6 + a0a4e60 commit 4ab5696

File tree

13 files changed

+384
-204
lines changed

13 files changed

+384
-204
lines changed

Components/IO/BExIS.IO.DataType.DisplayPattern/DataTypeDisplayPattern.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public class DataTypeDisplayPattern
3939
new DataTypeDisplayPattern() {Id=25,Systemtype = DataTypeCode.DateTime, Name = "DateEu with time", ExcelPattern=@"dd\.MM\.yyyy hh:mm:ss", DisplayPattern="dd.MM.yyyy hh:mm:ss", StringPattern = "dd.MM.yyyy hh:mm:ss", RegexPattern = null},
4040
new DataTypeDisplayPattern() {Id=26,Systemtype = DataTypeCode.DateTime, Name = "Hour", ExcelPattern=@"HH", DisplayPattern="HH", StringPattern = "HH", RegexPattern = null},
4141
new DataTypeDisplayPattern() {Id=27,Systemtype = DataTypeCode.DateTime, Name = "Minute", ExcelPattern=@"mm", DisplayPattern="mm", StringPattern = "mm", RegexPattern = null},
42-
new DataTypeDisplayPattern() {Id=28,Systemtype = DataTypeCode.DateTime, Name = "Secound", ExcelPattern=@"ss", DisplayPattern="ss", StringPattern = "ss", RegexPattern = null}
42+
new DataTypeDisplayPattern() {Id=28,Systemtype = DataTypeCode.DateTime, Name = "Secound", ExcelPattern=@"ss", DisplayPattern="ss", StringPattern = "ss", RegexPattern = null},
43+
new DataTypeDisplayPattern() {Id=29,Systemtype = DataTypeCode.DateTime, Name = "DateEu with time24", ExcelPattern=@"dd\.MM\.yyyy HH:mm:ss", DisplayPattern="dd.MM.yyyy HH:mm:ss", StringPattern = "dd.MM.yyyy HH:mm:ss", RegexPattern = null}
44+
4345
};
4446

4547
public DataTypeCode Systemtype { get; set; }

Components/XML/BExIS.Xml.Helpers/Mapping/XmlSchemaManager.cs

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ public long GenerateMetadataStructure(string nameOfStartNode, string schemaName)
716716
//Debug.Writeline("package : " + element.Name);
717717
//Debug.Writeline("--------------------------");
718718

719-
string typeName = GetTypeOfName(element.Name);
719+
string typeName = GetTypeOfName(element);
720720
string rootName = ((XmlSchemaElement)root).Name;
721721

722722
string xpathInternal = "Metadata/" + element.Name + "/" + typeName;
@@ -965,7 +965,7 @@ private MetadataCompoundAttribute get(XmlSchemaElement element, List<string> par
965965
if (ct.Name != null)
966966
nameOfType = ct.Name;
967967
else
968-
nameOfType = GetTypeOfName(element.Name);
968+
nameOfType = GetTypeOfName(element);
969969

970970
MetadataCompoundAttribute metadataCompountAttr = getExistingMetadataCompoundAttribute(nameOfType);
971971
string currentInternalXPath = internalXPath + "/" + element.Name + "/" + nameOfType;
@@ -1328,9 +1328,9 @@ private MetadataCompoundAttribute addMetadataAttributeToMetadataCompoundAttribut
13281328
MetadataAttribute attribute;
13291329

13301330
if (metadataAttributeManager.MetadataAttributeRepo != null &&
1331-
getExistingMetadataAttribute(GetTypeOfName(element.Name)) != null)
1331+
getExistingMetadataAttribute(GetTypeOfName(element)) != null)
13321332
{
1333-
attribute = getExistingMetadataAttribute(GetTypeOfName(element.Name));
1333+
attribute = getExistingMetadataAttribute(GetTypeOfName(element));
13341334
}
13351335
else
13361336
{
@@ -1443,7 +1443,7 @@ private MetadataAttribute createMetadataAttribute(XmlSchemaElement element, stri
14431443
{
14441444
XmlSchemaSimpleType type = (XmlSchemaSimpleType)element.ElementSchemaType;
14451445

1446-
string name = GetTypeOfName(element.Name);
1446+
string name = GetTypeOfName(element);
14471447
string description = "";
14481448

14491449
if (element.Annotation != null)
@@ -1507,7 +1507,7 @@ private MetadataAttribute createMetadataAttribute(XmlSchemaElement element, stri
15071507
var t = ComplexTypes.FirstOrDefault(c => c.Name.Equals(type.Name));
15081508
if (t != null) type = t;
15091509

1510-
string name = GetTypeOfName(element.Name);
1510+
string name = GetTypeOfName(element);
15111511
string description = "";
15121512

15131513
if (element.Annotation != null)
@@ -1628,7 +1628,8 @@ private MetadataCompoundAttribute createMetadataCompoundAttribute(XmlSchemaEleme
16281628
{
16291629
// create a compoundAttribute
16301630
int i = 0;
1631-
MetadataCompoundAttribute mca = getExistingMetadataCompoundAttribute(element.Name + "Type"); ;// = metadataAttributeManager.MetadataCompoundAttributeRepo.Get(p => p.Name == element.Name+"Type").FirstOrDefault();
1631+
string typeName = GetTypeOfName(element);
1632+
MetadataCompoundAttribute mca = getExistingMetadataCompoundAttribute(typeName); ;// = metadataAttributeManager.MetadataCompoundAttributeRepo.Get(p => p.Name == element.Name+"Type").FirstOrDefault();
16321633
//Debug.WriteLine("createMetadataCompoundAttribute" + i++);
16331634
DataType dt1 = dataTypeManager.Repo.Get(p => p.Name.ToLower().Equals("text")).FirstOrDefault();
16341635
if (dt1 == null)
@@ -1640,8 +1641,8 @@ private MetadataCompoundAttribute createMetadataCompoundAttribute(XmlSchemaEleme
16401641
{
16411642
mca = new MetadataCompoundAttribute
16421643
{
1643-
ShortName = GetTypeOfName(element.Name),
1644-
Name = GetTypeOfName(element.Name),
1644+
ShortName = typeName,
1645+
Name = typeName,
16451646
Description = "",
16461647
DataType = dt1
16471648
};
@@ -1909,9 +1910,9 @@ private void addMetadataAttributeToMappingFile(MetadataCompoundAttribute compoun
19091910
MetadataAttribute attribute;
19101911

19111912
if (metadataAttributeManager.MetadataAttributeRepo != null &&
1912-
metadataAttributeManager.MetadataAttributeRepo.Query().Where(m => m.Name.Equals(GetTypeOfName(element.Name))).Count() > 0)
1913+
metadataAttributeManager.MetadataAttributeRepo.Query().Where(m => m.Name.Equals(GetTypeOfName(element))).Count() > 0)
19131914
{
1914-
attribute = metadataAttributeManager.MetadataAttributeRepo.Query().Where(m => m.Name.Equals(GetTypeOfName(element.Name))).First();
1915+
attribute = metadataAttributeManager.MetadataAttributeRepo.Query().Where(m => m.Name.Equals(GetTypeOfName(element))).First();
19151916
}
19161917
else
19171918
{
@@ -2203,9 +2204,28 @@ private void checkDirectory(string filePath)
22032204
}
22042205
}
22052206

2206-
private string GetTypeOfName(string name)
2207+
private string GetTypeOfName(XmlSchemaElement element)
22072208
{
2208-
return name + "Type";
2209+
string nameOfType = "";
2210+
2211+
// check if type is complex
2212+
XmlSchemaComplexType ct = XmlSchemaUtility.GetComplextType(element);
2213+
2214+
if (ct != null && ct.Name != null)
2215+
{
2216+
return ct.Name;
2217+
}
2218+
2219+
//check if simple type
2220+
XmlSchemaSimpleType st = XmlSchemaUtility.GetSimpleType(element);
2221+
2222+
if(st != null && st.Name != null)
2223+
{
2224+
return st.Name;
2225+
}
2226+
2227+
// nothing found so create a new name + XSDType
2228+
return element.Name + element.ElementType.GetType().Name; // bexis2InternType
22092229
}
22102230

22112231
#endregion helper functions

Components/XML/BExIS.Xml.Helpers/XmlSchemaUtility.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,14 @@ public static XmlSchemaComplexType GetComplextType(XmlSchemaElement element)
524524
return null;
525525
}
526526

527+
public static XmlSchemaSimpleType GetSimpleType(XmlSchemaElement element)
528+
{
529+
if (element.ElementSchemaType is XmlSchemaSimpleType)
530+
return element.ElementSchemaType as XmlSchemaSimpleType;
531+
532+
return null;
533+
}
534+
527535
public static List<XmlSchemaElement> GetAllSimpleElements(List<XmlSchemaElement> elements)
528536
{
529537
List<XmlSchemaElement> simpleElementList = new List<XmlSchemaElement>();

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Views/Form/MetadataEditor.cshtml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<div>
135135
<table>
136136
<tr>
137-
@if (locked)
137+
@*@if (locked)
138138
{
139139

140140
<td style="width:500px;">
@@ -177,7 +177,7 @@
177177

178178

179179
</td>
180-
}
180+
}*@
181181

182182
@if (!Model.Created && !locked && Model.Import)
183183
{
@@ -198,6 +198,18 @@
198198
)
199199
</td>
200200
}
201+
<td>
202+
@if (ViewData["IsValid"] == "no")
203+
{
204+
<div id="view-warning-container">
205+
<div id="view-warning" class="alert alert-danger" role="alert" style="width: 100%;">
206+
<span id="view-warning-icon" class=" fa fa-exclamation-triangle"></span>
207+
The metadata for this dataset is not complete.
208+
</div>
209+
</div>
210+
}
211+
212+
</td>
201213

202214
<td id="form_message_container_Column" style="text-align: right">
203215
<span id="form_message"></span>
@@ -214,16 +226,7 @@
214226
</table>
215227
</div>
216228

217-
@if (ViewData["IsValid"] == "no" )
218-
{
219-
<div id="view-warning-container">
220-
<div id="view-warning" class="alert alert-danger" role="alert" style="width: 100%;">
221-
<span id="view-warning-icon" class=" fa fa-exclamation-triangle"></span>
222-
The metadata for this dataset is not complete.
223-
</div>
224-
</div>
225-
}
226-
229+
227230
@if (validationErrors.Any())
228231
{
229232
<div id="view-warning-container">

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI.Svelte/src/routes/search/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
contentLayoutType={pageContentLayoutType.full}
1717
{links}
1818
>
19+
<h1>eric is cool</h1>
1920
<Search {controller} />
2021
</Page>

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/DataController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public ActionResult ShowData(long id, int version = 0, bool asPartial = false, s
171171
ViewData["use_minor"] = moduleSettings.GetValueByKey("use_minor");
172172
ViewData["check_public_metadata"] = moduleSettings.GetValueByKey("check_public_metadata");
173173
ViewData["has_data"] = false;
174+
ViewData["data_aggreement"] = moduleSettings.GetValueByKey("data_aggreement");
174175
Session["Filter"] = null;
175176

176177
Dataset researcobject = dm.GetDataset(id);
@@ -782,6 +783,7 @@ public ActionResult ShowPrimaryData(long datasetID, int versionId)
782783
}
783784

784785
ViewData["gridTotal"] = dm.RowCount(dataset.Id, null);
786+
ViewData["isPublic"] = entityPermissionManager.ExistsAsync(dataset.EntityTemplate.EntityType.Id, dataset.Id).Result;
785787

786788
sds.Variables = sds.Variables.OrderBy(v => v.OrderNo).ToList();
787789

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Ddm.Settings.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@
4545
"type": "Boolean",
4646
"description": "If set to true, the minor version tag can be assigned to dataset versions to display changes in more detail."
4747
},
48+
{
49+
"key": "data_aggreement",
50+
"title": "Data Aggreement by download",
51+
"value": "none",
52+
"description": "Set up if user need to aggree the data aggreements before download and where the aggreement is writen.",
53+
"type": "String",
54+
"options": [
55+
"none",
56+
"data policy",
57+
"terms and conditions"
58+
]
59+
},
4860
{
4961
"key": "citationSettings",
5062
"title": "settings for citations",
@@ -56,7 +68,7 @@
5668
"numberOfAuthors": 0,
5769
"showCitation": true,
5870
"defaultViewCitationFormat": "Text",
59-
"viewCitationFormats": ["Text", "APA"],
71+
"viewCitationFormats": [ "Text", "APA" ],
6072
"downloadCitationFormats": [ "Text", "APA", "RIS", "BibTex" ]
6173
},
6274
"description": "..."

0 commit comments

Comments
 (0)