key Log In or Register to edit

Batch Upload Plugin

This plugin intercepts the TWiki:Codev.BeforeAttachmentSaveHandler to process a zip file, attaching each of the individual files to the designated topic instead of the zip file.

Syntax Rules

  • None - it applies as long as it is enabled. (Off by default)

Examples

  • N/A

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, e.g., %BATCHUPLOADPLUGIN_SHORTDESCRIPTION%

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

  • If disabled, does nothing.
    • Set ENABLED = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip BatchUploadPlugin.zip in your twiki installation directory. Content:
    File: Description:
%$MANIFEST%
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • Flip ENABLED switch to 1
  • Test if the installation was successful:
    • try uploading a zip file

Caveats

    • Required support (add an attachment) not in TWiki::Func, so I call TWiki::UI::Upload
    • UPLOADZIPLIMIT, UPLOADNOSPACES, UPLOADLOWERCASE features deleted - belong in upload
    • PNG support deleted (should be in TWiki::UI::Upload)
    • No longer uses oops templates (plugins can't use them)
    • Dies instead of finishes, because otherwise it can't veto zip attach
    • Doesn't carry through the hide or link flags
    • Comment field on extracted files is not customisable

Further Development

    • Put back deleted functionality.
    • TWiki:Codev.BeforeAttachmentSaveHandler needs veto capability
    • Ugly die needs replacing
    • Test what happens if you upload zips of zips
    • There is a method - currently called findTopicForPicture which is disabled by default - this can be used to change the destination topic for each archive element. We need a TWiki:Codev.ExtensionInteractionPoint to allow plugins to have their functionality overridden.

Plugin Info

Plugin Author: TWiki:Main.MartinCleaver
Plugin Version: 31 Oct 2004 (V1.000)
Change History:  
31 Oct 2004 TWiki:Main.MartinCleaver - initial version as plugin
09 Apr 2004 TWiki:Main.DiabJerius
17 Nov 2003 TWiki:Main.JohannesMartin
20 Mar 2003 TWiki:Main.RonKellam
16 Aug 2002 TWiki:Main.ThomasWeigert
14 Jan 2002 TWiki:Main.RyanFreebern
30 Oct 2001 TWiki:Main.VitoMiliano
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: CPAN:Archive::Zip
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: Good Style nn%, Formatted Search nn%, Batch Upload Plugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/BatchUploadPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/BatchUploadPluginDev

Related Topics: T Wiki Preferences, T Wiki Plugins

-- TWiki:Main/MartinCleaver - 31 Oct 2004

 
Ad Sponsor
Back to Redbourn
Copyright © We make no guarantee of the correctness of the content of this site. All material on this collaboration platform is the property of Martin Cleaver and the contributing authors.