Last modified by Artur K. on 2026/06/01 15:50

From version 3.5
edited by Artur K.
on 2026/05/27 17:12
Change comment: There is no comment for this version
To version 1.2
edited by Artur K.
on 2026/05/25 16:41
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -17,10 +17,10 @@
17 17   and doc.fullName like :fullNamePrefix
18 18  order by doc.fullName")
19 19  
20 -#set($elementQuery = $services.query.hql($hqlElements))
21 -#set($discard = $elementQuery.bindValue('rootDocFullName', $rootDocFullName))
22 -#set($discard = $elementQuery.bindValue('fullNamePrefix', $fullNamePrefix))
23 -#set($elementRows = $elementQuery.execute())
20 +#set($elementRows = $services.query.hql($hqlElements)
21 + .bindValue('rootDocFullName', $rootDocFullName)
22 + .bindValue('fullNamePrefix', $fullNamePrefix)
23 + .execute())
24 24  
25 25  ## ---------------------------
26 26  ## 2. Получаем термины глоссария
... ... @@ -46,7 +46,7 @@
46 46   #set($glossaryTitle = "$!row[1]")
47 47  
48 48   #if("$!glossaryTitle" != "")
49 - #set($normalizedGlossaryTitle = $stringtool.lowerCase($glossaryTitle).replaceAll("\s+", ""))
49 + #set($normalizedGlossaryTitle = $stringtool.lowerCase($glossaryTitle).replaceAll("\\s+", ""))
50 50  
51 51   #if("$!normalizedGlossaryTitle" != "")
52 52   #set($discard = $glossaryMap.put($normalizedGlossaryTitle, {
... ... @@ -58,10 +58,10 @@
58 58  #end
59 59  
60 60  ## ----------------------------
61 -## 4. Ищем совпадения и записываем rdfs.seeAlso
61 +## 4. Ищем совпадения
62 62  ## ----------------------------
63 63  #set($matches = [])
64 -#set($updatedCount = 0)
64 +#set($totalCount = $elementRows.size())
65 65  
66 66  #foreach($row in $elementRows)
67 67   #set($elementFullName = $row[0])
... ... @@ -73,17 +73,6 @@
73 73   #if($glossaryMap.containsKey($normalizedElementTitle))
74 74   #set($glossaryData = $glossaryMap.get($normalizedElementTitle))
75 75  
76 - #set($rdoc = $xwiki.getDocument($elementFullName))
77 - #set($elementObj = $rdoc.getObject('SKMS.Ontology.Code.OntologyElementClass'))
78 -
79 - #set($seeAlsoValue = [])
80 - #set($discard = $seeAlsoValue.add($glossaryData.fullName))
81 -
82 - #set($discard = $elementObj.set('rdfs.seeAlso', $seeAlsoValue))
83 - #set($discard = $rdoc.save())
84 -
85 - #set($updatedCount = $updatedCount + 1)
86 -
87 87   #set($matchRow = {
88 88   "elementFullName" : $elementFullName,
89 89   "elementTitle" : $elementTitle,
... ... @@ -97,19 +97,23 @@
97 97  #end
98 98  
99 99  ## ---------------------------
100 -## 5. Выводим результат
89 +## 5. Выводим таблицу совпадений
101 101  ## ----------------------------
102 102  {{html clean="false" wiki="true"}}
103 -<p><strong>Updated:</strong> $updatedCount</p>
104 -
105 105  <table class="wikitable" border="1">
106 106   <thead>
107 107   <tr>
108 108   <th>Ontology elements</th>
109 - <th>Written to rdfs.seeAlso</th>
96 + <th>Glossary terms</th>
110 110   </tr>
111 111   </thead>
112 112   <tbody>
100 + <tr>
101 + <th colspan="2" style="text-align: center;">
102 + Matches ($matches.size() of $totalCount)
103 + </th>
104 + </tr>
105 +
113 113   #if($matches.size() > 0)
114 114   #foreach($match in $matches)
115 115   <tr>
© Semantic R&D Group, 2026