org.apache.wiki.ui
Class WikiCommand

java.lang.Object
  extended by org.apache.wiki.ui.AbstractCommand
      extended by org.apache.wiki.ui.WikiCommand
All Implemented Interfaces:
Command

public final class WikiCommand
extends AbstractCommand

Defines Commands for wiki-wide operations such as creating groups, editing preferences and profiles, and logging in/out. WikiCommands can be combined with Strings (representing the name of a wiki instance) to produce targeted Commands.

This class is not final; it may be extended in the future.

Since:
2.4.22
See Also:
WikiEngine.getApplicationName()

Field Summary
static Command ADMIN
           
static Command CREATE_GROUP
           
static Command ERROR
           
static Command FIND
           
static Command INSTALL
           
static Command LOGIN
           
static Command LOGOUT
           
static Command MESSAGE
           
static Command PREFS
           
static Command WORKFLOW
           
 
Method Summary
 String getName()
          Always returns the "friendly" JSP name.
 Permission requiredPermission()
          Returns the Permission required to successfully execute this Command.
 Command targetedCommand(Object target)
          Creates and returns a targeted Command by combining a wiki (a String) with this Command.
 
Methods inherited from class org.apache.wiki.ui.AbstractCommand
allCommands, getContentTemplate, getJSP, getJSPFriendlyName, getRequestContext, getTarget, getURLPattern, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATE_GROUP

public static final Command CREATE_GROUP

ERROR

public static final Command ERROR

FIND

public static final Command FIND

INSTALL

public static final Command INSTALL

LOGIN

public static final Command LOGIN

LOGOUT

public static final Command LOGOUT

MESSAGE

public static final Command MESSAGE

PREFS

public static final Command PREFS

WORKFLOW

public static final Command WORKFLOW

ADMIN

public static final Command ADMIN
Method Detail

targetedCommand

public Command targetedCommand(Object target)
Creates and returns a targeted Command by combining a wiki (a String) with this Command. The supplied target object must be non-null and of type String.

Specified by:
targetedCommand in interface Command
Specified by:
targetedCommand in class AbstractCommand
Parameters:
target - the name of the wiki to combine into the current Command
Returns:
the new targeted command
Throws:
IllegalArgumentException - if the target is not of the correct type
See Also:
Command.targetedCommand(Object)

getName

public String getName()
Always returns the "friendly" JSP name.

Specified by:
getName in interface Command
Specified by:
getName in class AbstractCommand
Returns:
the name
See Also:
Command.getName()

requiredPermission

public Permission requiredPermission()
Description copied from interface: Command
Returns the Permission required to successfully execute this Command. If no Permission is requred, this method returns null. For example, the static command PageCommand.VIEW doesn't require a permission because it isn't referring to a particular WikiPage. However, if this command targets a WikiPage called Main(via PageCommand.targetedCommand(Object), the resulting Command would require the permission PagePermission "yourWiki:Main", "view".

Returns:
the required permission, or null if not required
See Also:
Command.requiredPermission()


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