Show last authors
1 {{velocity}}
2 #if("$!request.newsletter" != '')
3 ## create newsletter instance pages based on the model used by the newsletter
4 #set($newsletterDoc = $xwiki.getDocument($!request.newsletter))
5 ## get the template for the newsletter
6 #set($instanceName = $xwiki.getUniquePageName("LettreInformationInstances", $newsletterDoc.name))
7 #set($instanceDoc = $xwiki.getDocument("LettreInformationInstances.${instanceName}"))
8 #set($modelName = $escapetool.url($newsletterDoc.getObject('Code.NewsletterClass').getProperty('model').value))
9 ## generate the newsletter number used on the title
10 #set($newsletterID = $xwiki.countDocuments(", BaseObject obj where obj.name=doc.fullName and obj.className='Code.NewsletterInstanceClass' and doc.parent='$!request.newsletter'") + 1)
11 #set($newsletterTitle = $escapetool.url($msg.get('newsletter.instanceTitle', [$newsletterDoc.getDisplayTitle(), $!{newsletterID}])))
12 #if("$!modelName" != "")
13 #set($frequency = $escapetool.url($newsletterDoc.getObject('Code.NewsletterClass').getProperty('frequency').value))
14 #set($newsletterTemplate = $escapetool.url(${newsletterDoc.fullName}))
15 $response.sendRedirect($xwiki.getURL("LettreInformationInstances.${instanceName}", 'inline',
16 "template=$!{modelName}&Code.NewsletterClass_0_frequency=$!frequency&parent=$!newsletterTemplate&title=$!newsletterTitle"))
17 #else
18 $response.sendRedirect($xwiki.getURL($!request.newsletter, 'view', 'error=modelmissing'))
19 #end
20 #end
21 {{/velocity}}

Get Connected