Skip to content

Commit 20ffd56

Browse files
authored
Merge pull request #2161 from BEXIS2/rc
Rc
2 parents 8536776 + e5a0f7f commit 20ffd56

File tree

5 files changed

+56
-14
lines changed

5 files changed

+56
-14
lines changed

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Helpers/CitationsHelper.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,18 @@ public static CitationDataModel GetCitationDataModel(long datasetVersionId)
112112
{
113113
if (!String.IsNullOrEmpty(pub.Doi))
114114
model.URL = pub.Doi;
115+
else if (!String.IsNullOrEmpty(pub.ExternalLink))
116+
model.URL = pub.ExternalLink;
117+
115118
}
116-
else
119+
120+
if (String.IsNullOrEmpty(model.URL))
117121
{
118-
if(useTags)
122+
if (useTags)
119123
model.URL = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + $"/ddm/data/Showdata/{datasetVersion.Dataset.Id}?tag={model.Version}";
120124

121125
model.URL = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + $"/ddm/data/Showdata/{datasetVersion.Dataset.Id}?version={model.Version}";
122-
126+
123127
}
124128
}
125129
}

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Models/CitationModels.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using BExIS.App.Bootstrap.Attributes;
2+
using System;
23
using System.Collections.Generic;
34
using System.ComponentModel.DataAnnotations;
45
using System.Xml.Serialization;
@@ -51,6 +52,7 @@ public class CitationDataModel
5152
public string Year { get; set; }
5253

5354
[XmlElement("doi")]
55+
[Obsolete]
5456
public string DOI { get; set; }
5557

5658
[XmlElement("url")]
Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
@model BExIS.Modules.Ddm.UI.Models.CitationDataModel
22

3-
<div>@String.Join("; ", Model.Authors) (@(Model.Year)): @(Model.Title). Version @(Model.Version). @(Model.Publisher). @(Model.EntityType). @(Model.URL)</div>
3+
<div id="citation-container"><b>Citation:</b><div id="citation-title">@String.Join("; ", Model.Authors) (@(Model.Year)): <b>@(Model.Title)</b>. Version @(Model.Version). @(Model.Publisher). @(Model.EntityType). @(Model.URL) <span id="citation-copy" class="bx bx-copy" onclick="copyDivContentToClipboard('citation-title')"></span></div>
4+
5+
</div>
46

5-
@*{Nachname Ersteller}, {Initialen Ersteller}. ({Jahr}). {Titel des Datensatzes} [Datensatz]. {Herausgeber/Organisation}. Abgerufen am {Datum des Zugriffs}, von https://doi.org/{DOI} oder {URL}*@
7+
@*{Nachname Ersteller}, {Initialen Ersteller}. ({Jahr}). {Titel des Datensatzes} [Datensatz]. {Herausgeber/Organisation}. Abgerufen am {Datum des Zugriffs}, von https://doi.org/{DOI} oder {URL}*@
8+
9+
<script>
10+
function copyDivContentToClipboard(divId) {
11+
const div = document.getElementById(divId);
12+
// You can copy text or HTML content, change as needed
13+
const content = div.innerText; // Use innerHTML if you want to copy HTML formatting
14+
15+
navigator.clipboard.writeText(content)
16+
.then(() => {
17+
alert('Citation copied to clipboard!');
18+
})
19+
.catch(err => {
20+
alert('Error copying citation: ' + err);
21+
});
22+
}
23+
24+
</script>
25+
26+
<style>
27+
#citation-container {
28+
display: flex;
29+
flex: auto;
30+
gap: 10px;
31+
}
32+
33+
#citation-copy {
34+
cursor: pointer;
35+
}
36+
37+
#citation-copy:hover {
38+
color: var(--bexis2-gray-3);
39+
}
40+
41+
</style>

Console/Workspace

database update scripts/4.0.2-4.1.0.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ BEGIN TRANSACTION;
2525
update datatypes
2626
set
2727
name = 'Text',
28-
description = 'A unicode string'
28+
description = 'A special data type for very long sequences of character.'
2929
where id = (select id systemtype from datatypes where systemtype = 'String' and name = 'text'
3030
order by id
3131
limit 1);
@@ -37,7 +37,7 @@ update datatypes
3737
update datatypes
3838
set
3939
name = 'String',
40-
description = 'A unicode string'
40+
description = 'A sequence of characters, such as letters, numbers, or symbols (e.g., IDs).'
4141
where id = (select id systemtype from datatypes where systemtype = 'String' and name = 'string'
4242
order by id
4343
limit 1);
@@ -65,7 +65,7 @@ select id from datatypes where SystemType like 'Int%';
6565
update datatypes
6666
set
6767
name = 'Integer',
68-
description = 'An 64 bit integer number'
68+
description = 'A data type for whole numbers. In this case, it corresponds to Int64, a 64-bit integer that can represent large values.'
6969
where id = (select id systemtype from datatypes where systemtype = 'Int64'
7070
order by id
7171
limit 1);
@@ -89,7 +89,7 @@ select id from datatypes where SystemType = 'Double';
8989
update datatypes
9090
set
9191
name = 'Floating Point Number',
92-
description = 'A precise real number with a restricted range'
92+
description = 'A floating-point number with double precision (for decimal values, e.g., 3.14159).'
9393
where id = (select id systemtype from datatypes where systemtype = 'Double'
9494
order by id
9595
limit 1);
@@ -112,23 +112,23 @@ select * from datatypes where systemtype = 'DateTime';
112112
update datatypes
113113
set
114114
name = 'Date and Time',
115-
description = 'A date with / or time'
115+
description = 'A data type for storing both a calendar date and a time.'
116116
where id = (select id systemtype from datatypes where systemtype = 'DateTime' and name = 'datetime'
117117
order by id
118118
limit 1);
119119

120120
update datatypes
121121
set
122122
name = 'Date',
123-
description = 'A date'
123+
description = 'A data type for storing a calendar date without time.'
124124
where id = (select id systemtype from datatypes where systemtype = 'DateTime' and name = 'date'
125125
order by id
126126
limit 1);
127127

128128
update datatypes
129129
set
130130
name = 'Time',
131-
description = 'A time'
131+
description = 'A data type for storing a time of day without a date.'
132132
where id = (select id systemtype from datatypes where systemtype = 'DateTime' and name = 'time'
133133
order by id
134134
limit 1);
@@ -150,7 +150,7 @@ where datatyperef in (select id from datatypes where SystemType = 'DateTime');
150150
update datatypes
151151
set
152152
name = 'Boolean',
153-
description = 'A boolean value'
153+
description = 'A logical data type with only two possible values: true or false; 0 or 1.'
154154
where id = (select id systemtype from datatypes where systemtype = 'Boolean'
155155
order by id
156156
limit 1);

0 commit comments

Comments
 (0)