Java Doc for FormattedText.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » util » 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 » ERP CRM Financial » sakai » org.sakaiproject.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.sakaiproject.util.FormattedText

FormattedText
public class FormattedText (Code)
FormattedText provides support for user entry of formatted text; the formatted text is HTML. This includes text formatting in user input such as bold, underline, and fonts.




Method Summary
public static  StringconvertFormattedTextToPlaintext(String value)
     Converts the given HTML formatted text to plain text - loses formatting information.
public static  StringconvertOldFormattedText(String value)
     Converts old-style formatted text to the new style.
public static  StringconvertPlaintextToFormattedText(String value)
     Converts the given plain text into HTML formatted text.
public static  StringdecodeFormattedTextAttribute(Element element, String baseAttributeName)
     Retrieves a formatted text attribute from an XML element; converts from older forms of formatted text or plaintext, if found.
public static  StringdecodeNumericCharacterReferences(String value)
    
public static  voidencodeFormattedTextAttribute(Element element, String baseAttributeName, String value)
     Store the given formatted text in the given XML element; stores both a formatted text representation, and a plaintext representation (plaintext means the formatting has been stripped).
public static  StringencodeUnicode(String value)
     Returns a String with characters above 128 as entity references.
Parameters:
  value - The text to encode.
public static  StringescapeHtml(String value, boolean escapeNewlines)
     Escape the given value so that it appears as-is in HTML - that is, HTML meta-characters like '<' are escaped to HTML character entity references like '<'.
public static  StringescapeHtmlFormattedText(String value)
     Prepares the given HTML formatted text for output as part of an HTML document.
Parameters:
  value - The formatted text to output in an HTML document.
public static  StringescapeHtmlFormattedTextSupressNewlines(String value)
     Prepares the given HTML formatted text for output as part of an HTML document, removing newlines ("<br />").
Parameters:
  value - The formatted text to output in an HTML document.
public static  StringescapeHtmlFormattedTextarea(String value)
     Prepares the given formatted text for editing within the WYSIWYG editor.
public static  StringprocessAnchor(String anchor)
     Returns a String with HTML anchor normalized to include only href and target="_blank" for safe display by a browser.
Parameters:
  anchor - The anchor tag to be normalized.
public static  StringprocessEscapedHtml(String source)
     Processes and validates character data as HTML.
public static  StringprocessFormattedText(String strFromBrowser, StringBuffer errorMessages)
     Processes and validates user-entered HTML received from the web browser (from the WYSIWYG editor).
public static  StringprocessFormattedText(String strFromBrowser, StringBuffer errorMessages, boolean checkForEvilTags, boolean replaceWhitespaceTags)
     Processes and validates HTML formatted text received from the web browser (from the WYSIWYG editor).
public static  StringprocessHtmlDocument(String strFromBrowser, StringBuffer errorMessages)
     Process an HTML document that has been edited using the formatted text widget.
public static  booleantrimFormattedText(String formattedText, int maxNumOfChars, StringBuffer strTrimmed)
     Trims a formatted text string to the given maximum number of displayed characters, preserving formatting.
public static  StringunEscapeHtml(String value)
     Returns a String with HTML entity references converted to characters suitable for processing as formatted text.
Parameters:
  value - The text containing entity references (e.g., a News item description).



Method Detail
convertFormattedTextToPlaintext
public static String convertFormattedTextToPlaintext(String value)(Code)
Converts the given HTML formatted text to plain text - loses formatting information. For example, The formatted text "Hello <br /> <b>World!</b>" becomes plain text "Hello \nWorld!" Strips all formatting information from the formatted text
Parameters:
  value - The formatted text to convert The plain text (all formatting removed)



convertOldFormattedText
public static String convertOldFormattedText(String value)(Code)
Converts old-style formatted text to the new style. Previous to Sakai release 1.5, displayed line breaks were stored as "\n". Now, displayed like breaks are properly stored in the HTML-standard way as "
". This method converts from the previous form.
Parameters:
  value -



convertPlaintextToFormattedText
public static String convertPlaintextToFormattedText(String value)(Code)
Converts the given plain text into HTML formatted text. Conversion to formatted text involves escaping characters that are used for formatting (such as the '<' character). Also converts plaintext line breaks into HTML line breaks ("
").
Parameters:
  value - The plain text to convert to formatted text The converted plain text, now as formatted text



decodeFormattedTextAttribute
public static String decodeFormattedTextAttribute(Element element, String baseAttributeName)(Code)
Retrieves a formatted text attribute from an XML element; converts from older forms of formatted text or plaintext, if found. For example, if the baseAttributeName "foo" is specified, the attribute "foo-html" will be looked for first, and then "foo-formatted", and finally just "foo" (plaintext).
Parameters:
  element - The XML element from which to retrieve the formatted text attribute
Parameters:
  baseAttributeName - The base attribute name of the formatted text attribute



decodeNumericCharacterReferences
public static String decodeNumericCharacterReferences(String value)(Code)
decode any HTML Numeric Character References of the style: &#Xhexnumber; or &#decimalnumber; or of our own special style: ^^Xhexnumber^ or ^^decimalnumber^



encodeFormattedTextAttribute
public static void encodeFormattedTextAttribute(Element element, String baseAttributeName, String value)(Code)
Store the given formatted text in the given XML element; stores both a formatted text representation, and a plaintext representation (plaintext means the formatting has been stripped).



encodeUnicode
public static String encodeUnicode(String value)(Code)
Returns a String with characters above 128 as entity references.
Parameters:
  value - The text to encode. The encoded text.



escapeHtml
public static String escapeHtml(String value, boolean escapeNewlines)(Code)
Escape the given value so that it appears as-is in HTML - that is, HTML meta-characters like '<' are escaped to HTML character entity references like '<'. Markup, amper, quote are escaped. Whitespace is not.
Parameters:
  value - The string to escape.
Parameters:
  escapeNewlines - Whether to escape newlines as "<br />\n" so that they appear as HTML line breaks. value fully escaped for HTML.



escapeHtmlFormattedText
public static String escapeHtmlFormattedText(String value)(Code)
Prepares the given HTML formatted text for output as part of an HTML document.
Parameters:
  value - The formatted text to output in an HTML document. The string to include in an HTML document.



escapeHtmlFormattedTextSupressNewlines
public static String escapeHtmlFormattedTextSupressNewlines(String value)(Code)
Prepares the given HTML formatted text for output as part of an HTML document, removing newlines ("<br />").
Parameters:
  value - The formatted text to output in an HTML document. The string to include in an HTML document.



escapeHtmlFormattedTextarea
public static String escapeHtmlFormattedTextarea(String value)(Code)
Prepares the given formatted text for editing within the WYSIWYG editor. All HTML meta-characters in the string will be escaped.
Parameters:
  value - The formatted text to escape The string to use as the value of the formatted textarea widget



processAnchor
public static String processAnchor(String anchor)(Code)
Returns a String with HTML anchor normalized to include only href and target="_blank" for safe display by a browser.
Parameters:
  anchor - The anchor tag to be normalized. The anchor tag containing only href and target="_blank".



processEscapedHtml
public static String processEscapedHtml(String source)(Code)
Processes and validates character data as HTML. Disallows dangerous stuff such as <SCRIPT> JavaScript tags. Encodes the text according to the formatted text specification, for the rest of the system to use.
Parameters:
  source - The escaped HTML (e.g., from the News service) The validated processed formatted text, ready for use by the system.



processFormattedText
public static String processFormattedText(String strFromBrowser, StringBuffer errorMessages)(Code)
Processes and validates user-entered HTML received from the web browser (from the WYSIWYG editor). Validates that the user input follows the Sakai formatted text specification; disallows dangerous stuff such as <SCRIPT> JavaScript tags. Encodes the text according to the formatted text specification, for the rest of the system to use.
Parameters:
  strFromBrowser - The formatted text as sent from the web browser (from the WYSIWYG editor)
Parameters:
  errorMessages - User-readable error messages will be returned here. The validated processed formatted text, ready for use by the system.



processFormattedText
public static String processFormattedText(String strFromBrowser, StringBuffer errorMessages, boolean checkForEvilTags, boolean replaceWhitespaceTags)(Code)
Processes and validates HTML formatted text received from the web browser (from the WYSIWYG editor). Validates that the user input follows the Sakai formatted text specification; can disallow dangerous stuff such as <SCRIPT> JavaScript tags. Encodes the text according to the formatted text specification, for the rest of the system to use.
Parameters:
  strFromBrowser - The formatted text as sent from the web browser (from the WYSIWYG editor)
Parameters:
  errorMessages - User-readable error messages will be returned here.
Parameters:
  checkForEvilTags - If true, check for tags and attributes that shouldn't be in formatted text
Parameters:
  replaceWhitespaceTags - If true, clean up line breaks to be like "<br />". The validated processed HTML formatted text, ready for use by the system.



processHtmlDocument
public static String processHtmlDocument(String strFromBrowser, StringBuffer errorMessages)(Code)
Process an HTML document that has been edited using the formatted text widget. The document can contain any valid HTML; it will NOT be checked to eliminate things like image tags, script tags, etc, because it is its own document.
Parameters:
  strFromBrowser -
Parameters:
  errorMessages -



trimFormattedText
public static boolean trimFormattedText(String formattedText, int maxNumOfChars, StringBuffer strTrimmed)(Code)
Trims a formatted text string to the given maximum number of displayed characters, preserving formatting. For example, trim("Hello & World!", 9) returns "Hello & W" Ignores HTML comments like ""
Parameters:
  formattedText - The formatted text to trim
Parameters:
  maxNumOfChars - The maximum number of displayed characters in the returned trimmed formatted text.
Parameters:
  strTrimmed - A StringBuffer to hold the trimmed formatted text true If the formatted text was trimmed



unEscapeHtml
public static String unEscapeHtml(String value)(Code)
Returns a String with HTML entity references converted to characters suitable for processing as formatted text.
Parameters:
  value - The text containing entity references (e.g., a News item description). The HTML, ready for processing.



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.