public final class PageCommand extends AbstractCommand
Defines Commands for editing, renaming, and viewing wiki pages. PageCommands can be combined with WikiPages to produce targeted Commands.
This class is not final
; it may be extended in
the future.
Modifier and Type | Field and Description |
---|---|
static Command |
ATTACH |
static Command |
COMMENT |
static Command |
CONFLICT |
static Command |
DELETE |
static Command |
DIFF |
static Command |
EDIT |
static Command |
INFO |
static Command |
NONE |
static Command |
OTHER |
static Command |
PREVIEW |
static Command |
RENAME |
static Command |
RSS |
static Command |
UPLOAD |
static Command |
VIEW |
Modifier and Type | Method and Description |
---|---|
String |
getName()
Returns the human-friendly name for this command.
|
Permission |
requiredPermission()
Returns the Permission required to successfully execute this Command.
|
Command |
targetedCommand(Object target)
Creates and returns a targeted Command by combining a WikiPage
with this Command.
|
allCommands, getContentTemplate, getJSP, getJSPFriendlyName, getRequestContext, getTarget, getURLPattern, toString
public static final Command ATTACH
public static final Command COMMENT
public static final Command CONFLICT
public static final Command DELETE
public static final Command DIFF
public static final Command EDIT
public static final Command INFO
public static final Command PREVIEW
public static final Command RENAME
public static final Command RSS
public static final Command UPLOAD
public static final Command VIEW
public static final Command NONE
public static final Command OTHER
public Command targetedCommand(Object target)
target
object
must be non-null
and of type WikiPage.targetedCommand
in interface Command
targetedCommand
in class AbstractCommand
target
- the WikiPage to combine into the current CommandIllegalArgumentException
- if the target is not of the correct typeCommand.targetedCommand(Object)
public String getName()
Command
getName
in interface Command
getName
in class AbstractCommand
Command.getName()
public Permission requiredPermission()
Command
null
. For
example, the static command 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
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.