org.ceryle.wiki.handler
Class UniqueIdHandler

java.lang.Object
  extended by org.ceryle.wiki.handler.NewPageHandler
      extended by org.ceryle.wiki.handler.UniqueIdHandler
All Implemented Interfaces:
FormHandler, WikiPlugin

public class UniqueIdHandler
extends NewPageHandler

A plugin that provides a unique identifier upon request.

So you need a unique ID generated for oh, lets just say asset tracking or whatever, you can of course use a database and get this, but isn't a wiki like a database? (in some senses a better, more flexible and approachable one too!). But how do you get a wiki to make a unique ID for you? Well, you can use this plugin.

This plugin is a form handler that extends the NewPageHandler, we take our parameters and generate the needed parameters to feed up to the NewPageHandler so it can make a page for us.

UniqueIdHandler Parameters:
uidprefix = "", optional
uidsuffix = "", optional
uidtype = [randalpha, randnumeric, randalphanumeric, autoincrement], optional, default is randalphanumeric
uidlength = 1-maxint, optional, default is 4
uidautoincrement = "" starting number/pattern, optional, defaults to "0[length-1]1" only used if idtype=autoincrement

Parameters to be sent to the NewPageHandler:
_body, if empty, add a boilerplate body
newPageName
newPageNamePrefix
autoIncrement overwrite = false

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

Field Summary
static String BOILERPLATE_BODY
           
static String PARAM_UID_AUTO_INCREMENT
           
static String PARAM_UID_LENGTH
           
static String PARAM_UID_PREFIX
           
static String PARAM_UID_SUFFIX
           
static String PARAM_UID_TYPE
           
 
Fields inherited from class org.ceryle.wiki.handler.NewPageHandler
PARAM_AUTO_INCREMENT, PARAM_NEW_PAGE_NAME, PARAM_NEW_PAGE_NAME_PREFIX, PARAM_OVERWRITE
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Constructor Summary
UniqueIdHandler()
           
 
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
 

Field Detail

PARAM_UID_PREFIX

public static final String PARAM_UID_PREFIX
See Also:
Constant Field Values

PARAM_UID_SUFFIX

public static final String PARAM_UID_SUFFIX
See Also:
Constant Field Values

PARAM_UID_TYPE

public static final String PARAM_UID_TYPE
See Also:
Constant Field Values

PARAM_UID_LENGTH

public static final String PARAM_UID_LENGTH
See Also:
Constant Field Values

PARAM_UID_AUTO_INCREMENT

public static final String PARAM_UID_AUTO_INCREMENT
See Also:
Constant Field Values

BOILERPLATE_BODY

public static final String BOILERPLATE_BODY
See Also:
Constant Field Values
Constructor Detail

UniqueIdHandler

public UniqueIdHandler()
Method Detail

execute

public String execute(WikiContext context,
                      Map paramMap)
               throws PluginException
Specified by:
execute in interface WikiPlugin
Overrides:
execute in class NewPageHandler
Throws:
PluginException


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