Show last authors
1 {{include reference="ReleaseNotes.Code.EntryVelocityMacros"/}}
2
3 {{velocity}}
4 #set ($topSpace = $doc.documentReference.extractFirstReference('SPACE').getName())
5 $!xwiki.jsx.use("${topSpace}.Code.HomeReleaseNotes")
6 #if ($hasEdit)
7 #set ($configDoc = $xwiki.getDocument("${topSpace}.Code.ReleaseNotesConfig"))
8 #set ($defaultProduct = $configDoc.getValue('product'))
9 #set ($defaultTemplateReferenceString = $configDoc.getValue('template'))
10 #if ($request.action == 'addReleaseNotes')
11 #set ($product = $!request.product)
12 #set ($version = $!request.version)
13 #getShortVersion($version $shortVersion)
14 ## Create page if it doesn't exist
15 #set ($rnPageReference = $services.model.createDocumentReference('', ["$topSpace", 'Data', $product, $shortVersion], 'WebHome'))
16 #set ($rnDoc = $xwiki.getDocument($rnPageReference))
17 #if ($rnDoc.isNew())
18 #set ($rnObject = $rnDoc.newObject("${topSpace}.Code.ReleaseNoteClass"))
19 #set ($discard = $rnObject.set('product', $product))
20 #set ($discard = $rnObject.set('version', $version))
21 #set ($discard = $rnObject.set('released', '0'))
22 ## We set an empty release date so that the LiveTable can see entries. For some reasons, otherwise, it won't
23 ## display entries that have no date set (this is related to the fact that we're sorting the LT by dates).
24 #set ($discard = $rnObject.set('date', ''))
25 ## Copy the template content + title
26 #set ($templateDoc = $xwiki.getDocument($defaultTemplateReferenceString))
27 ## Replace the following template variables in the template content and title by the product value.
28 ## We do that here instead of using Velocity in the template content/title so that the generated RN page renders
29 ## as fast as possible. We also use a template variavle format different than the velocity syntax so that the
30 ## template page can use Velocity and any variable it wishes without a risk of clash.
31 ## - "!!product!!" --> $product
32 ## - "!!version!!" --> $version
33 #set ($newContent = $stringtool.replaceEach($templateDoc.content, ['!!product!!', '!!version!!'], [$product, $version]))
34 #set ($discard = $rnDoc.setContent($newContent))
35 #set ($newTitle = $stringtool.replaceEach($templateDoc.title, ['!!product!!', '!!version!!'], [$product, $version]))
36 #set ($discard = $rnDoc.setTitle($newTitle))
37 #set ($discard = $rnDoc.save('New Release note'))
38 ## Redirect in edit mode to edit the RN
39 $response.sendRedirect($xwiki.getURL($services.model.serialize($rnPageReference)))
40 #else
41
42 {{error}}That release notes already exists!{{/error}}
43
44 #end
45 #end
46 {{html}}
47 <form>
48 <input type="hidden" name="action" value="addReleaseNotes"/>
49 <input id="product" type="text" name="product" value="$defaultProduct" size="32"/>
50 <input id="version" type="text" name="version" value="Version e.g. 8.3-milestone-1..." size="32" class="withTip"/>
51 <span class="buttonwrapper">
52 <input class="button" type="submit" value="Add Release Note"/>
53 </span>
54 </form>
55 {{/html}}
56 #end
57 {{/velocity}}
58
59 {{velocity}}
60 #set($columns = ['product', 'version', 'released', 'date'])
61 #set($columnsProperties = {
62 'product' : { 'type' : 'text' },
63 'version' : { 'type' : 'text', 'link' : true },
64 'released' : { 'type' : 'boolean' },
65 'date' : { 'type' : 'date' }
66 })
67 #set($options = {
68 'className' : "${topSpace}.Code.ReleaseNoteClass",
69 'selectedColumn' : 'date',
70 'defaultOrder' : 'desc',
71 'translationPrefix' : 'releasenotes.releases.livetable.',
72 'rowCount' : 15
73 })
74 #livetable('releasenotes' $columns $columnsProperties $options)
75 {{/velocity}}

Get Connected