Package org.apache.wiki.ui
Class PageCommand
- java.lang.Object
-
- org.apache.wiki.ui.AbstractCommand
-
- 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.
- Since:
- 2.4.22
-
-
Field Summary
Fields Modifier and Type Field Description static CommandATTACHstatic CommandCOMMENTstatic CommandCONFLICTstatic CommandDELETEstatic CommandDIFFstatic CommandEDITstatic CommandINFOstatic CommandNONEstatic CommandOTHERstatic CommandPREVIEWstatic CommandRENAMEstatic CommandRSSstatic CommandUPLOADstatic CommandVIEW
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Returns the human-friendly name for this command.java.security.PermissionrequiredPermission()Returns the Permission required to successfully execute this Command.CommandtargetedCommand(java.lang.Object target)Creates and returns a targeted Command by combining a WikiPage with this Command.-
Methods inherited from class org.apache.wiki.ui.AbstractCommand
getContentTemplate, getJSP, getJSPFriendlyName, getRequestContext, getTarget, getURLPattern, toString
-
-
-
-
Method Detail
-
targetedCommand
public Command targetedCommand(java.lang.Object target)
Creates and returns a targeted Command by combining a WikiPage with this Command. The suppliedtargetobject must be non-nulland of type WikiPage.- Specified by:
targetedCommandin interfaceCommand- Specified by:
targetedCommandin classAbstractCommand- Parameters:
target- the WikiPage to combine into the current Command- Returns:
- the new targeted command
- Throws:
java.lang.IllegalArgumentException- if the target is not of the correct type- See Also:
Command.targetedCommand(Object)
-
getName
public java.lang.String getName()
Description copied from interface:CommandReturns the human-friendly name for this command.- Specified by:
getNamein interfaceCommand- Specified by:
getNamein classAbstractCommand- Returns:
- the name
- See Also:
Command.getName()
-
requiredPermission
public java.security.Permission requiredPermission()
Description copied from interface:CommandReturns the Permission required to successfully execute this Command. If no Permission is required, this method returnsnull. For example, the static commandorg.apache.wiki.ui.PageCommand#VIEWdoesn't require a permission because it isn't referring to a particular WikiPage. However, if this command targets a WikiPage calledMain(viaorg.apache.wiki.ui.PageCommand#targetedCommand(Object), the resulting Command would require the permissionPagePermission "yourWiki:Main", "view".- Returns:
- the required permission, or
nullif not required - See Also:
Command.requiredPermission()
-
-