org.apache.wiki.plugin
Class PageViewPlugin.PageViewManager

java.lang.Object
  extended by org.apache.wiki.plugin.PageViewPlugin.PageViewManager
All Implemented Interfaces:
EventListener, WikiEventListener
Enclosing class:
PageViewPlugin

public final class PageViewPlugin.PageViewManager
extends Object
implements WikiEventListener

Page view manager, handling all storage.


Constructor Summary
PageViewPlugin.PageViewManager()
           
 
Method Summary
 void actionPerformed(WikiEvent event)
          Inspect wiki events for shutdown.
 String execute(WikiContext context, Map<String,String> params)
          Count a page hit, present a pages' counter or output a list of page counts.
protected  int getCount(Object key)
          Retrieve a page count.
 void initialize(WikiEngine engine)
          Initialize the page view manager.
protected  void storeCounters()
          Save the page view counters to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageViewPlugin.PageViewManager

public PageViewPlugin.PageViewManager()
Method Detail

initialize

public void initialize(WikiEngine engine)
Initialize the page view manager.

Parameters:
engine - The wiki engine.

actionPerformed

public void actionPerformed(WikiEvent event)
Inspect wiki events for shutdown.

Specified by:
actionPerformed in interface WikiEventListener
Parameters:
event - The wiki event to inspect.

execute

public String execute(WikiContext context,
                      Map<String,String> params)
               throws PluginException
Count a page hit, present a pages' counter or output a list of page counts.

Parameters:
context - the wiki context
params - the plugin parameters
Returns:
String Wiki page snippet
Throws:
PluginException - Malformed pattern parameter.

getCount

protected int getCount(Object key)
Retrieve a page count.

Parameters:
key - the key for the Counter
Returns:
int The page count for the given key.

storeCounters

protected void storeCounters()
Save the page view counters to file.



Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.