From version < 14.1 >
edited by Guillaume Delhumeau
on 2015/12/15
To version < 15.1 >
edited by Vincent Massol
on 2015/12/15
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.gdelhumeau
1 +XWiki.VincentMassol
Content
... ... @@ -51,6 +51,33 @@
51 51  * [[guava 19>>http://jira.xwiki.org/browse/XCOMMONS-894]]
52 52  * [[Less4j 1.15.4>>http://jira.xwiki.org/browse/XWIKI-12905]]
53 53  
54 +== VFS API ==
55 +
56 +Replacement of the [[Zip Explorer Plugin>>Extension.ZIP Explorer Plugin]]. API to access the content of archives files (zip, jar, gzip, tar, etc) located as attachments in wiki pages or elsewhere (external URLs, file system, et).
57 +
58 +Some examples. See [[VFS API>>extensions:Extension.VFS API]] and [[VFS Tree Macro>>extensions:Extension.VFS Tree Macro]] for more details:
59 +
60 +{{code language="velocity"}}
61 +{{velocity}}
62 +## Get the URL to access the content of a file inside a zip:
63 +[[link to file in zip>>$services.vfs.url("attach:Sandbox.WebHome@vma.txt.zip/vma.txt")]]
64 +
65 +## Display inline an image from a zip attached to a wiki page:
66 +[[image:path:$services.vfs.url("attach:Sandbox.WebHome@test.zip/test.png")]]
67 +
68 +## Read the content of a file inside a zip attached to a page:
69 +$stringtool.toString($niotool.readAllBytes("attach:Sandbox.WebHome@vma.txt.zip/vma.txt"), "utf-8")
70 +
71 +## List all entries inside a zip attached to a page:
72 +#set ($dirStream = $niotool.newDirectoryStream("attach:Sandbox.WebHome@vma.txt.zip/"))
73 +#foreach ($entry in $dirStream)
74 + * {{{$entry}}} - $niotool.isDirectory($entry)
75 +#end
76 +{{/velocity}}
77 +
78 +{{vfsTree root="attach:Sandbox.WebHome@vma.txt.zip/"/}}
79 +{{/code}}
80 +
54 54  == Miscellaneous ==
55 55  
56 56  * [[WebJars URL format>>extensions:Extension.WebJars Integration||anchor="HURLFormat"]] now supports a ##wiki## query string parameter to specify the wiki in which the webjars resource is available. For example: {{code language="none"}}/xwiki/webjars/AjaxQ/0.0.2/ajaxq.js?wiki=mywiki{{/code}}

Get Connected