Skip to content

Commit

Permalink
Item1778: Notify WysiwygPlugin about <dot> markup, so that it is prot…
Browse files Browse the repository at this point in the history
…ected in the WYSIWYG editor.

git-svn-id: http://svn.foswiki.org/trunk/DirectedGraphPlugin@4316 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelTempest authored and MichaelTempest committed Jun 28, 2009
1 parent f01949f commit 46526fe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 6 additions & 4 deletions data/System/DirectedGraphPlugin.txt
@@ -1,6 +1,7 @@
%META:TOPICINFO{author="ProjectContributor" date="1238965436" format="1.1" reprev="1.7" version="1.7"}%
---+!! Directed Graph Plugin

<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the Dev topic instead. -->
%TOC%
---++ Introduction

Expand All @@ -10,15 +11,15 @@ This plugin uses [[http://www.graphviz.org/][Graphviz's]] applications to create

Visit the [[http://www.graphviz.org/Gallery.php][Graphviz gallery]] to see some examples on what can be achieved with this plugin and Graphviz. Full documentation is available at http://graphviz.org/Documentation.php.

| %X% *Caution* =&lt;dot&gt;= syntax is not currently compatible with the WYSIWYG editor. Raw editing is recommended, or use &lt;sticky&gt; tags to protect the dot tags. |
| %X% *Caution* =&lt;dot&gt;= syntax is not compatible with versions of Foswiki:Extensions.WysiwygPlugin prior to 28 June 2009. It is recommended that you upgrade !WysiwygPlugin if you are running an older version. If that is not practical then raw editing is recommended, or use &lt;sticky&gt; tags to protect the dot tags. |
---+++ Attachment Handling
| %X% *By default, this version of the plugin uses the Foswiki API to manipulate the attached graphs. The first user to view a topic containing a directed graph will be denied access if they do not have update permission. If defaults or DOT parameters have changed, viewing the topic may modify attachments, which will require update permission.* |

Each generated file is attached to the topic using the Foswiki attachment API. This results in revision control of the attached files, and updates to the topic for each generated file. If Foswiki is configured to increment a new revision for each update (See <a target="_top" href="http://foswiki.org/System/ForceNewRevision">http://foswiki.org/System/ForceNewRevision</a> and config parameter =$Foswiki::cfg{ReplaceIfEditedAgainWithin} = 0= ), then every updated attachment will result in a new topic revision. The alternative to this behavior is to use the expert parameter attachPath - set in bin/configure - to configure the plugin to do direct file I/O and bypass the attach API.

Direct file I/O results in a considerable performance improvement. Initial rendering of this topic on a test system resulted in a reduction of time to generate the attachments and initially display from 60 seconds down to approximately 8 seconds.

| %X% *Caution* The plugin will also update attached files during __Preview__. if the edit is subsequently canceled, the attachments will be regenerated again. |
| %X% *Caution* The plugin will also update attached files during __Preview__. If the edit is subsequently canceled, the attachments will be regenerated again. |

The output of the &lt;dot&gt; command is cached as attachments to the topic. Any change to the &lt;dot&gt; input will result in the attachments being updated.

Expand Down Expand Up @@ -475,8 +476,9 @@ Details on how to install cairo, graphviz and imagemagick are beyond the scope o
| Home: | http://foswiki.org/Extensions/%TOPIC%Dev |
| Support: | http://foswiki.org/Support/%TOPIC% |
| Change History: | <!-- versions below in reverse order --> |
| 5 Apr 2009: | Foswikitask:Item8102 - Improve defaults, configure settings now optional --Foswiki:Main.GeorgeClar |
| 25 Mar 2009: | Foswikitask:Item1201, Foswikitask:Item1360 - Configure script fails on perl 5.10. %BR% Foswikitask:Item8086 - Direct File I/O failis. -- Foswiki:Main.GeorgeClark |
| 28 Jun 2009: | Foswikitask:Item1778 - Notify !WysiwygPlugin about &lt;dot&gt; markup so that it is protected in WYSIWYG editors --Foswiki:Main.MichaelTempest |
| 5 Apr 2009: | Foswikitask:Item8102 - Improve defaults, configure settings now optional --Foswiki:Main.GeorgeClark |
| 25 Mar 2009: | Foswikitask:Item1201, Foswikitask:Item1360 - Configure script fails on perl 5.10. %BR% Foswikitask:Item8086 - Direct File I/O fails. -- Foswiki:Main.GeorgeClark |
| 8 Jan 2009: | Foswikitask:Item8035: Uninitialized variables reported in server Error log.-- Foswiki:Main.GeorgeClark |
| 14 Dec 2008: | Foswikitask:Item8031: Port to Foswiki -- Foswiki:Main.GeorgeClark |
| 11 Oct 2008: | TWikibug:Item6058: Incompatibilities with Windows, improved some error messages. --TWiki:Main.GeorgeClark |
Expand Down
9 changes: 8 additions & 1 deletion lib/Foswiki/Plugins/DirectedGraphPlugin.pm
Expand Up @@ -53,7 +53,7 @@ our $VERSION = '$Rev: 17659 $';
# # This is a free-form string you can use to "name" your own plugin version.
# # It is *not* used by the build automation tools, but is reported as part
# # of the version number in PLUGINDESCRIPTIONS.
our $RELEASE = '1.4';
our $RELEASE = '1.5';

#
# # Short description of this plugin
Expand Down Expand Up @@ -231,6 +231,13 @@ sub initPlugin {
Foswiki::Func::clearSessionValue('DGP_newhash')
; # blank slate for new attachments

# Tell WyswiygPlugin to protect <dot>...</dot> markup
if (defined &Foswiki::Plugins::WysiwygPlugin::addXMLTag) {
# Check if addXMLTag is defined, so that DirectedGraphPlugin
# continues to work with older versions of WysiwygPlugin
Foswiki::Plugins::WysiwygPlugin::addXMLTag('dot', sub { 1 } );
}

# Plugin correctly initialized
&_writeDebug(
"- Foswiki::Plugins::${pluginName}::initPlugin( $web.$topic ) initialized OK"
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/DirectedGraphPlugin/Config.spec
Expand Up @@ -9,7 +9,7 @@ $Foswiki::cfg{Plugins}{DirectedGraphPlugin}{enginePath} = '';
# **PATH**
# Path to the ImageMagick convert utility. <br>
# - This is used to support antialias output <br>
# (Required if GraphViz doesn't have Cario rendering support.)
# (Required if GraphViz doesn't have Cairo rendering support.)
$Foswiki::cfg{Plugins}{DirectedGraphPlugin}{magickPath} = '';
# **PATH**
# Path to the Foswiki tools directory . <br>
Expand Down

0 comments on commit 46526fe

Please sign in to comment.