Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Components/XML/BExIS.Xml.Helpers/XmlMetadataConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Xml;
using System.Xml.Linq;

Expand Down Expand Up @@ -123,6 +124,7 @@ private JToken _convertPackageUsage(XmlNode node, MetadataPackageUsage usage, bo
// add all children nodes
JObject complex = new JObject();
setReference(complex, (XmlElement)tCHild, includeEmpty);
setParameters(complex, (XmlElement)tCHild, includeEmpty);

for (int i = 0; i < tCHild.ChildNodes.Count; i++)
{
Expand Down Expand Up @@ -217,6 +219,7 @@ private JToken _convertElementUsage(XmlNode node, BaseUsage usage, bool includeE
// add all children nodes
JObject complex = new JObject();
setReference(complex, (XmlElement)tCHild, includeEmpty);
setParameters(complex, (XmlElement)tCHild, includeEmpty);

for (int i = 0; i < tCHild.ChildNodes.Count; i++)
{
Expand Down Expand Up @@ -324,6 +327,7 @@ private JObject addSimple(BaseUsage usage, string valueAsString, XmlElement refe
}

setReference(simple, reference, includeEmpty);
setParameters(simple, reference, includeEmpty);

simple.Add(new JProperty("#text", value));

Expand Down Expand Up @@ -351,6 +355,22 @@ private void setReference(JObject target, XmlElement element, bool includeEmpty)
}
}

private void setParameters(JObject target, XmlElement element, bool includeEmpty)
{
if(element.HasAttributes)
{
List<String> ignore = new List<String>() { "type", "ref", "id", "roleId", "number", "name" }; // system attributes

foreach (XmlAttribute attr in element.Attributes)
{
if (!ignore.Contains(attr.Name))
{
target.Add("@" + attr.Name, attr.Value);
}
}
}
}

#endregion XML to JSON

#region JSON to XML
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"type": "module",
"dependencies": {
"@bexis2/bexis2-core-ui": "0.4.74",
"@bexis2/bexis2-rpm-ui": "0.2.15",
"@bexis2/bexis2-rpm-ui": "0.3.0",
"@floating-ui/dom": "1.6.8",
"@fortawesome/free-solid-svg-icons": "6.6.0",
"@sveltejs/adapter-static": "3.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body data-theme="bexis2theme" >
<div id="test" dataset="15">
<div id="edit" dataset="1" version="0" >
<div id="metadata" dataset="3" saveWithError="false" >
<div id="metadata" dataset="11" saveWithError="false" >
<div id="datastructure" dataset="2" version="0" file="Plants Species Interactions.csv">
<div id="view" dataset="1" version="0">
<div style="display: contents" class="h-full overflow-hidden">%sveltekit.body%</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,89 +241,89 @@
// show info text on top (simple is optional / complex mandatory)
if ((@hasSimpleMapping) && Model.PartyMappingExist && Model.MappingSelectionField)
{
<div style="color: gray">If possible, use an entry from autocomplete list.</div>
<div style="color: gray">If possible, use an entry from autocomplete list.</div>
}

if ((hasComplexMapping) && Model.PartyMappingExist && Model.MappingSelectionField)
{
<div style="color: gray">Use an entry from autocomplete list.</div>
<div style="color: gray">Use an entry from autocomplete list.</div>
}

<input class="t-widget t-autocomplete t-input bx-metadataFormTextInput @errorClass" complex="@hasComplexMapping.ToString()" id="@idInput" idbyxpath="@idByXpath" onKeyUp="OnKeyUpTextInput(this)" name="@idInput" simple="@hasSimpleMapping.ToString()" partyid="@partyid" test="@Model.Id" title="" type="@autoCompleteType" value="@value" xpath="@xpath" isMappingSelection="@isMappingSelection">
<input class="t-widget t-autocomplete t-input bx-metadataFormTextInput @errorClass" complex="@hasComplexMapping.ToString()" id="@idInput" idbyxpath="@idByXpath" onKeyUp="OnKeyUpTextInput(this)" name="@idInput" simple="@hasSimpleMapping.ToString()" partyid="@partyid" test="@Model.Id" title="" type="@autoCompleteType" value="@value" xpath="@xpath" isMappingSelection="@isMappingSelection">

// add icons to show linked / not linked party entries; hide both by default
var notLinkedID = @idInput + "_notLinked";
var linkedID = @idInput + "_linked";
<span id="@notLinkedID" style="display: none; font-size: 1em; color: Tomato;" title="Entry is not linked! Please type and use an entry from the list if available."><i class="fa fa-times-circle"></i></span>
<span id="@linkedID" style="display: none; font-size: 1em; color: green;" title="Entry is linked."><i class="fa fa-check-circle"></i></span>
<span id="@notLinkedID" style="display: none; font-size: 1em; color: Tomato;" title="Entry is not linked! Please type and use an entry from the list if available."><i class="fa fa-times-circle"></i></span>
<span id="@linkedID" style="display: none; font-size: 1em; color: green;" title="Entry is linked."><i class="fa fa-check-circle"></i></span>

// show not linked, when on any content, but not linked
if ((@hasSimpleMapping || hasComplexMapping) && Model.MappingSelectionField && Model.PartyMappingExist && partyid == "" && Model.Value != null)
{
<script type="text/javascript">$("#@notLinkedID").show()</script>
<script type="text/javascript">$("#@notLinkedID").show()</script>
}
// show linked, when a party id is selected
else if ((@hasSimpleMapping || hasComplexMapping) && Model.MappingSelectionField && Model.PartyMappingExist && partyid != "" && Model.Value != null)
{
<script type="text/javascript">$("#@linkedID").show()</script>
<script type="text/javascript">$("#@linkedID").show()</script>
}

<style>
.ui-autocomplete-loading {
background: white url("../../Images/ui-anim_basic_16x16.gif") right center no-repeat;
}
</style>

<script type="text/javascript">
$( function() {
var cache = {};
$( "#@idInput" ).autocomplete({

minLength: 1,
delay: 300, // this is in milliseconds
change: function (event, ui) { OnChangeTextInput(event, ui); },
select: function (event, ui) { OnClose(event, ui); },
json: true,
source: function(request, response){
// New request 300ms after key stroke
var $this = $(this);
var term = request.term;
var $element = $(this.element);
request["text"] = request.term;

if ( term in cache ) {
response( cache[ term ] );
return;
}

var previous_request = $element.data( "jqXHR" );
if( previous_request ) {
previous_request.abort();
}

$element.data( "jqXHR", $.ajax( {
type: "POST",
url: "/DCM/Form/_AutoCompleteAjaxLoading/@Model.Id?type=@Model.Source.GetType().Name",
data: request,
dataType: "json",
success: function( data ){

//console.log(data);

var list = [];
for (i = 0; i < data.length; i++) {
list.push(data[i]["Text"]);
}

cache[ term ] = list;
response(list);

}//success
}));
}
});
});
</script>
<style>
.ui-autocomplete-loading {
background: white url("../../Images/ui-anim_basic_16x16.gif") right center no-repeat;
}
</style>

<script type="text/javascript">
$( function() {
var cache = {};
$( "#@idInput" ).autocomplete({

minLength: 1,
delay: 300, // this is in milliseconds
change: function (event, ui) { OnChangeTextInput(event, ui); },
select: function (event, ui) { OnClose(event, ui); },
json: true,
source: function(request, response){
// New request 300ms after key stroke
var $this = $(this);
var term = request.term;
var $element = $(this.element);
request["text"] = request.term;

if ( term in cache ) {
response( cache[ term ] );
return;
}

var previous_request = $element.data( "jqXHR" );
if( previous_request ) {
previous_request.abort();
}

$element.data( "jqXHR", $.ajax( {
type: "POST",
url: "/DCM/Form/_AutoCompleteAjaxLoading/@Model.Id?type=@Model.Source.GetType().Name",
data: request,
dataType: "json",
success: function( data ){

//console.log(data);

var list = [];
for (i = 0; i < data.length; i++) {
list.push(data[i]["Text"]);
}

cache[ term ] = list;
response(list);

}//success
}));
}
});
});
</script>

}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# bexis2-rpm-ui
## 0.3.0
- change loading of possible templates by datastructure generation

## 0.2.13
- change message when file is analyzed for a data structure

Expand Down
Loading
Loading