Java Doc for WikiUtil.java in  » Wiki-Engine » JAMWiki » org » jamwiki » utils » 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 » JAMWiki » org.jamwiki.utils 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jamwiki.utils.WikiUtil

WikiUtil
public class WikiUtil (Code)
This class provides a variety of general utility methods for handling wiki-specific functionality such as retrieving topics from the URL.


Field Summary
final public static  StringPARAMETER_TOPIC
    
final public static  StringPARAMETER_VIRTUAL_WIKI
    
final public static  StringPARAMETER_WATCHLIST
    


Method Summary
public static  PaginationbuildPagination(HttpServletRequest request)
     Create a pagination object based on parameters found in the current request.
Parameters:
  request - The servlet request object.
Parameters:
  next - A ModelAndView object corresponding to the page beingconstructed.
public static  DataHandlerdataHandlerInstance()
     Utility method to retrieve an instance of the current data handler.
public static  StringextractCommentsLink(String name)
     Given an article name, return the appropriate comments topic article name. For example, if the article name is "Topic" then the return value is "Comments:Topic".
Parameters:
  name - The article name from which a comments article name is tobe constructed.
public static  StringextractTopicLink(String name)
     Given an article name, extract an appropriate topic article name.
public static  TopicfindRedirectedTopic(Topic parent, int attempts)
    
public static  StringgetParameterFromRequest(HttpServletRequest request, String name, boolean decodeUnderlines)
     Retrieve a parameter from the servlet request.
public static  StringgetTopicFromRequest(HttpServletRequest request)
     Retrieve a topic name from the servlet request.
public static  StringgetTopicFromURI(HttpServletRequest request)
     Retrieve a topic name from the request URI.
public static  StringgetVirtualWikiFromRequest(HttpServletRequest request)
     Retrieve a virtual wiki name from the servlet request.
public static  StringgetVirtualWikiFromURI(HttpServletRequest request)
     Retrieve a virtual wiki name from the request URI.
public static  booleanisCommentsPage(String topicName)
     Given a topic name, determine if that name corresponds to a comments page.
Parameters:
  topicName - The topic name (non-null) to examine to determine if itis a comments page or not.
public static  booleanisFirstUse()
     Determine if the system properties file exists and has been initialized.
public static  booleanisUpgrade()
     Determine if the system code has been upgraded from the configured system version.
public static  StringreadSpecialPage(Locale locale, String pageName)
     Utility method for reading special topic values from files and returning the file contents.
public static  ListretrieveUploadFileList()
     If a blacklist or whitelist of allowed file upload types is being used, retrieve the list from the properties file and return as a List object. If no such list is being used then return an empty List object. A list consisting of lowercase versions of all file extensionsfor the whitelist/blacklist.
public static  SearchEnginesearchEngineInstance()
     Utility method to retrieve an instance of the current search engine.
public static  UserHandleruserHandlerInstance()
     Utility method to retrieve an instance of the current user handler.
public static  WikiMessagevalidateDirectory(String name)
     Verify that a directory exists and is writable.
Parameters:
  name - The full name (including the path) for the directory being tested.
public static  voidvalidateRole(Role role)
     Utility method for determining if the parameters of a Role are valid or not.
public static  voidvalidateTopicName(String name)
     Utility method for determining if a topic name is valid for use on the Wiki, meaning that it is not empty and does not contain any invalid characters.
public static  voidvalidateUserName(String name)
     Utility method for determining if a username is valid for use on the Wiki, meaning that it is not empty and does not contain any invalid characters.

Field Detail
PARAMETER_TOPIC
final public static String PARAMETER_TOPIC(Code)



PARAMETER_VIRTUAL_WIKI
final public static String PARAMETER_VIRTUAL_WIKI(Code)



PARAMETER_WATCHLIST
final public static String PARAMETER_WATCHLIST(Code)





Method Detail
buildPagination
public static Pagination buildPagination(HttpServletRequest request)(Code)
Create a pagination object based on parameters found in the current request.
Parameters:
  request - The servlet request object.
Parameters:
  next - A ModelAndView object corresponding to the page beingconstructed. A Pagination object constructed from parameters found in therequest object.



dataHandlerInstance
public static DataHandler dataHandlerInstance() throws Exception(Code)
Utility method to retrieve an instance of the current data handler. An instance of the current data handler.
throws:
  Exception - Thrown if a data handler instance can not beinstantiated.



extractCommentsLink
public static String extractCommentsLink(String name) throws Exception(Code)
Given an article name, return the appropriate comments topic article name. For example, if the article name is "Topic" then the return value is "Comments:Topic".
Parameters:
  name - The article name from which a comments article name is tobe constructed. The comments article name for the article name.



extractTopicLink
public static String extractTopicLink(String name) throws Exception(Code)
Given an article name, extract an appropriate topic article name. For example, if the article name is "Comments:Topic" then the return value is "Topic".
Parameters:
  name - The article name from which a topic article name is to beconstructed. The topic article name for the article name.



findRedirectedTopic
public static Topic findRedirectedTopic(Topic parent, int attempts) throws Exception(Code)



getParameterFromRequest
public static String getParameterFromRequest(HttpServletRequest request, String name, boolean decodeUnderlines) throws Exception(Code)
Retrieve a parameter from the servlet request. This method works around some issues encountered when retrieving non-ASCII values from URL parameters.
Parameters:
  request - The servlet request object.
Parameters:
  name - The parameter name to be retrieved.
Parameters:
  decodeUnderlines - Set to true if underlines shouldbe automatically converted to spaces. The decoded parameter value retrieved from the request.



getTopicFromRequest
public static String getTopicFromRequest(HttpServletRequest request) throws Exception(Code)
Retrieve a topic name from the servlet request. This method will retrieve a request parameter matching the PARAMETER_TOPIC value, and will decode it appropriately.
Parameters:
  request - The servlet request object. The decoded topic name retrieved from the request.



getTopicFromURI
public static String getTopicFromURI(HttpServletRequest request)(Code)
Retrieve a topic name from the request URI. This method will retrieve the portion of the URI that follows the virtual wiki and decode it appropriately.
Parameters:
  request - The servlet request object. The decoded topic name retrieved from the URI.



getVirtualWikiFromRequest
public static String getVirtualWikiFromRequest(HttpServletRequest request)(Code)
Retrieve a virtual wiki name from the servlet request. This method will retrieve a request parameter matching the PARAMETER_VIRTUAL_WIKI value, and will decode it appropriately.
Parameters:
  request - The servlet request object. The decoded virtual wiki name retrieved from the request.



getVirtualWikiFromURI
public static String getVirtualWikiFromURI(HttpServletRequest request)(Code)
Retrieve a virtual wiki name from the request URI. This method will retrieve the portion of the URI that immediately follows the servlet context and decode it appropriately.
Parameters:
  request - The servlet request object. The decoded virtual wiki name retrieved from the URI.



isCommentsPage
public static boolean isCommentsPage(String topicName)(Code)
Given a topic name, determine if that name corresponds to a comments page.
Parameters:
  topicName - The topic name (non-null) to examine to determine if itis a comments page or not. true if the page is a comments page, falseotherwise.



isFirstUse
public static boolean isFirstUse()(Code)
Determine if the system properties file exists and has been initialized. This method is primarily used to determine whether or not to display the system setup page or not. true if the properties file has NOT been initialized,false otherwise.



isUpgrade
public static boolean isUpgrade() throws Exception(Code)
Determine if the system code has been upgraded from the configured system version. Thus if the system is upgraded, this method returns true true if the system has been upgraded, falseotherwise.



readSpecialPage
public static String readSpecialPage(Locale locale, String pageName) throws Exception(Code)
Utility method for reading special topic values from files and returning the file contents.
Parameters:
  locale - The locale for the user viewing the special page.
Parameters:
  pageName - The name of the special page being retrieved.



retrieveUploadFileList
public static List retrieveUploadFileList()(Code)
If a blacklist or whitelist of allowed file upload types is being used, retrieve the list from the properties file and return as a List object. If no such list is being used then return an empty List object. A list consisting of lowercase versions of all file extensionsfor the whitelist/blacklist. Entries in the list are of the form"txt", not ".txt".



searchEngineInstance
public static SearchEngine searchEngineInstance() throws Exception(Code)
Utility method to retrieve an instance of the current search engine. An instance of the current search engine.
throws:
  Exception - Thrown if a user handler instance can not beinstantiated.



userHandlerInstance
public static UserHandler userHandlerInstance() throws Exception(Code)
Utility method to retrieve an instance of the current user handler. An instance of the current user handler.
throws:
  Exception - Thrown if a user handler instance can not beinstantiated.



validateDirectory
public static WikiMessage validateDirectory(String name)(Code)
Verify that a directory exists and is writable.
Parameters:
  name - The full name (including the path) for the directory being tested. A WikiMessage object containing any error encountered, otherwisenull.



validateRole
public static void validateRole(Role role) throws WikiException(Code)
Utility method for determining if the parameters of a Role are valid or not.
Parameters:
  role - The Role to validate.
throws:
  WikiException - Thrown if the role is invalid.



validateTopicName
public static void validateTopicName(String name) throws WikiException(Code)
Utility method for determining if a topic name is valid for use on the Wiki, meaning that it is not empty and does not contain any invalid characters.
Parameters:
  name - The topic name to validate.
throws:
  WikiException - Thrown if the user name is invalid.



validateUserName
public static void validateUserName(String name) throws WikiException(Code)
Utility method for determining if a username is valid for use on the Wiki, meaning that it is not empty and does not contain any invalid characters.
Parameters:
  name - The username to validate.
throws:
  WikiException - Thrown if the user name is invalid.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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