org.ceryle.wiki.plugin.alias
Class AliasPlugin

java.lang.Object
  extended by org.ceryle.wiki.plugin.alias.AliasPlugin
All Implemented Interfaces:
WikiPlugin
Direct Known Subclasses:
Alias

public class AliasPlugin
extends Object
implements WikiPlugin

Having been frustrated by the need to manually create alias pages just to hold the [{SET alias=TruePageName}] syntax (and since the alias breaks when the page is renamed) this plugin was born. (The SET syntax is backwards! I want to declare an alias on the 'true' named page, not the other way around!)

In most ways this plugin is a convenience, it requires just one parameter 'name' for the alias to be created. It then makes sure that page exists, and that some boilerplate content exists in it. The 'name' parameter is split on commas to allow one invokation to create multiple aliases. Two additional parameters are optional, 'extraHeader' is text that is appended in the boilerplate in the first section, 'extraBody' is appended in the second section. The boiler plate created is as follows:

  [TruePageName].  extraHeader
  ----
  extraText
  %%warning
  Do Not Edit!  This alias page created by the AliasPlugin invokation on the page [TruePageName].
  [{SET alias=TruePageName}]
  %%
 
On each invocation of this plugin it checks to make sure that the alias pages exist with the required boilerplate. When the page is renamed, the required boilerplate is different, and so the alias pages get edited. See? Sorry for being cryptic here...

Finally the boilerplate of the alias page contains a normal link back to the true page so the alias is listed as a referrer.

Author:
John Volkar (john.volkar at gmail.com)

Field Summary
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Constructor Summary
AliasPlugin()
           
 
Method Summary
 String execute(WikiContext context, Map paramMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasPlugin

public AliasPlugin()
Method Detail

execute

public String execute(WikiContext context,
                      Map paramMap)
Specified by:
execute in interface WikiPlugin


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.