[dokuwiki] metadata clearing

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 14 Nov 2006 03:03:47 +0000

Hi Andi, Esther and list,

I ran into a problem today with metadata. It lacks a mechanism to clean out old metadata - except for those standard meta data keys used by native DW. I can see the advantages of this system, but I do think there needs to be a mechanism to give plugins the opportunity to clean out their old metadata.

e.g. the problem was with a page redirection plugin. The redirection is placed on the page and detected with a syntax plugin. It adds the redirection to the page's metadata. An action plugin checks the metadata of the current page when the action is "show" and if it finds the metadata key, it redirects to the new page location.

That works fine until you edit the original page to remove the redirection. Because the syntax is no longer on the page, the syntax plugin doesn't fire and it can't remove the now out of date metadata key.


My proposal is to:
- add a PARSER_METADATA_RENDER event wrapped around metadata rendering. Action plugins which add/handle metadata could respond to this. - add a clear() method to the syntax plugin class. DW would call that method for every syntax plugin prior to processing the instruction list. Syntax plugins that wished to clear out their metadata could override the default method (which does nothing).

What do you think?

Cheers,

Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: