The Metadata Plugin
Metadata Management for Manila
 
Site last updated
2/24/2006; 12:33:21 PM
 
Home

Why

Features

FAQ

Updates

Documentation

Download

Developers

Bugs

Feedback

Discuss

Planned
Features

 
 

Triggers

Note: at this point triggers are for those familiar with Frontier scripting only. There is no interface at this point; you have to create these tables directly in Frontier's object database.

Triggers give us a way of defining an action to take when a certain condition is true.

An example may be if you have a meta type called available_to_public which contains the value false while your flunkies work on the page content, and when it's ready to release you flip it to true. A trigger that replaced bodytext with the text This page is not yet available, you little sneak! may come in handy.

Let's suppose that for some reason we want to replace the bodytext of a page if the keywords meta type of a page has the value 'six'.

The replacement of bodytext will be carried out by a script named replaceBodytext.

Study the following screenshot, which shows the #plugins.data section of a Manila site. Inside a triggers table we have three subtables:

  • actions holds the scripts that execute when the condition is true. These could be wrapper scripts that call other Frontier scripts, or make an XML-RPC or SOAP call, or whatever. The action script should take a single parameter, the page table address.
  • pagefilter this table holds the conditions for each trigger to be evaluated during the pagefilter stage of building a page. The condition being evaluated here is 'keywords=six'. If this is indeed true for the page being rendered, the script at scriptname (in this case, replaceBodytext), will be executed.
  • finalfilter the same structure as the pagefilter table, but examined at finalfilter time. In this example, the condition is 'keywords=hello' and the script to be executed is helloworld.
Trigger Support Screenshot: The triggers table

I will probably be adding one more entry to the subtables containing the condition, a catch-all string object that will probably be named info. This would be additional information that would be supplied to the action script; for example, in the case of replaceBodytext it might be the string to replace bodytext with.

Comments...


This page last updated Saturday, February 16, 2002 at 10:11:10 PM. (13489)