Skip to content

Commit 1d6a408

Browse files
committed
INTLV-16: Migrate the core code to separate document
1 parent 9341e31 commit 1d6a408

File tree

4 files changed

+200
-132
lines changed

4 files changed

+200
-132
lines changed

application-interactive-link-visualizer-ui/src/main/resources/InteractiveLinkVisualizer/Code.xml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
1-
<?xml version='1.1' encoding='UTF-8'?>
1+
<?xml version="1.1" encoding="UTF-8"?>
2+
3+
<!--
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
-->
22+
223
<xwikidoc version="1.5" reference="InteractiveLinkVisualizer.Code" locale="">
324
<web>InteractiveLinkVisualizer</web>
425
<name>Code</name>
526
<language/>
6-
<defaultLanguage>en</defaultLanguage>
27+
<defaultLanguage/>
728
<translation>0</translation>
8-
<creator>XWiki.Admin</creator>
9-
<creationDate>1690210270000</creationDate>
29+
<creator>xwiki:XWiki.Admin</creator>
1030
<parent>WebHome</parent>
11-
<author>XWiki.Admin</author>
12-
<originalMetadataAuthor>XWiki.Admin</originalMetadataAuthor>
13-
<contentAuthor>XWiki.Admin</contentAuthor>
14-
<date>1691042414000</date>
15-
<contentUpdateDate>1691041999000</contentUpdateDate>
16-
<version>7.3</version>
31+
<author>xwiki:XWiki.Admin</author>
32+
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
33+
<version>1.1</version>
1734
<title>Code</title>
18-
<comment>Update document after refactoring.</comment>
19-
<minorEdit>true</minorEdit>
35+
<comment/>
36+
<minorEdit>false</minorEdit>
2037
<syntaxId>xwiki/2.1</syntaxId>
21-
<hidden>false</hidden>
38+
<hidden>true</hidden>
2239
<content/>
2340
<object>
2441
<name>InteractiveLinkVisualizer.Code</name>
@@ -134,7 +151,7 @@
134151
});
135152
const edges = [];
136153
tempData.forEach(function(obj) {
137-
if (obj.links &amp;&amp; obj.links.length > 0) {
154+
if (obj.links &amp;&amp; obj.links.length &gt; 0) {
138155
obj.links.forEach(function(link) {
139156
var target = link.replace(/^entity:/, '');
140157
var isValid = tempData.some(function(item) {
@@ -530,7 +547,7 @@ input.button, .buttonwrapper button, .buttonwrapper a {
530547
<async_enabled>0</async_enabled>
531548
</property>
532549
<property>
533-
<content></content>
550+
<content/>
534551
</property>
535552
<property>
536553
<extensionPointId>org.xwiki.platform.panels.Applications</extensionPointId>
@@ -675,7 +692,7 @@ icon=icon:world</parameters>
675692
<async_enabled>0</async_enabled>
676693
</property>
677694
<property>
678-
<content></content>
695+
<content/>
679696
</property>
680697
<property>
681698
<extensionPointId>org.xwiki.platform.requirejs.module</extensionPointId>
@@ -692,4 +709,4 @@ path=$services.webjars.url('org.xwiki.contrib:application-interactive-link-visua
692709
<scope>wiki</scope>
693710
</property>
694711
</object>
695-
</xwikidoc>
712+
</xwikidoc>

application-interactive-link-visualizer-ui/src/main/resources/InteractiveLinkVisualizer/LinkVisualizerPanel.xml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1-
<?xml version='1.1' encoding='UTF-8'?>
1+
<?xml version="1.1" encoding="UTF-8"?>
2+
3+
<!--
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
-->
22+
223
<xwikidoc version="1.5" reference="InteractiveLinkVisualizer.LinkVisualizerPanel" locale="">
324
<web>InteractiveLinkVisualizer</web>
425
<name>LinkVisualizerPanel</name>
526
<language/>
6-
<defaultLanguage>en</defaultLanguage>
27+
<defaultLanguage/>
728
<translation>0</translation>
8-
<creator>XWiki.Admin</creator>
9-
<creationDate>1689193878000</creationDate>
29+
<creator>xwiki:XWiki.Admin</creator>
1030
<parent>WebHome</parent>
11-
<author>XWiki.Admin</author>
12-
<originalMetadataAuthor>XWiki.Admin</originalMetadataAuthor>
13-
<contentAuthor>XWiki.Admin</contentAuthor>
14-
<date>1691042415000</date>
15-
<contentUpdateDate>1691041061000</contentUpdateDate>
16-
<version>164.3</version>
31+
<author>xwiki:XWiki.Admin</author>
32+
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
33+
<version>1.1</version>
1734
<title>LinkVisualizerPanel</title>
18-
<comment>Update document after refactoring.</comment>
19-
<minorEdit>true</minorEdit>
35+
<comment/>
36+
<minorEdit>false</minorEdit>
2037
<syntaxId>xwiki/2.1</syntaxId>
2138
<hidden>true</hidden>
2239
<content/>
@@ -167,8 +184,8 @@
167184
style=
168185
"width: 100%;
169186
height: 350px;
170-
">
171-
&lt;/div>
187+
"&gt;
188+
&lt;/div&gt;
172189
{{/html}}
173190
#panelfooter()
174191
{{/velocity}}
@@ -314,7 +331,7 @@ height: 350px;
314331
if (firstResult.length == 1) {
315332
let extraDocuments = "";
316333
if (firstResult[0].links) {
317-
extraDocuments = ' OR ' + firstResult[0].links.map(link => 'reference:' + escapeQueryChars(link.replace(/^entity:/, ''))).join(' OR ');
334+
extraDocuments = ' OR ' + firstResult[0].links.map(link =&gt; 'reference:' + escapeQueryChars(link.replace(/^entity:/, ''))).join(' OR ');
318335
}
319336
$.post(solrServiceURL, {
320337
outputSyntax: 'plain',
@@ -342,7 +359,7 @@ height: 350px;
342359

343360
const edges = [];
344361
tempData.forEach(function(obj) {
345-
if (obj.links &amp;&amp; obj.links.length > 0) {
362+
if (obj.links &amp;&amp; obj.links.length &gt; 0) {
346363
obj.links.forEach(function(link) {
347364
var target = link.replace(/^entity:/, '');
348365
var isValid = tempData.some(function(item) {
@@ -379,4 +396,4 @@ height: 350px;
379396
<use>currentPage</use>
380397
</property>
381398
</object>
382-
</xwikidoc>
399+
</xwikidoc>

application-interactive-link-visualizer-ui/src/main/resources/InteractiveLinkVisualizer/WebHome.xml

Lines changed: 72 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,105 @@
1-
<?xml version='1.1' encoding='UTF-8'?>
1+
<?xml version="1.1" encoding="UTF-8"?>
2+
3+
<!--
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
-->
22+
223
<xwikidoc version="1.5" reference="InteractiveLinkVisualizer.WebHome" locale="">
324
<web>InteractiveLinkVisualizer</web>
425
<name>WebHome</name>
526
<language/>
6-
<defaultLanguage>en</defaultLanguage>
27+
<defaultLanguage/>
728
<translation>0</translation>
8-
<creator>XWiki.Admin</creator>
9-
<creationDate>1691042382000</creationDate>
29+
<creator>xwiki:XWiki.Admin</creator>
1030
<parent>Main.WebHome</parent>
11-
<author>XWiki.Admin</author>
12-
<originalMetadataAuthor>XWiki.Admin</originalMetadataAuthor>
13-
<contentAuthor>XWiki.Admin</contentAuthor>
14-
<date>1691042441000</date>
15-
<contentUpdateDate>1691042441000</contentUpdateDate>
16-
<version>2.1</version>
31+
<author>xwiki:XWiki.Admin</author>
32+
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
33+
<version>1.1</version>
1734
<title>Interactive Link Visualizer</title>
1835
<comment/>
1936
<minorEdit>false</minorEdit>
2037
<syntaxId>xwiki/2.1</syntaxId>
21-
<hidden>false</hidden>
38+
<hidden>true</hidden>
2239
<content>{{velocity output="false"}}#set ($discard = $xwiki.jsx.use('InteractiveLinkVisualizer.Code'))#set ($discard = $xwiki.ssx.use('InteractiveLinkVisualizer.Code'))#set($solrConfig = {'filterQuery': ['type:DOCUMENT'], 'facetFields': ['property.XWiki.TagClass.tags_string', 'wiki', 'space_facet', 'locale', 'author', 'creator', 'date', 'creationdate', 'class', 'mimetype', 'attauthor', 'attdate', 'attsize'], 'facetEnabled': false}){{/velocity}}{{include reference="Main.SolrSearchConfig" /}}{{include reference="Main.SolrSearchMacros" /}}{{velocity}}#macro (displaySearchResults){{html}}
23-
&lt;div id="sigma-container" data-results="$escapetool.xml($jsontool.serialize($searchResponse.results))">
24-
&lt;div id="top-bar">
25-
&lt;div id="search">
26-
&lt;i class="fa fa-search">&lt;/i>
40+
&lt;div id="sigma-container" data-results="$escapetool.xml($jsontool.serialize($searchResponse.results))"&gt;
41+
&lt;div id="top-bar"&gt;
42+
&lt;div id="search"&gt;
43+
&lt;i class="fa fa-search"&gt;&lt;/i&gt;
2744
&lt;input
2845
type="search"
2946
id="search-input"
3047
list="suggestions"
3148
placeholder="Find pages in graph…"
32-
/>&lt;datalist id="suggestions">&lt;/datalist>
33-
&lt;/div>
34-
&lt;div id="graph-info">
35-
&lt;span id="node-count">&lt;/span>
36-
&lt;span id="edge-count">&lt;/span>
37-
&lt;/div>
38-
&lt;/div>
39-
&lt;div class="buttonwrapper" id="graph-buttons">
40-
&lt;button class="icon-button" id="zoom-in">+&lt;/button>
41-
&lt;button class="icon-button" id="zoom-out">-&lt;/button>
42-
&lt;button class="icon-button" id="zoom-reset">&lt;/button>
43-
&lt;button class="icon-button" id="view-fullscreen">&lt;/button>
44-
&lt;/div>
45-
&lt;/div>
49+
/&gt;&lt;datalist id="suggestions"&gt;&lt;/datalist&gt;
50+
&lt;/div&gt;
51+
&lt;div id="graph-info"&gt;
52+
&lt;span id="node-count"&gt;&lt;/span&gt;
53+
&lt;span id="edge-count"&gt;&lt;/span&gt;
54+
&lt;/div&gt;
55+
&lt;/div&gt;
56+
&lt;div class="buttonwrapper" id="graph-buttons"&gt;
57+
&lt;button class="icon-button" id="zoom-in"&gt;+&lt;/button&gt;
58+
&lt;button class="icon-button" id="zoom-out"&gt;-&lt;/button&gt;
59+
&lt;button class="icon-button" id="zoom-reset"&gt;&lt;/button&gt;
60+
&lt;button class="icon-button" id="view-fullscreen"&gt;&lt;/button&gt;
61+
&lt;/div&gt;
62+
&lt;/div&gt;
4663
{{/html}}#end##
4764
#macro(setHighlightQuery $query)
4865
#set ($discard = $query.bindValue('fl', 'title_, reference, links, wiki, spaces, name'))
4966
#end##
5067
#macro (displaySearchForm)
5168
#set($void = $services.progress.startStep('#displaySearchForm'))
5269
{{html clean="false"}}
53-
&lt;form class="search-form row" action="$doc.getURL()" role="search">
54-
&lt;div class="hidden">
55-
&lt;input type="hidden" name="sort" value="$!escapetool.xml($sort)"/>
56-
&lt;input type="hidden" name="sortOrder" value="$!escapetool.xml($sortOrder)"/>
57-
&lt;input type="hidden" name="highlight" value="$highlightEnabled"/>
58-
&lt;input type="hidden" name="facet" value="$facetEnabled"/>
70+
&lt;form class="search-form row" action="$doc.getURL()" role="search"&gt;
71+
&lt;div class="hidden"&gt;
72+
&lt;input type="hidden" name="sort" value="$!escapetool.xml($sort)"/&gt;
73+
&lt;input type="hidden" name="sortOrder" value="$!escapetool.xml($sortOrder)"/&gt;
74+
&lt;input type="hidden" name="highlight" value="$highlightEnabled"/&gt;
75+
&lt;input type="hidden" name="facet" value="$facetEnabled"/&gt;
5976
## The parameter used to determine if the request has been redirected with default search filters.
60-
&lt;input type="hidden" name="r" value="$!escapetool.xml($request.r)"/>
77+
&lt;input type="hidden" name="r" value="$!escapetool.xml($request.r)"/&gt;
6178
#if ("$!request.debug" != '')
62-
&lt;input type="hidden" name="debug" value="$escapetool.xml($request.debug)"/>
79+
&lt;input type="hidden" name="debug" value="$escapetool.xml($request.debug)"/&gt;
6380
#end
6481
## Preserve the current facet values when submitting a new search query.
6582
#foreach ($entry in $request.parameterMap.entrySet())
6683
#if ($entry.key.startsWith('f_') || $entry.key.startsWith('l_'))
6784
#foreach ($value in $entry.value)
68-
&lt;input type="hidden" name="$escapetool.xml($entry.key)" value="$escapetool.xml($value)"/>
85+
&lt;input type="hidden" name="$escapetool.xml($entry.key)" value="$escapetool.xml($value)"/&gt;
6986
#end
7087
#end
7188
#end
72-
&lt;/div>
73-
&lt;div class="col-xs-12 col-sm-6">
74-
&lt;div class="input-group">
89+
&lt;/div&gt;
90+
&lt;div class="col-xs-12 col-sm-6"&gt;
91+
&lt;div class="input-group"&gt;
7592
&lt;input type="search" name="text" class="form-control withTip useTitleAsTip"
76-
title="$services.localization.render('search.page.bar.query.title')" value="$escapetool.xml($text)"/>
77-
&lt;span class="input-group-btn">
78-
&lt;button type="submit" class="btn btn-primary">
93+
title="$services.localization.render('search.page.bar.query.title')" value="$escapetool.xml($text)"/&gt;
94+
&lt;span class="input-group-btn"&gt;
95+
&lt;button type="submit" class="btn btn-primary"&gt;
7996
$services.icon.renderHTML('search')
80-
&lt;span class="sr-only">$services.localization.render('search.page.bar.submit')&lt;/span>
81-
&lt;/button>
82-
&lt;/span>
83-
&lt;/div>
84-
&lt;/div>
85-
&lt;/form>
97+
&lt;span class="sr-only"&gt;$services.localization.render('search.page.bar.submit')&lt;/span&gt;
98+
&lt;/button&gt;
99+
&lt;/span&gt;
100+
&lt;/div&gt;
101+
&lt;/div&gt;
102+
&lt;/form&gt;
86103
{{/html}}
87104
#set($void = $services.progress.endStep())
88105
#end##
@@ -98,9 +115,9 @@
98115
#if ($xcontext.action == 'get')
99116
{{html clean="false"}}
100117
## The search UI is updated dynamically through AJAX and we need to pull the skin extensions.
101-
## We put the skin extension imports inside a &lt;noscript> element to prevent jQuery from fetching the JavaScript
118+
## We put the skin extension imports inside a &lt;noscript&gt; element to prevent jQuery from fetching the JavaScript
102119
## files automatically (we want to fetch only the new JavaScript files).
103-
&lt;noscript class="hidden skin-extension-imports">#skinExtensionHooks&lt;/noscript>
120+
&lt;noscript class="hidden skin-extension-imports"&gt;#skinExtensionHooks&lt;/noscript&gt;
104121
{{/html}}
105122

106123
#end
@@ -212,7 +229,7 @@
212229
(% class="search-options" %)
213230
* {{translation key="solr.options"/}}
214231
#if($facetEnabled)#extendQueryString($url {'facet': [false]})#else#extendQueryString($url {'facet': [true]})#end
215-
* [[{{translation key="solr.options.facet"/}}>>path:${url}||class="options-item#if($facetEnabled) active#end" title="$services.localization.render('solr.options.facet.title')"]]
232+
* [[{{translation key="solr.options.facet"/}}&gt;&gt;path:${url}||class="options-item#if($facetEnabled) active#end" title="$services.localization.render('solr.options.facet.title')"]]
216233

217234
(% class="search-results-sort" %)
218235
* {{translation key="solr.sortBy"/}}
@@ -227,9 +244,9 @@
227244
#set ($targetSortOrder = "#if ($sortOrder == 'asc')desc#{else}asc#end")
228245
#end
229246
#extendQueryString($url {'sort': [$entry.key], 'sortOrder': [$targetSortOrder]})
230-
* [[{{translation key="solr.sortBy.$entry.key"/}}$!sortOrderIndicator>>path:${url}||class="$class"]]
247+
* [[{{translation key="solr.sortBy.$entry.key"/}}$!sortOrderIndicator&gt;&gt;path:${url}||class="$class"]]
231248
#end
232249
#end
233250
#handleSolrSearchRequest
234251
{{/velocity}}</content>
235-
</xwikidoc>
252+
</xwikidoc>

0 commit comments

Comments
 (0)