cog
TypePlugin
Category
Developed byUnknown
Rating
0 Votes
LicenseUnknown

Description

A plugin that intercepts XWiki download requests so that it's possible to display contents found inside attached ZIP files.

Installation

Activate the plugin by editing your WEB-INF/xwiki.cfg file as follows and restart your XWiki instance:

xwiki.plugins=[...],com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin

To use the plugin in your wiki, you'll need to write some Velocity code to integrate it where you want to use it, as shown below.

Example

The following example lists the files in an attached zip file containing freely distributable images. The file names may be viewed by clicking on them.

1.1.1 Content Of Attached Zip File

#set($attachment="open_collection-0.0.zip")
#set($zipexplorer=$xwiki.zipexplorer)
#foreach($file in $zipexplorer.getFileTreeList($doc, $attachment))
- <a href="$zipexplorer.getFileLink($doc, $attachment, $file.id)">$file.id</a>
#end

Result

Contents Of Attached Zip File

Failed to execute the [velocity] macro. Cause: [Nested scripts are not allowed. Current Script Macro [velocity] (source [extensions:ExtensionCode.ExtensionSheet]) is executed inside Script Macro [velocity] (source [extensions:ExtensionCode.ExtensionSheet])]. Click on this message for details.
{{/velocity}}

Tags:
    

Get Connected