com.aoindustries.website.framework
Class TreePage

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.aoindustries.website.framework.ErrorReportingServlet
              extended by com.aoindustries.website.framework.WebPage
                  extended by com.aoindustries.website.framework.TreePage
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AutoSiteMap

public abstract class TreePage
extends WebPage

Author:
AO Industries, Inc.
See Also:
Serialized Form

Field Summary
static java.lang.String MODE_AUTO
          Indicates the TreePage should automatically select the correct mode, this is the default if the parameter is not provided.
static java.lang.String MODE_GUI
          Indicates the TreePage should display its contents in an interactive format.
static java.lang.String MODE_TEXT
          Indicates the TreePage should display its contents in a text-only format.
static int TREE_LINE_COLOR
          The color of the lines.
static java.lang.String TREEPAGE_MODE
          The parameter name to control the TreePage display mode.
 
Fields inherited from class com.aoindustries.website.framework.WebPage
emptyWebPageArray, reHTMLPattern
 
Fields inherited from class com.aoindustries.website.framework.ErrorReportingServlet
BUFFER_SIZE
 
Constructor Summary
TreePage(LoggerAccessor loggerAccessor)
           
TreePage(LoggerAccessor loggerAccessor, java.lang.Object param)
           
TreePage(WebSiteRequest req)
           
 
Method Summary
 void doGet(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp)
          By default, GET provides no content.
 void doGet(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp)
          The layout is automatically applied to the page, then doGet is called.
protected  void doPost(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp)
          By default, a post request is just sets up the content beginning and calls doPost
 long getLastModified(WebSiteRequest req)
          The getLastModified defaults to -1.
 long getSearchLastModified()
          Gets the last modified time for search indexing.
protected abstract  java.util.List<TreePageData> getTree(WebSiteRequest req)
          Gets the tree to be displayed.
static java.lang.String replaceHTML(java.lang.String S)
           
protected  boolean useCodeFont(WebSiteRequest req)
           
abstract  boolean useSmoothOutline(WebSiteRequest req)
           
 
Methods inherited from class com.aoindustries.website.framework.WebPage
canAccess, doPost, doPostWithSearch, enforceEncryption, equals, equals, generateURLPath, getAdditionalHeaders, getAuthor, getCachedPages, getClassLastModified, getClassLoaderUptime, getContentVAlign, getCopyright, getDescription, getHTMLChainWriter, getHTMLOutputStream, getJavaScriptSrc, getKeywords, getLastModifiedRecursive, getLastModifiedRecursive, getNavImageAlt, getNavImageSuffix, getNavImageURL, getNextPage, getOnloadScript, getPageIndexInParent, getParent, getPreferredContentWidth, getPreviousPage, getRedirectURL, getRootPage, getServletContext, getShortTitle, getTitle, getURLParams, getURLPath, getURLPattern, getWebPage, getWebPage, getWebPage, getWebPage, getWebPageAndChildrenLastModified, getWebPageLayout, getWebPages, getWebSiteRequest, hashCode, includeNavImageAsParent, isHandler, isHandler, loadClass, printLoginForm, printUnauthorizedPage, reportingDoGet, reportingDoPost, reportingGetLastModified, search, showInLocationPath, standardSearch, useEncryption, useNavImage, useSiteMap
 
Methods inherited from class com.aoindustries.website.framework.ErrorReportingServlet
doGet, doPost, getGetCount, getLastModified, getLastModifiedCount, getLogger, getLogger, getLogger, getLoggerAccessor, getPostCount, getUptime, log, log
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, init
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TREE_LINE_COLOR

public static final int TREE_LINE_COLOR
The color of the lines.

See Also:
Constant Field Values

TREEPAGE_MODE

public static final java.lang.String TREEPAGE_MODE
The parameter name to control the TreePage display mode.

See Also:
Constant Field Values

MODE_AUTO

public static final java.lang.String MODE_AUTO
Indicates the TreePage should automatically select the correct mode, this is the default if the parameter is not provided.

See Also:
Constant Field Values

MODE_TEXT

public static final java.lang.String MODE_TEXT
Indicates the TreePage should display its contents in a text-only format.

See Also:
Constant Field Values

MODE_GUI

public static final java.lang.String MODE_GUI
Indicates the TreePage should display its contents in an interactive format.

See Also:
Constant Field Values
Constructor Detail

TreePage

public TreePage(LoggerAccessor loggerAccessor)

TreePage

public TreePage(WebSiteRequest req)

TreePage

public TreePage(LoggerAccessor loggerAccessor,
                java.lang.Object param)
Method Detail

doGet

public void doGet(WebSiteRequest req,
                  javax.servlet.http.HttpServletResponse resp)
           throws javax.servlet.ServletException,
                  java.io.IOException,
                  java.sql.SQLException
Description copied from class: WebPage
The layout is automatically applied to the page, then doGet is called. To not have this automatically applied, override this method. By the time this method is called, security checks, authentication, and redirects have been done.

The first thing this method does is print the frameset if needed. Second, it uses the output cache to quickly print the output if possible. And third, it will call doGet(ChainWriter,WebSiteRequest,HttpServletResponse) with a stream directly out if the first two actions were not taken.

Overrides:
doGet in class WebPage
Throws:
javax.servlet.ServletException
java.io.IOException
java.sql.SQLException
See Also:
WebPage.doGet(ChainWriter,WebSiteRequest,HttpServletResponse)

getSearchLastModified

public long getSearchLastModified()
                           throws java.io.IOException,
                                  java.sql.SQLException
Description copied from class: WebPage
Gets the last modified time for search indexing. The index will be recreated if the search last modified time is changed. If this method returns -1, no search index is built. This defaults to be a call to getLastModified with a null WebSiteRequest.

Overrides:
getSearchLastModified in class WebPage
Throws:
java.io.IOException
java.sql.SQLException

getLastModified

public long getLastModified(WebSiteRequest req)
Description copied from class: WebPage
The getLastModified defaults to -1.

Overrides:
getLastModified in class WebPage

doGet

public void doGet(com.aoindustries.io.ChainWriter out,
                  WebSiteRequest req,
                  javax.servlet.http.HttpServletResponse resp)
           throws java.io.IOException,
                  java.sql.SQLException
Description copied from class: WebPage
By default, GET provides no content.

Overrides:
doGet in class WebPage
Parameters:
out - the ChainWriter to send output to
req - the current WebSiteRequest
resp - the HttpServletResponse for this request, is null when searching
Throws:
java.io.IOException
java.sql.SQLException

doPost

protected void doPost(WebSiteRequest req,
                      javax.servlet.http.HttpServletResponse resp)
               throws java.io.IOException,
                      java.sql.SQLException
Description copied from class: WebPage
By default, a post request is just sets up the content beginning and calls doPost

Overrides:
doPost in class WebPage
Parameters:
req - the current WebSiteRequest
resp - the HttpServletResponse for this request
Throws:
java.io.IOException
java.sql.SQLException
See Also:
WebPage.doPost(ChainWriter,WebSiteRequest,HttpServletResponse)

getTree

protected abstract java.util.List<TreePageData> getTree(WebSiteRequest req)
                                                 throws java.io.IOException,
                                                        java.sql.SQLException
Gets the tree to be displayed. Each row consists of three elements: path, href, description

Throws:
java.io.IOException
java.sql.SQLException

useCodeFont

protected boolean useCodeFont(WebSiteRequest req)

useSmoothOutline

public abstract boolean useSmoothOutline(WebSiteRequest req)

replaceHTML

public static java.lang.String replaceHTML(java.lang.String S)