Wiki source code of Download Version
Last modified by Vincent Massol on 2024/04/02
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
4.16 | 1 | {{velocity}} |
![]() |
4.14 | 2 | ## |
3 | ## Determine the data page to include. | ||
4 | ## Note: Using a separate velocity block and at the top so that we may use the include wiki macro. | ||
5 | ## | ||
![]() |
4.8 | 6 | #set ($projectVersion = $request.get('projectVersion')) |
7 | #if ("$!projectVersion" != '') | ||
![]() |
5.1 | 8 | #set ($versionPart = $stringtool.substringBefore($projectVersion, '-')) |
9 | #set ($version = $stringtool.split($versionPart, '.')) | ||
![]() |
4.8 | 10 | #set ($majorVersion = $numbertool.toNumber($version[0])) |
![]() |
5.1 | 11 | #set ($minorVersion = $numbertool.toNumber($version[1])) |
![]() |
5.14 | 12 | #if ($version.size() == 3) |
13 | #set ($bugfixVersion = $numbertool.toNumber($version[2])) | ||
14 | #end | ||
![]() |
5.2 | 15 | ## Read the version's artefacts and file names from the dedicated page. |
16 | #set ($versionDataPage = '.Latest.WebHome') | ||
17 | ## Dedicated pages exist for older versions with different contents and file names. | ||
![]() |
5.8 | 18 | #if ($majorVersion < 9 || ($majorVersion == 9 && $minorVersion < 5)) |
![]() |
5.10 | 19 | ## < 9.5 |
![]() |
4.8 | 20 | #set ($versionDataPage = '.Before9\.5.WebHome') |
![]() |
5.11 | 21 | #elseif (($majorVersion == 9 && ($minorVersion < 11 || ($minorVersion == 11 && $bugfixVersion < 6))) || ($majorVersion == 10 && $minorVersion < 5)) |
![]() |
5.10 | 22 | ## > 9.5 and < 10.5, but > 9.11.6+ (i.e. except 9.11.x starting from 9.11.6) |
![]() |
5.2 | 23 | #set ($versionDataPage = '.Before10\.5.WebHome') |
![]() |
4.8 | 24 | #end |
25 | {{include reference="$versionDataPage" /}} | ||
26 | #end | ||
![]() |
4.18 | 27 | {{/velocity}}{{velocity}} |
![]() |
1.1 | 28 | ## ################################################################ |
![]() |
5.2 | 29 | ## Generate the URL to XWiki files that will be used by the Download.DownloadForm page |
![]() |
1.1 | 30 | ## ################################################################ |
31 | #macro(downloadurl $link $version) | ||
32 | #set ($downloadLinkData = $downloadLinks.get($link)) | ||
33 | #if ($downloadLinkData) | ||
34 | #if ($downloadLinkData.containsKey($version)) | ||
35 | ## The artifact to be downloaded depends on the version. | ||
36 | ## This happens for instance when we rename an artifact. | ||
37 | #set ($downloadLinkData = $downloadLinkData.get($version)) | ||
38 | #end | ||
![]() |
5.2 | 39 | #set ($downloadLinkPath = "#getDownloadLinkPath($downloadLinkData, $version)") |
![]() |
1.1 | 40 | #set ($version = $escapetool.xml($version)) |
![]() |
5.2 | 41 | ## Last $downloadLinkData element always contains the link button class. |
42 | #set ($linkBtnClass = "${downloadLinkData.get($mathtool.sub($downloadLinkData.size(), 1))}") | ||
43 | [[Download>>Download.DownloadForm||queryString="downloadURL=${downloadLinkBase}${downloadLinkPath}&projectVersion=${version}" class="btn btn-xs btn-$linkBtnClass"]] | ||
![]() |
1.1 | 44 | #end |
45 | #end | ||
46 | ## ################################################################ | ||
47 | ## $categories = Name (0) - Distributions (1) - Color (2) - Description (3) | ||
48 | ## ################################################################ | ||
![]() |
4.8 | 49 | #set ($categories = [ |
![]() |
4.4 | 50 | ['Demo Installation', $demoDistibutions, 'green', |
51 | "These Demo packages are not supposed to be used in production, since the embedded database does not support large wikis efficiently and is not tuned for a production usage."], | ||
52 | ['Production Installation', $productionDistibutions, 'blue', | ||
53 | "Once you're more familiar with XWiki you might want to set it up on your own database or in your own container, in which case you'll then be able to download the WAR file and set up your instance."] | ||
![]() |
4.8 | 54 | ]) |
![]() |
4.4 | 55 | ## ################################################################ |
56 | ## Request Handler | ||
57 | ## ################################################################ | ||
![]() |
1.1 | 58 | #set ($projectVersion = $request.get('projectVersion')) |
59 | #if ("$!projectVersion" != '') | ||
![]() |
4.4 | 60 | $xwiki.ssx.use("Download.WebHome") |
![]() |
4.14 | 61 | {{html wiki='true' clean='false'}} |
![]() |
1.1 | 62 | <div class='download-options download-installation'> |
63 | #foreach($category in $categories) | ||
64 | <div class='col-xs-12 download-container download-option border-$category.get(2)'> | ||
65 | <h3>$category.get(0)</h3> | ||
66 | <div class='list-group'> | ||
67 | #foreach($distibution in ${category.get(1)}) | ||
68 | <div class='list-group-item'> | ||
![]() |
2.1 | 69 | <span class='badge fill-gray'>$distibution.get(2)</span> |
![]() |
1.1 | 70 | <h4 class='list-group-item-heading'>$distibution.get(1)</h4> |
71 | <p class='list-group-item-text noitems'>$distibution.get(3)</p> | ||
72 | <div class='buttons'> | ||
![]() |
5.15 | 73 | #downloadurl($distibution.get(0), $projectVersion) |
![]() |
4.20 | 74 | #if ($stringtool.isNotBlank($distibution.get(4))) |
![]() |
4.19 | 75 | (% class='btn btn-xs btn-link' %)[[Installation Notes>>$distibution.get(4)]](%%) |
76 | #end | ||
![]() |
5.19 | 77 | #if ($distibution.size() > 5 && $stringtool.isNotBlank($distibution.get(5))) |
![]() |
5.17 | 78 | (% class='btn btn-xs btn-link' %)[[Upgrade Notes>>$distibution.get(5)]](%%) |
79 | #end | ||
![]() |
1.1 | 80 | </div> |
81 | </div> | ||
82 | #end | ||
83 | </div> | ||
84 | <p class='noitems'>$category.get(3)</p> | ||
85 | </div> | ||
86 | #end | ||
87 | </div> | ||
![]() |
4.14 | 88 | {{/html}} |
![]() |
1.1 | 89 | #else |
90 | $response.sendRedirect($xwiki.getURL('Download.WebHome')) | ||
91 | #end | ||
92 | {{/velocity}} | ||
![]() |
4.4 | 93 |