Changes for page Intersection table of ML Elements with glossary terms
Last modified by Artur K. on 2026/06/01 15:50
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -17,10 +17,7 @@ 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).bindValue('rootDocFullName', $rootDocFullName).bindValue('fullNamePrefix', $fullNamePrefix).execute()) 24 24 25 25 ## --------------------------- 26 26 ## 2. Получаем термины глоссария ... ... @@ -58,10 +58,10 @@ 58 58 #end 59 59 60 60 ## ---------------------------- 61 -## 4. Ищем совпадения и записываем rdfs.seeAlso58 +## 4. Ищем совпадения 62 62 ## ---------------------------- 63 63 #set($matches = []) 64 -#set($ updatedCount =0)61 +#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. Выводим результат86 +## 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> Writtentordfs.seeAlso</th>93 + <th>Glossary terms</th> 110 110 </tr> 111 111 </thead> 112 112 <tbody> 97 + <tr> 98 + <th colspan="2" style="text-align: center;"> 99 + Matches ($matches.size() of $totalCount) 100 + </th> 101 + </tr> 102 + 113 113 #if($matches.size() > 0) 114 114 #foreach($match in $matches) 115 115 <tr>