Java Doc for Command.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.ecyrd.jspwiki.ui.Command

All known Subclasses:   com.ecyrd.jspwiki.ui.AbstractCommand,  com.ecyrd.jspwiki.WikiContext,
Command
public interface Command (Code)

Represents a logical "unit of work" that includes a request context, JSP, URLPattern, content template and (optionally) a target and required security permission. Examples of Commands include "view a page," "create a group," and "edit user preferences."

Commands come in two flavors: "static" and "targeted."

  • Static commands are exactly what they sound like: static. They are final, threadsafe, and immutable. They have no intrinsic idea of the context they are acting in. For example, the static command PageCommand.VIEW embodies the idea of viewing a page — but exactly which page is left undefined. Static commands exist so that they can be freely shared and passed around without incurring the penalties of object creation. Static commands are a lot like naked request contexts ("edit", "view", etc.) except that they include additional, essential properites such as the associated URL pattern and content JSP.
  • Targeted commands "decorate" static commands by scoping a static Command at a specific target such as a WikiPage or GroupPrincipal. Targeted commands are created by calling an existing Command's Command.targetedCommand(Object) and supplying the target object. Implementing classes generally require a specific target type. For example, the PageCommand class requires that the target object be of type com.ecyrd.jspwiki.WikiPage .

Concrete implementations of Command include:

  • PageCommand: commands for editing, renaming, and viewing pages
  • GroupCommand: commands for viewing, editing and deleting wiki groups
  • WikiCommand: commands for wiki-wide operations such as creating groups, editing preferences and profiles, and logging in/out
  • RedirectCommand: commands for redirections to off-site special pages

For a given targeted Command, its Command.getTarget() method will return a non-null value. In addition, its Command.requiredPermission() method will generally also return a non-null value. It is each implementation's responsibility to construct and store the correct Permission for a given Command and Target. For example, when PageCommand.VIEW is targeted at the WikiPage Main, the Command's associated permission is PagePermission "theWiki:Main", "view".

Static Commands, and targeted Commands that do not require specific permissions to execute, return a null result for Command.requiredPermission() .


author:
   Andrew Jaquith
since:
   2.4.22




Method Summary
public  StringgetContentTemplate()
     Returns the content template associated with a Command, such as PreferencesContent.jsp.
public  StringgetJSP()
     Returns the JSP associated with the Command.
public  StringgetName()
     Returns the human-friendly name for this command.
public  StringgetRequestContext()
     Returns the request context associated with this Command.
public  ObjectgetTarget()
     Returns the target associated with a Command, if it was created with one. Commands created with Command.targetedCommand(Object) will always return a non-null object.
public  StringgetURLPattern()
     Returns the URL pattern associated with this Command.
public  PermissionrequiredPermission()
     Returns the Permission required to successfully execute this Command.
public  CommandtargetedCommand(Object target)
     Creates and returns a targeted Command by combining a target, such as a WikiPage or GroupPrincipal into the existing Command.



Method Detail
getContentTemplate
public String getContentTemplate()(Code)
Returns the content template associated with a Command, such as PreferencesContent.jsp. For Commands that are not page-related, this method will always return null. Calling methods should always check to see if the result of this method is null. the content template



getJSP
public String getJSP()(Code)
Returns the JSP associated with the Command. The JSP is a "local" JSP within the JSPWiki webapp; it is not a general HTTP URL. If it exists, the JSP will be expressed relative to the webapp root, without a leading slash. This method is guaranteed to return a non-null result, although in some cases the result may be an empty string. the JSP or url associated with the wiki command



getName
public String getName()(Code)
Returns the human-friendly name for this command. the name



getRequestContext
public String getRequestContext()(Code)
Returns the request context associated with this Command. This method is guaranteed to return a non-null String. the request context



getTarget
public Object getTarget()(Code)
Returns the target associated with a Command, if it was created with one. Commands created with Command.targetedCommand(Object) will always return a non-null object. Calling methods should always check to see if the result of this method is null. the wiki page



getURLPattern
public String getURLPattern()(Code)
Returns the URL pattern associated with this Command. This method is guaranteed to return a non-null String. the URL pattern



requiredPermission
public Permission requiredPermission()(Code)
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". the required permission, or null if not required



targetedCommand
public Command targetedCommand(Object target)(Code)
Creates and returns a targeted Command by combining a target, such as a WikiPage or GroupPrincipal into the existing Command. Subclasses should check to make sure the supplied target object is of the correct type. This method is guaranteed to return a non-null Command (unless the target is an incorrect type).
Parameters:
  target - the object to combine, such as a GroupPrincipal or WikiPage the new, targeted Command
throws:
  IllegalArgumentException - if the target is not of the correct type



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.