org.ceryle.wiki.plugin
Class ListUsers

java.lang.Object
  extended by org.ceryle.wiki.plugin.ListUsers
All Implemented Interfaces:
WikiPlugin

public class ListUsers
extends Object
implements WikiPlugin

The ListUsers plugin is a CeryleWikiPlugin that lists the users currently online. It has a bit simpler syntax than the existing SessionsPlugin, and provides the output using wiki links (though not when they are identified as an IP address). The default output is a list, but just as any of the CeryleWikiPlugins that use an output parameter, you can have the output formatted as you like.

The output is wrapped in a

element whose 'class' attribute value is "listusers".

If compiled with CHECK_AUTHENTICATION true, returns an empty string if the user viewing the page is not authenticated. This could be modified to permit only admins.

Parameters

Output Formatting

The specific format is controlled by the output parameter:
'none'
Indicates that output should be suppressed.
'users'
The output is the count of unique users (as a string e.g., "33").
'sessions'
The output is the total session count (as a string e.g., "44").
'list'
The output should be formatted as a simple vertical list.
'bullet'
The output should be formatted as a bulleted list.
'number'
The output should be formatted as a numbered list.
'space'
The output should be formatted as a space-delimited list.
'comma'
The output should be formatted as a comma-delimited list.
'colon'
The output should be formatted as a colon-delimited list.

This uses the same parameter syntax and output formats as the QueryPlugin.

Since:
2.5.22
Author:
Murray Altheim

Field Summary
protected static boolean CHECK_AUTHENTICATION
          If true, check to see that user is authenticated.
static String CLASS_LISTUSERS
          The CSS class attribute value used for the output <div> element.
static String NOBODY
          The string returned when there are no users.
static String ONE_SESSION
          The (singular) string provided as the output of 'sessions' when there is only one user.
static String ONE_USER
          The (singular) string provided as the output of 'users' when there is only one user.
static String PARAM_OUTPUT
           
static String SESSIONS
          The (plural) string appended to the output of 'sessions'.
static String USERS
          The (plural) string appended to the output of 'users'.
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Constructor Summary
ListUsers()
           
 
Method Summary
 String execute(WikiContext context, Map params)
           
 String lookupIP(String address)
          Attempts a lookup of the IP address (as a String), returning a name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOBODY

public static String NOBODY
The string returned when there are no users.


ONE_USER

public static String ONE_USER
The (singular) string provided as the output of 'users' when there is only one user. The default value is "1 user".


USERS

public static String USERS
The (plural) string appended to the output of 'users'. The default value is "users".


ONE_SESSION

public static String ONE_SESSION
The (singular) string provided as the output of 'sessions' when there is only one user. The default value is "1 session".


SESSIONS

public static String SESSIONS
The (plural) string appended to the output of 'sessions'. The default value is "sessions".


CLASS_LISTUSERS

public static final String CLASS_LISTUSERS
The CSS class attribute value used for the output <div> element. The value is "listusers".

See Also:
Constant Field Values

PARAM_OUTPUT

public static final String PARAM_OUTPUT
See Also:
Constant Field Values

CHECK_AUTHENTICATION

protected static final boolean CHECK_AUTHENTICATION
If true, check to see that user is authenticated. The value is false.

See Also:
Constant Field Values
Constructor Detail

ListUsers

public ListUsers()
Method Detail

execute

public String execute(WikiContext context,
                      Map params)
               throws PluginException
Specified by:
execute in interface WikiPlugin
Throws:
PluginException

lookupIP

public String lookupIP(String address)
Attempts a lookup of the IP address (as a String), returning a name. If this fails or the feature is unimplemented, returns the original String.

[This feature is currently unimplemented.]



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