Item5954: DirectedGraphPlugin should permit direct file I/O
Priority: Enhancement
Current State: Closed
Released In:
Target Release: n/a
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