Changes for page HomeReleaseNotes

Last modified by Vincent Massol on 2021/04/08

<
From version < 4.1
edited by Vincent Massol
on 2021/04/08
To version < 3.1 >
edited by Vincent Massol
on 2021/04/08
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -24,8 +24,16 @@
24 24   #set ($discard = $rnObject.set('date', ''))
25 25   ## Copy the template content + title
26 26   #set ($templateDoc = $xwiki.getDocument($defaultTemplateReferenceString))
27 - #set ($discard = $rnDoc.setContent($templateDoc.content))
28 - #set ($discard = $rnDoc.setTitle($templateDoc.title))
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))
29 29   #set ($discard = $rnDoc.save('New Release note'))
30 30   ## Redirect in edit mode to edit the RN
31 31   $response.sendRedirect($xwiki.getURL($services.model.serialize($rnPageReference)))

Get Connected