org.apache.wiki.ui
Class PageCommand

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

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.

Since:
2.4.22

Field Summary
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
           
 
Method Summary
 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.
 
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

ATTACH

public static final Command ATTACH

COMMENT

public static final Command COMMENT

CONFLICT

public static final Command CONFLICT

DELETE

public static final Command DELETE

DIFF

public static final Command DIFF

EDIT

public static final Command EDIT

INFO

public static final Command INFO

PREVIEW

public static final Command PREVIEW

RENAME

public static final Command RENAME

RSS

public static final Command RSS

UPLOAD

public static final Command UPLOAD

VIEW

public static final Command VIEW

NONE

public static final Command NONE

OTHER

public static final Command OTHER
Method Detail

targetedCommand

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

Specified by:
targetedCommand in interface Command
Specified by:
targetedCommand in class AbstractCommand
Parameters:
target - the WikiPage 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()
Description copied from interface: Command
Returns the human-friendly name for this command.

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 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".

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


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