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.
WikiEngine.getApplicationName()
Modifier and Type | Field and Description |
---|---|
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 |
Modifier and Type | Method and Description |
---|---|
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.
|
allCommands, getContentTemplate, getJSP, getJSPFriendlyName, getRequestContext, getTarget, getURLPattern, toString
public static final Command CREATE_GROUP
public static final Command ERROR
public static final Command FIND
public static final Command INSTALL
public static final Command LOGIN
public static final Command LOGOUT
public static final Command MESSAGE
public static final Command PREFS
public static final Command WORKFLOW
public static final Command ADMIN
public Command targetedCommand(Object target)
target
object must be non-null
and of type String.targetedCommand
in interface Command
targetedCommand
in class AbstractCommand
target
- the name of the wiki to combine into the current CommandIllegalArgumentException
- if the target is not of the correct typeCommand.targetedCommand(Object)
public String getName()
getName
in interface Command
getName
in class AbstractCommand
Command.getName()
public Permission requiredPermission()
Command
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"
.null
if not requiredCommand.requiredPermission()
Copyright © 2001-2018 The Apache Software Foundation. All rights reserved.