<
Depuis la version < 6.233 >
modifié par Paul Libbrecht (admin)
sur 2016/08/19 20:25
À la version < 9.1 >
modifié par Paul Libbrecht (admin)
sur 2016/08/19 23:02
>
Commentaire de modification : Imported from XAR

Résumé

Détails

Icon Propriétés de la Page
Titre
... ... @@ -1,1 +1,1 @@
1 -DownloadAttachments
1 +Download Attachments
Parent
... ... @@ -1,0 +1,1 @@
1 +Macros.WebHome
Langue par defaut
... ... @@ -1,1 +1,0 @@
1 -fr
Masqué
... ... @@ -1,1 +1,1 @@
1 -false
1 +true
Contenu
... ... @@ -29,12 +29,13 @@
29 29   for(Attachment att in pageDoc.getAttachmentList()) {
30 30   System.err.println("Outputting " + att.filename);
31 31   ZipEntry entry = new ZipEntry(att.filename);
32 + if(uncompressedMimes.contains(att.mimeType))
33 + out.setLevel(0);
34 + else
35 + out.setLevel(9);
32 32   entry.setTime(att.getDate().getTime());
33 33   entry.setSize(att.filesize);
34 - if(uncompressedMimes.contain(att.mimeType))
35 - entry.setMethod(ZipEntry.STORED);
36 - else
37 - entry.setMethod(ZipEntry.DEFLATED);
38 +
38 38   out.putNextEntry(entry);
39 39   IOUtils.copy(att.contentInputStream, out, 5*1024*1024);
40 40   }
... ... @@ -49,7 +49,7 @@
49 49  } else {
50 50   println("""
51 51  = Download Attachments Macro =
52 -Use as ~{~{downloadAttachments/~}~} to see a link to a zip of all attachments.
53 +Use as ((({{downloadAttachments/}}))) so see a list of attachments.
53 53  """);
54 54  }
55 55  
Icon XWiki.WikiMacroClass[0]
Code de la macro
... ... @@ -1,4 +2,4 @@
1 -
2 2  {{velocity}}
3 -{{html clean=false}}<a href="$url">Download page attachments</a>{{/html}}
2 +#set($url=$xwiki.getURL("Macros.DownloadAttachments","view","page=$doc.fullName"))
3 +{{html clean=false}}<a href="$url">{{/html}}{{translation key="rendering.macro.downloadAttachments.label"/}}{{html clean=false}}</a>{{/html}}
4 4  {{/velocity}}
Description de la macro
... ... @@ -1,1 +1,1 @@
1 -Displays a link to a zip archive of all attachments of a page.
1 +Displays a link to download all attachments of a page as a zip archive.
Nom de la macro
... ... @@ -1,1 +1,1 @@
1 -Download Attachments
1 +Download attachments
Visibilité de la macro
... ... @@ -1,1 +1,1 @@
1 -Current User
1 +Global
This wiki is licensed under a Creative Commons 2.0 license
XWiki 13.10 - Documentation - Conditions