You are here: Foswiki>Tasks Web>Item5954 (26 Mar 2009, GeorgeClark)Edit Attach

Item5954: DirectedGraphPlugin should permit direct file I/O

pencil
Priority: Enhancement
Current State: Closed
Released In:
Target Release: n/a
Applies To: Extension
Component: DirectedGraphPlugin
Branches:
Reported By: TWiki:Main.GeorgeClark
Waiting For: TWiki:Main/GeorgeClark
Last Change By: GeorgeClark
There are a couple of enhancements needed to improve attachment handling and performance.
  • Plugin needs a way to bypass the TWiki attachment API and write directly to the file system
  • The plugin needs to generate links for all generated file types if the files are not visible in the attachments table.

See also TWiki:Codev/UnversionedAttachments and TWiki:Plugins/DirectedGraphPluginDev

This item will add a couple of additional configuration variables:
  • $TWiki::cfg{DirectedGraphPlugin}{attachPath} = '';
  • $TWiki::cfg{DirectedGraphPlugin}{attachUrlPath} = '';

There is a possibility that doing direct file I/O will improve the attachment speed by bypassing the revision control processing. Also, by doing direct file I/O, the user "viewing" the topic will not need update permission if the generated attachments change.

If these parameters are not set, then the plugin will use the standard attachment API as in previous versions. If they are configured, then the plugin will store generated attachments in the specified path, and will generate links using the specified URL path.

In addition a configuration parameter FORCEATTACHAPI, if enabled, will ignore these parameters and create all attachments using the standard API.

Finally, a <dot> parameter and configuration parameter, linkattachments, will cause the plugin to generate inline links for all attachment types except for the displayed inline image, in the form of [ps] [pdf] [jpg] ...

Note that for future compatibility with the store subsystem, it would be preferable to implement enhancements to the Func::saveAttachment API to permit "unversioned" attachments, and to bypass permission checking.

-- TWiki:Main/GeorgeClark - 25 Aug 2008

I've attached a test build to the TWiki:Plugins.DirectedGraphPluginDev topic. I'd appreciate some feedback on the changes before I upload a new release of the Plugin.

-- TWiki:Main.GeorgeClark - 01 Sep 2008

The version you built worked for normal cases, I did not try doing any direct I/O

Thanks,

Martin.

-- TWiki:Main.MartinCleaver - 18 Sep 2008

Note that this is incompatible with the ApacheConfigGenerator, as you need to manually add the line:

Alias /dpg-attach "/.../htdocs/dgp-attach"

to your site's apache.conf

Kinda defeats the purpose.

-- MartinCleaver - 24 Mar 2009

Hi Martin. If you set the attachPath to the pub directory, then it shouldn't impact the Apache configuration. If you configure the plugin to write outside of the Foswiki pub directory, then you not only need to add the alias, you probably also have to add a <directory> statement. if you decide to configure the plugin to write outside of the default Foswiki directories, then the Apache configuration will have to reflect that configuration. I guess that would suggest that this is for "Expert Users" - maybe I should flag these as expert level parameters?

I'll try to add some documentation to the configuration.

And an update from Martin - This additional directory appears to be incompatible with the rewrite rules for shorter URLs. It's probably an issue with the rewrite rules, as any added content directories would have the same issue.

And another update. Martin, you found a significant bug. Even when configured to write outside of the pub directory, the plugin continues to operate on the pub directory. So the failure was unrelated to the Short URL configuration. I've got a fix working here complete with short URL,s but I want to test further and also test on Windows before releasing. Hopefully I can finish this all off this week.

-- GeorgeClark - 25 Mar 2009

ItemTemplate edit

Summary DirectedGraphPlugin should permit direct file I/O
ReportedBy TWiki:Main.GeorgeClark
Codebase
SVN Range TWiki-5.0.0, Mon, 18 Aug 2008, build 17431
AppliesTo Extension
Component DirectedGraphPlugin
Priority Enhancement
CurrentState Closed
WaitingFor TWiki:Main/GeorgeClark
Checkins TWikirev:17467 TWikirev:17468
TargetRelease n/a
ReleasedIn
Topic revision: r11 - 26 Mar 2009, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy