Masquer les derniers auteurs
Quentin / Zèbre STURER 1.1 1 {{groovy}}
2 def attachments = doc
3 def fullNameEscaped = doc.fullName.replaceAll("/","__")
4 def targetDir = "webapps/ROOT/resources/pictureExports/" + fullNameEscaped
5 def hadNovelty = false
6 for(att in doc.attachmentList) {
7 def targetFile = new File(targetDir + "/src/" + att.filename)
8 if(!targetFile.isFile() || targetFile.lastModified()+100 < att.date.time) {
9 hadNovelty = true
10 println("* exporting " + att.filename)
11 def input = att.getContentInputStream()
12 org.apache.commons.io.FileUtils.copyToFile(input, targetFile)
13 }
14 }
15 if(hadNovelty) {
16 println("Would be running thumbsup.")
17 } else {
18 println("\n\n{{html}}<iframe src='/resources/pictureExports/"+fullNameEscaped+"/out/index.html?version=${doc.version}' frameborder='0' style='width:80vw; height:80vw'>I need frames</iframe>")
19 }
20
21 {{/groovy}}
This wiki is licensed under a Creative Commons 2.0 license
XWiki 13.10 - Documentation - Conditions