Foswiki on GitHub is open for business! Next release meeting: Monday October 13, 1300Z

TopicNameValidationPlugin

Powered by
WikiRing Consultants
Control naming of topics

This plugin allows you to enforce a certain policy for topic names by defining a set of rules. Each rule consists of

  1. a regular expression pattern
  2. an error message, and
  3. a flag

When a topic is to be edited or saved, the regular expressions are checked. Each rule can be flagged deny or =allow. All rules are processed in the order given. The first pattern that matches either forbids or allows the topic to be processed any further. For instance, the example only allows topics names to consist of characters a-z, A-Z, digits 0-9, the dot and a slash. Dot and slash are needed as the match is tested against the fully qualified topic name consisting of the web and topic part, separated by a dot. That way you can create different rules for different webs.

Several topics can be specified using

  • Set TOPICVALIDATION_PLUGIN_RULESET = TopicNameRuleSet1, TopicNameRuleSet1, ...

(defaults to TopicNameValidationPlugin)

Each ruleset topic is parsed for a table in the format given below and all rules are concatenated.

If a topic name is forbidden, the user is redirected to oopstopicname. That's where the error message is inserted as specified in the second column of the rule set.

A rule can be disabled temporarily by adding disabled to the third column.

Pattern Message Flag
[^a-zA-Z0-9\.\/_] Only characters a-z and digits 0-9 are allowed.  

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Plugin Info

Sponsored by

Plugin Author(s): Foswiki:Main/MichaelDaum
Copyright ©: 2008-2009, Michael Daum http://michaeldaumconsulting.com
License: GPL (Gnu General Public License)
Release: 1.0
Version: 3646 (2009-04-23)
Change History:  
23 Apr 2009 converted to foswiki plugin
24 Oct 2008 initial version
Dependencies: None
Plugin Home: Foswiki:Extensions/TopicNameValidationPlugin
Support: Foswiki:Support/TopicNameValidationPlugin

Topic revision: r3 - 09 Dec 2009, CrawfordCurrie
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License