Changes for page For Developers


From version 10.1
edited by Artur
on 2025/07/24 17:01
Change comment: There is no comment for this version
To version 16.1
edited by Artur
on 2025/07/25 13:28
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,14 +1,10 @@
1 1  ==== **Semantic Interoperability Ontology** ====
2 2  
3 3  |**URI**|[[http:~~/~~/purl.semanticip.org/linked-data/>>http://purl.semanticip.org/linked-data/]]
4 -|**Description**|The SIP ontology defines the semantic integration layer of the Interoperability Basis initiative. It supports formalization and publication of statistical standards such as SDMX and SIMS using FAIR and Linked Data principles.
5 -|**Contibutor**|(((
6 -[[http:~~/~~/purl.semanticip.org/linked-data/SemanticPro>>http://purl.semanticip.org/linked-data/SemanticPro]] {{velocity}}[[$services.icon.render('file','Font Awesome') TTL>>||class="getTTL"]]{{/velocity}}
7 -)))
8 -|**Has Part**|(((
9 -[[http:~~/~~/purl.semanticip.org/linked-data/sdmx/>>http://purl.semanticip.org/linked-data/sdmx/]] {{velocity}}[[$services.icon.render('file','Font Awesome') TTL>>||class="getTTL"]]{{/velocity}}
10 -)))
4 +|**Description**|The SIP ontology defines the semantic integration layer of the Interoperability Basis Platform. It supports formalization and publication of statistical standards such as SDMX and SIMS using FAIR and Linked Data principles.
5 +|**Contibutor**|[[http://purl.semanticip.org/linked-data/SemanticPro]] {{velocity}}[[$services.icon.render('file','Font Awesome') TTL>>||class="getTTL"]]{{/velocity}}
6 +|**Has Part**|[[http://purl.semanticip.org/linked-data/sdmx/]] {{velocity}}[[$services.icon.render('file','Font Awesome') TTL>>||class="getTTL"]]{{/velocity}}
11 11  
12 12  [[SIMS>>https://ec.europa.eu/eurostat/documents/64157/4373903/SIMS-2-0-Revised-standards-November-2015-ESSC-final.pdf/47c0b80d-0e19-4777-8f9e-28f89f82ce18]] is currently under development as part of the SIP initiative to support metadata interoperability.
13 13  
14 -**sip-sdmx in TTL Format** [[Preview>>attach:sip.ttl||class="btn btn-primary"]]
10 +**sip in TTL Format** [[Preview>>attach:sip.ttl||class="btn btn-primary"]]
XWiki.JavaScriptExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,105 @@
1 +require(['jquery','bootstrap','xwiki-meta'], function($, _bs, xm) {
2 + 'use strict';
3 +
4 + // Вешаем делегированный обработчик на все кнопки с классом .getTTL
5 + $('body').on('click', '.getTTL', function(e) {
6 + e.preventDefault();
7 +
8 + var $btn = $(this);
9 + var parentTd = $btn.closest('td');
10 + if (!parentTd.length) {
11 + parentTd = $btn.closest('dd');
12 +}
13 + // Ищем freestanding-ссылку
14 + var uri = parentTd.find('a').attr('href');
15 + if (!uri) {
16 + return alert('Не найден исходный URI для запроса.');
17 + }
18 +
19 + // URL Groovy-скрипта
20 + var Url = "$xwiki.getURL('SKMS.Code.getTTLbyURI')";
21 +
22 + // Параметры AJAX (без изменений)
23 + var urlParams = {
24 + 'xpage': 'plain',
25 + 'outputSyntax': 'plain',
26 + 'action': 'getTTL',
27 + 'uri': uri
28 + };
29 +
30 + // Удаляем старый popover, если был
31 + $btn.popover('destroy');
32 +
33 + //title popover
34 + var lastPart = uri.substring(uri.lastIndexOf('/') + 1);
35 + let title = '<div style="display: flex; justify-content: space-between; align-items: center; width: 100%; min-width: 200px;">' + '<span style="flex: 1; word-break: break-all;">' + decodeURIComponent(lastPart) + '</span>' + '<button type="button" class="close popover-close-btn" aria-label="Close" style="border:none;background:none;font-size:1.2em;line-height:1;">&times;</button>'+ '</div>';
36 + let template = '<div class="popover ttl-preview-popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-title" >' + '<span style="flex: 1; word-break: break-word;">' + lastPart + '</span>' + '<button type="button" class="close popover-close-btn" aria-label="Close" style="border:none;background:none;font-size:1.2em;line-height:1;">&times;</button>' + '</h3>' + '<div class="popover-content"></div>' + '</div>';
37 + // Создаём popover со спиннером
38 + $btn.popover({
39 + trigger: 'manual',
40 + html: true,
41 + container: 'body',
42 + template: template,
43 + content: '<div class="col-md-12"><span class="fa fa-spinner fa-pulse"></span></div>'
44 + }).popover('show');
45 +
46 + // Навешиваем обработчик на кнопку закрытия поповера
47 +// Показываем заголовок вручную (Bootstrap мог его скрыть)
48 +setTimeout(function () {
49 + $('.popover .popover-title').css('display', 'flex').html(title);
50 +
51 + // Навешиваем обработчик на кнопку закрытия
52 + $('.popover .popover-close-btn').off('click').on('click', function () {
53 + $btn.popover('destroy');
54 +$('.popover').remove();
55 + });
56 +}, 100);
57 + // === AJAX POST (не менять) ===
58 + $.ajax({
59 + url: Url,
60 + type: 'POST',
61 + dataType: 'text',
62 + data: urlParams,
63 +
64 + beforeSend: function() {
65 + $(document.body).css('cursor','wait');
66 + },
67 +
68 + success: function(ttlText) {
69 + var pop = $btn.data('bs.popover');
70 + // $(this).data('bs.popover').tip().addClass('ttl-preview-popover');
71 + if (pop) {
72 + var $tip = pop.tip();
73 + $tip.addClass('ttl-preview-popover');
74 + $tip.find('.popover-body, .popover-content')
75 + .html(
76 + '<pre style="white-space: pre-wrap; font-family: monospace; margin:0;font-size:85%;">' +
77 + $('<div>').text(ttlText).html() +
78 + '</pre>'
79 + );
80 + }
81 + console.log(ttlText);
82 + if (xm.refreshVersion) xm.refreshVersion();
83 + },
84 +
85 + error: function(jqXHR) {
86 + var msg = "Ошибка при получении TTL:\nHTTP " +
87 + jqXHR.status + " — " + jqXHR.statusText;
88 + var pop = $btn.data('bs.popover');
89 + if (pop) {
90 + var $tip = pop.tip();
91 + $tip.find('.popover-body, .popover-content').text(msg);
92 + } else {
93 + alert(msg);
94 + }
95 + },
96 +
97 + complete: function() {
98 + $(document.body).css('cursor', 'default');
99 + }
100 + });
101 + // =======================
102 + });
103 +
104 +});
105 +
Parse content
... ... @@ -1,0 +1,1 @@
1 +Yes
Use this extension
... ... @@ -1,0 +1,1 @@
1 +currentPage
XWiki.StyleSheetExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,17 @@
1 +.page-preview-popover .arrow {
2 + visibility:hidden;
3 +}
4 +
5 +#set($width="600")
6 +
7 +#set($height="1000")
8 +
9 +.ttl-preview-popover {
10 + min-width: $!{width}px;
11 + overflow-x: hidden;
12 +#if($height!="")
13 + max-height: $!{height}px;
14 + overflow-y: hidden;
15 +#end
16 +}
17 +
Content Type
... ... @@ -1,0 +1,1 @@
1 +CSS
Parse content
... ... @@ -1,0 +1,1 @@
1 +Yes
Use this extension
... ... @@ -1,0 +1,1 @@
1 +currentPage