<
From version < 2.1 >
edited by Vincent Massol
on 2016/09/30
To version < 3.1 >
edited by Vincent Massol
on 2016/10/01
>
Change comment: Imported from XAR

Summary

Details

Page properties
Content
... ... @@ -1,38 +1,25 @@
1 1  = Generate Report =
2 2  
3 +Notes:
4 +* Lists are allowed by using commas (e.g. "High,Medium")
5 +* Wildcards are allowed (e.g. "8.3%")
6 +
3 3  {{include reference="ReleaseNotes.Code.HomeGenerateReleaseNotes"/}}
4 4  
5 5  = Existing Changes =
6 6  
11 +{{include reference="ReleaseNotes.Code.ChangesVelocityMacros"/}}
12 +
7 7  {{velocity}}
8 - #set ($productName = $request.product)
9 - #if ("$!productName" == '')
10 - #set ($productName = "XWiki")
14 + #set ($topSpace = $doc.documentReference.extractFirstReference('SPACE').getName())
15 + #set ($product = $request.product)
16 + #if ("$!product" == '')
17 + #set ($configDoc = $xwiki.getDocument("${topSpace}.Code.ReleaseNotesConfig"))
18 + #set ($product = $configDoc.getValue('product'))
11 11   #end
12 12   ## Add new change
13 13   #if ($request.action == 'add')
14 - #if ("$!request.version" == '')
15 - {{error}}Version must be set for creating a new Release Note change!{{/error}}
16 -
17 - #else
18 - ## Compute automatically a new page name, using the format "Change###" where ### is a zero-padded number.
19 - #set ($shortVersion = $stringtool.replaceChars($request.version, "-", ""))
20 - #set ($shortVersion = $stringtool.upperCase($shortVersion))
21 - #set ($shortVersion = $shortVersion.replace('MILESTONE', 'M'))
22 - #set ($versionSpaceReference = $services.model.createDocumentReference('', ["$topSpace", 'Data', "$productName", "$shortVersion"], 'WebHome').parent)
23 - #set ($versionSpaceReferenceString = $services.model.serialize($versionSpaceReference))
24 - ## Make sure we have existing entries, otherwise start at 1
25 - #set ($query = $services.query.xwql("from doc.object(${topSpace}.Code.ChangesClass) as changes where doc.space like :space").bindValue('space', "${versionSpaceReferenceString}%"))
26 - #if ($query.count() > 0)
27 - #set ($highest = $services.query.xwql("from doc.object(${topSpace}.Code.ChangesClass) as changes where doc.space like '${versionSpaceReferenceString}%' order by doc.space desc").setLimit(1).execute())
28 - #set ($currentNumber = $numbertool.toNumber($services.model.resolveDocument($highest[0]).parent.name.substring(6)).intValue())
29 - #set ($nextUniqueNumber = $numbertool.format('000', $mathtool.add($currentNumber, 1)))
30 - #else
31 - #set ($nextUniqueNumber = '001')
32 - #end
33 - #set ($versionPageReference = "${versionSpaceReferenceString}.Change${nextUniqueNumber}.WebHome")
34 - $response.sendRedirect($xwiki.getURL($versionPageReference.toString(), 'inline', "$!{request.queryString}&shortVersion=${escapetool.url($shortVersion)}"))
35 - #end
22 + #handleAddAction($product, $!request.version, $!request.queryString)
36 36   #end
37 37  {{html clean='false'}}
38 38  <form>

Get Connected