NAME

Konstrukt::Plugin::wiki::backend - Base class for wiki backends

SYNOPSIS

use base 'Konstrukt::Plugin::wiki::backend';
#overwrite the methods

DESCRIPTION

Base class/interface for a backend class. Actually the backend class will problably be a base class itself, which will be implemented for the various backend typed (DBI, file, ...).

METHODS

new

Constructor of this class

init

Method that will be called right before the first usage within a request. Should be overridden by the inheriting class.

For example you may set default settings here.

actions

This method will return an array of strings with the actions (file.html?action=youraction) that your backend plugin will handle.

You should return an empty list, if your plugin has no responsibilities. But in this case your plugin will most likely never be called.

If such an action is called, the method with the name of the action will be called on your plugin object.

Example:

#your plugin is responsible for the action foo.
#wiki.html?action=foo has been called.
#this method will be called:
$your_plugin->foo($tag);

Your method has to put out its result just like any other plugin does (see "add_node" in Konstrukt::Plugin).

Your method will also get a reference to the <& wiki &>-tag node to grant you access to some attributes or the content of the tag.

This method will return a normalized version of a passed link string.

The backend may use this method to normalize the link to an object.

This is the default implementation, which may be overwritten by the implementing backend classes.

Some critical characters will be converted or escaped. Also converts the link to lowercase. So SomeLink will point to the same page as [[somelink]].

Parameters:

  • $link - The link to normalize

AUTHOR

Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.

This document is free software. It is distributed under the same terms as Perl itself.

SEE ALSO

Konstrukt::Plugin::wiki