com.wallstreetwise.app.jspell.domain.net
Class JSpellTools

java.lang.Object
  extended by com.wallstreetwise.app.jspell.domain.net.JSpellTools
Direct Known Subclasses:
JSpellHTMLTools, JSpellIFrameTools

public class JSpellTools
extends java.lang.Object

The base class for the JSpellHTMLTools and JSpellIFrameTools classes.

Author:
clifford_admin

Field Summary
protected  boolean bannerPrinted
          A boolean indicating whether the copyright banner has been displayed.
protected  java.lang.String defaultProxy
          Specifies the URL for the spell checker.
 java.lang.String dictionaryPath
          Path to dictionary files.
static java.lang.String fileSeparator
          The operating system file separator constant.
protected  boolean IFrameValidator
          Boolean indicating whether an IFrame is being spell checked.
static byte[] indexDataArray
          A byte array that holds the default JSpell dictionary file for the JSpell HTML and JSpell IFrame products.
 boolean indexReady
          Index opened successfully?
protected  java.lang.String softwareID
          Implemented by subclasses to specify HTML or IFrame spell checker version.
 
Constructor Summary
protected JSpellTools()
          Creates a new instance of JSpellTools
 
Method Summary
 java.lang.String getImagePath(javax.servlet.ServletRequest request)
          Returns the URL of the images for the non direct edit version of JSpell HTML 2004.
 java.lang.String getLanguage(javax.servlet.ServletRequest request)
          Returns the language of the spell check request.
 java.lang.String getProxy(javax.servlet.http.HttpServletRequest request)
          Gets proxy URL if specified, or URL of JSpell.jsp.
 java.lang.String getStyleSheetURL(javax.servlet.http.HttpServletRequest request)
          Returns the URL of the style sheet URL.
 java.lang.String getSupplementalDictionary(javax.servlet.ServletRequest request)
          Returns the words in the supplemental dictionary.
 void indexSetup(javax.servlet.ServletConfig config, java.lang.String dictionaryOverride)
          Initializes the dictionaries.
 java.lang.String loadSupplementalDictionary(java.lang.String supplementalDictionary)
          Loads a list of words to ignore for purposes of spell checking.
 void printBanner(javax.servlet.ServletConfig config)
          Prints the copyright banner for JSpell HTML 2004.
static void setCache(javax.servlet.http.HttpServletResponse response)
          Sets the cache response header.
 boolean testWrite(java.lang.String directory)
          Check if a directory can be written to.
 void useBackupMethod()
          If jspellLexicons has not been specified or is inaccessible then attempt to create JSpell dictionary using internal copy of dictionary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

softwareID

protected java.lang.String softwareID
Implemented by subclasses to specify HTML or IFrame spell checker version.


IFrameValidator

protected boolean IFrameValidator
Boolean indicating whether an IFrame is being spell checked.


defaultProxy

protected java.lang.String defaultProxy
Specifies the URL for the spell checker.


indexDataArray

public static byte[] indexDataArray
A byte array that holds the default JSpell dictionary file for the JSpell HTML and JSpell IFrame products.


fileSeparator

public static java.lang.String fileSeparator
The operating system file separator constant.


indexReady

public boolean indexReady
Index opened successfully?


dictionaryPath

public java.lang.String dictionaryPath
Path to dictionary files.


bannerPrinted

protected boolean bannerPrinted
A boolean indicating whether the copyright banner has been displayed.

Constructor Detail

JSpellTools

protected JSpellTools()
Creates a new instance of JSpellTools

Method Detail

printBanner

public void printBanner(javax.servlet.ServletConfig config)
Prints the copyright banner for JSpell HTML 2004.

Parameters:
config - a ServletConfig object.

loadSupplementalDictionary

public java.lang.String loadSupplementalDictionary(java.lang.String supplementalDictionary)
Loads a list of words to ignore for purposes of spell checking. The parameter specifies the name of the dictionary file. Using this approach, multiple permanent ignore lists can be maintained, e.g., each user or client could have a separate ignore list.

Parameters:
supplementalDictionary - a String.
Returns:
a String.

indexSetup

public void indexSetup(javax.servlet.ServletConfig config,
                       java.lang.String dictionaryOverride)
Initializes the dictionaries.

Parameters:
config - a ServletConfig object.
dictionaryOverride - a String - optional path to directory containing JSpell dictionary files.

useBackupMethod

public void useBackupMethod()
If jspellLexicons has not been specified or is inaccessible then attempt to create JSpell dictionary using internal copy of dictionary.


testWrite

public boolean testWrite(java.lang.String directory)
Check if a directory can be written to.

Parameters:
directory - The directory to test.
Returns:
true or false.

getStyleSheetURL

public java.lang.String getStyleSheetURL(javax.servlet.http.HttpServletRequest request)
                                  throws java.lang.Exception
Returns the URL of the style sheet URL.

Parameters:
request - an HttpServletRequest object.
Returns:
a String.
Throws:
java.lang.Exception - an Exception object.

getSupplementalDictionary

public java.lang.String getSupplementalDictionary(javax.servlet.ServletRequest request)
                                           throws java.lang.Exception
Returns the words in the supplemental dictionary.

Parameters:
request - a ServletRequest object.
Returns:
a String.
Throws:
java.lang.Exception - an Exception object.

getLanguage

public java.lang.String getLanguage(javax.servlet.ServletRequest request)
                             throws java.lang.Exception
Returns the language of the spell check request.

Parameters:
request - a ServletRequest object.
Returns:
a String.
Throws:
java.lang.Exception - an Exception object.

getImagePath

public java.lang.String getImagePath(javax.servlet.ServletRequest request)
                              throws java.lang.Exception
Returns the URL of the images for the non direct edit version of JSpell HTML 2004.

Parameters:
request - a ServletRequest object.
Returns:
a String.
Throws:
java.lang.Exception - an Exception object.

getProxy

public java.lang.String getProxy(javax.servlet.http.HttpServletRequest request)
Gets proxy URL if specified, or URL of JSpell.jsp.

Parameters:
request - an HttpServletRequest object.
Returns:
a String.

setCache

public static void setCache(javax.servlet.http.HttpServletResponse response)
Sets the cache response header.

Parameters:
response - an HttpServletResponse object.


JSpell SDK 2004 Spell Checker for the Java (tm) Platform
Copyright © 1996-2005 The Solution Cafe Inc, All Rights Reserved - http://www.thesolutioncafe.com