Java Doc for LinkUtil.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.LinkUtil

LinkUtil
public class LinkUtil (Code)
General utility methods for handling both wiki topic links such as "Topic#Section?query=param", as well as HTML links of the form http://example.com/.




Method Summary
public static  StringappendQueryParam(String query, String param, String value)
     Build a query parameter.
public static  StringbuildEditLinkUrl(String context, String virtualWiki, String topic, String query, int section)
     Utility method for building a URL link to a wiki edit page for a specified topic.
Parameters:
  context - The servlet context for the link that is being created.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  topic - The name of the topic for which an edit link is beingcreated.
Parameters:
  query - Any existing query parameters to append to the edit link.This value may be either null or empty.
Parameters:
  section - The section defined by the name parameter within theHTML page for the topic being edited.
public static  StringbuildImageLinkHtml(String context, String virtualWiki, String topicName, boolean frame, boolean thumb, String align, String caption, int maxDimension, boolean suppressLink, String style, boolean escapeHtml)
     Utility method for building an anchor tag that links to an image page and includes the HTML image tag to display the image.
Parameters:
  context - The servlet context for the link that is being created.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  topicName - The name of the image for which a link is beingcreated.
Parameters:
  frame - Set to true if the image should display witha frame border.
Parameters:
  thumb - Set to true if the image should display as athumbnail.
Parameters:
  align - Indicates how the image should horizontally align on thepage.
public static  StringbuildInternalLinkHtml(String context, String virtualWiki, WikiLink wikiLink, String text, String style, String target, boolean escapeHtml)
     Build the HTML anchor link to a topic page for a given WikLink object.
Parameters:
  context - The servlet context for the link that is being created.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  wikiLink - The WikiLink object containing all relevant informationabout the link being generated.
Parameters:
  text - The text to display as the link content.
Parameters:
  style - The CSS class to use with the anchor HTML tag.
public static  StringbuildInternalLinkUrl(String context, String virtualWiki, String topic)
     Build a URL to the topic page for a given topic.
Parameters:
  context - The servlet context path.
public static  StringbuildInternalLinkUrl(String context, String virtualWiki, WikiLink wikiLink)
     Build a URL to the topic page for a given topic.
Parameters:
  context - The servlet context path.
public static  StringinterWiki(WikiLink wikiLink)
     Generate the HTML for an interwiki anchor link.
Parameters:
  wikiLink - The WikiLink object containing all relevant informationabout the link being generated.
public static  booleanisExistingArticle(String virtualWiki, String articleName)
     Utility method for determining if an article name corresponds to a valid wiki link.
public static  WikiLinkparseWikiLink(String raw)
     Parse a topic name of the form "Topic#Section?Query", and return a WikiLink object representing the link.
Parameters:
  raw - The raw topic link text.



Method Detail
appendQueryParam
public static String appendQueryParam(String query, String param, String value)(Code)
Build a query parameter. If root is empty, this method returns "?param=value". If root is not empty this method returns root + "&param=value". Note that param and value will be URL encoded, and if "query" does not start with a "?" then one will be pre-pended.
Parameters:
  query - The existing query parameter, if one is available. If thequery parameter does not start with "?" then one will be pre-pended.
Parameters:
  param - The name of the query parameter being appended. Thisvalue will be URL encoded.
Parameters:
  value - The value of the query parameter being appended. Thisvalue will be URL encoded. The full query string generated using the input parameters.



buildEditLinkUrl
public static String buildEditLinkUrl(String context, String virtualWiki, String topic, String query, int section) throws Exception(Code)
Utility method for building a URL link to a wiki edit page for a specified topic.
Parameters:
  context - The servlet context for the link that is being created.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  topic - The name of the topic for which an edit link is beingcreated.
Parameters:
  query - Any existing query parameters to append to the edit link.This value may be either null or empty.
Parameters:
  section - The section defined by the name parameter within theHTML page for the topic being edited. If provided then the edit linkwill allow editing of only the specified section. A url that links to the edit page for the specified topic.Note that this method returns only the URL, not a fully-formed HTMLanchor tag.
throws:
  Exception - Thrown if any error occurs while builing the link URL.



buildImageLinkHtml
public static String buildImageLinkHtml(String context, String virtualWiki, String topicName, boolean frame, boolean thumb, String align, String caption, int maxDimension, boolean suppressLink, String style, boolean escapeHtml) throws Exception(Code)
Utility method for building an anchor tag that links to an image page and includes the HTML image tag to display the image.
Parameters:
  context - The servlet context for the link that is being created.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  topicName - The name of the image for which a link is beingcreated.
Parameters:
  frame - Set to true if the image should display witha frame border.
Parameters:
  thumb - Set to true if the image should display as athumbnail.
Parameters:
  align - Indicates how the image should horizontally align on thepage. Valid values are "left", "right" and "center".
Parameters:
  caption - An optional text caption to display for the image. Ifno caption is used then this value should be either empty ornull.
Parameters:
  maxDimension - A value in pixels indicating the maximum width orheight value allowed for the image. Images will be resized so thatneither the width or height exceeds this value.
Parameters:
  suppressLink - If this value is true then thegenerated HTML will include the image tag without a link to the imagetopic page.
Parameters:
  style - The CSS class to use with the img HTML tag. This valuecan be null or empty if no custom style is used.
Parameters:
  escapeHtml - Set to true if the caption should beHTML escaped. This value should be true in any casewhere the caption is not guaranteed to be free from potentiallymalicious HTML code. The full HTML required to display an image enclosed within anHTML anchor tag that links to the image topic page.
throws:
  Exception - Thrown if any error occurs while builing the imageHTML.



buildInternalLinkHtml
public static String buildInternalLinkHtml(String context, String virtualWiki, WikiLink wikiLink, String text, String style, String target, boolean escapeHtml) throws Exception(Code)
Build the HTML anchor link to a topic page for a given WikLink object.
Parameters:
  context - The servlet context for the link that is being created.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  wikiLink - The WikiLink object containing all relevant informationabout the link being generated.
Parameters:
  text - The text to display as the link content.
Parameters:
  style - The CSS class to use with the anchor HTML tag. This valuecan be null or empty if no custom style is used.
Parameters:
  target - The anchor link target, or null or empty ifno target is needed.
Parameters:
  escapeHtml - Set to true if the link caption shouldbe HTML escaped. This value should be true in any casewhere the caption is not guaranteed to be free from potentiallymalicious HTML code. An HTML anchor link that matches the given input parameters.
throws:
  Exception - Thrown if any error occurs while builing the linkHTML.



buildInternalLinkUrl
public static String buildInternalLinkUrl(String context, String virtualWiki, String topic) throws Exception(Code)
Build a URL to the topic page for a given topic.
Parameters:
  context - The servlet context path. If this value isnull then the resulting URL will NOT include context path,which breaks HTML links but is useful for servlet redirection URLs.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  topic - The topic name for the URL that is being generated.
throws:
  Exception - Thrown if any error occurs while builing the linkURL.



buildInternalLinkUrl
public static String buildInternalLinkUrl(String context, String virtualWiki, WikiLink wikiLink) throws Exception(Code)
Build a URL to the topic page for a given topic.
Parameters:
  context - The servlet context path. If this value isnull then the resulting URL will NOT include context path,which breaks HTML links but is useful for servlet redirection URLs.
Parameters:
  virtualWiki - The virtual wiki for the link that is being created.
Parameters:
  wikiLink - The WikiLink object containing all relevant informationabout the link being generated.
throws:
  Exception - Thrown if any error occurs while builing the linkURL.



interWiki
public static String interWiki(WikiLink wikiLink)(Code)
Generate the HTML for an interwiki anchor link.
Parameters:
  wikiLink - The WikiLink object containing all relevant informationabout the link being generated. The HTML anchor tag for the interwiki link.



isExistingArticle
public static boolean isExistingArticle(String virtualWiki, String articleName) throws Exception(Code)
Utility method for determining if an article name corresponds to a valid wiki link. In this case an "article name" could be an existing topic, a "Special:" page, a user page, an interwiki link, etc. This method will return true if the given name corresponds to a valid special page, user page, topic, or other existing article.
Parameters:
  virtualWiki - The virtual wiki for the topic being checked.
Parameters:
  articleName - The name of the article that is being checked. true if there is an article that exists for the givenname and virtual wiki.
throws:
  Exception - Thrown if any error occurs during lookup.



parseWikiLink
public static WikiLink parseWikiLink(String raw)(Code)
Parse a topic name of the form "Topic#Section?Query", and return a WikiLink object representing the link.
Parameters:
  raw - The raw topic link text. A WikiLink object that represents the link.



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.