com.aoindustries.website.framework
Class WebPageLayout

java.lang.Object
  extended by com.aoindustries.website.framework.WebPageLayout
Direct Known Subclasses:
TextOnlyLayout

public abstract class WebPageLayout
extends java.lang.Object

A WebPageLayout controls how a WebPage looks while providing a little isolation from the code that provides the functionality.

Author:
AO Industries, Inc.

Field Summary
static int DOWN
          Directional references.
static int NONE
          Directional references.
static int UP
          Directional references.
static int UP_AND_DOWN
          Directional references.
 
Constructor Summary
WebPageLayout(java.lang.String[] layoutChoices)
           
 
Method Summary
 void beginLightArea(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, com.aoindustries.io.ChainWriter out)
          Begins a lighter colored area of the site.
abstract  void beginLightArea(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, com.aoindustries.io.ChainWriter out, java.lang.String width, boolean nowrap)
          Begins a lighter colored area of the site.
 void beginWhiteArea(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, com.aoindustries.io.ChainWriter out)
          Begins an area with a white background.
abstract  void beginWhiteArea(WebSiteRequest req, javax.servlet.http.HttpServletResponse response, com.aoindustries.io.ChainWriter out, java.lang.String width, boolean nowrap)
          Begins a lighter colored area of the site.
 void endContent(WebPage page, com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int contentColumns)
          Ends the content area of a page.
abstract  void endContent(WebPage page, com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int[] contentColumnSpans)
          Ends the content area of a page.
abstract  void endContentLine(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int rowspan, boolean endsInternal)
          Ends one line of content.
abstract  void endHTML(WebPage page, WebSiteRequest req, com.aoindustries.io.ChainWriter out)
          Writes all of the HTML following the content of the page, whether the page is in a frameset or not.
abstract  void endLightArea(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, com.aoindustries.io.ChainWriter out)
          Ends a lighter area of the site.
abstract  void endWhiteArea(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, com.aoindustries.io.ChainWriter out)
          Ends a lighter area of the site.
 int getActiveLinkColor(WebSiteRequest req)
          The active link color for the page or -1 for browser default.
 int getBackgroundColor(WebSiteRequest req)
          The background color for the page or -1 for browser default.
 java.lang.String[] getLayoutChoices()
          Gets the names of every supported layout.
 int getLinkColor(WebSiteRequest req)
          The link color for the page or -1 for browser default.
abstract  java.lang.String getName()
          Each layout has a name.
 int getTextColor(WebSiteRequest req)
          The text color for the page or -1 for browser default.
 int getVisitedLinkColor(WebSiteRequest req)
          The visited link color for the page or -1 for browser default.
abstract  void printContentHorizontalDivider(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int[] colspansAndDirections, boolean endsInternal)
          Prints a horizontal divider of the provided colspan.
 void printContentHorizontalDivider(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int colspan, boolean endsInternal)
          Prints a horizontal divider of the provided colspan.
abstract  void printContentTitle(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String title, int contentColumns)
          Prints the title of the page in one row in the content area.
 void printContentTitle(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, WebPage page, int contentColumns)
          Prints the title of the page in one row in the content area.
abstract  void printContentVerticalDivider(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int direction, int colspan, int rowspan, java.lang.String align, java.lang.String width)
          Ends one part of a line and starts the next.
protected  void printJavaScriptIncludes(WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, com.aoindustries.io.ChainWriter out, WebPage page)
           
 void printSearchOutput(WebPage page, com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String query, boolean isEntireSite, java.util.List<SearchResult> results, java.lang.String[] words)
          Prints the content HTML that shows the output of a search.
 boolean printWebPageLayoutSelector(WebPage page, com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp)
           
abstract  void startContent(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int[] contentColumnSpans, int preferredWidth)
          Starts the content area of a page.
 void startContent(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int contentColumns, int preferredWidth)
          Starts the content area of a page.
abstract  void startContentLine(com.aoindustries.io.ChainWriter out, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, int colspan, java.lang.String align, java.lang.String width)
          Starts one line of content with the initial colspan set to the provided colspan.
abstract  void startHTML(WebPage page, WebSiteRequest req, javax.servlet.http.HttpServletResponse resp, com.aoindustries.io.ChainWriter out, java.lang.String onload)
          Writes all of the HTML preceeding the content of the page, whether the page is in a frameset or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Directional references.

See Also:
Constant Field Values

UP

public static final int UP
Directional references.

See Also:
Constant Field Values

DOWN

public static final int DOWN
Directional references.

See Also:
Constant Field Values

UP_AND_DOWN

public static final int UP_AND_DOWN
Directional references.

See Also:
Constant Field Values
Constructor Detail

WebPageLayout

public WebPageLayout(java.lang.String[] layoutChoices)
Method Detail

getLayoutChoices

public final java.lang.String[] getLayoutChoices()
Gets the names of every supported layout. The layout at index 0 is the default.


startHTML

public abstract void startHTML(WebPage page,
                               WebSiteRequest req,
                               javax.servlet.http.HttpServletResponse resp,
                               com.aoindustries.io.ChainWriter out,
                               java.lang.String onload)
                        throws java.io.IOException,
                               java.sql.SQLException
Writes all of the HTML preceeding the content of the page, whether the page is in a frameset or not.

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

endHTML

public abstract void endHTML(WebPage page,
                             WebSiteRequest req,
                             com.aoindustries.io.ChainWriter out)
                      throws java.io.IOException,
                             java.sql.SQLException
Writes all of the HTML following the content of the page, whether the page is in a frameset or not.

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

printSearchOutput

public void printSearchOutput(WebPage page,
                              com.aoindustries.io.ChainWriter out,
                              WebSiteRequest req,
                              javax.servlet.http.HttpServletResponse resp,
                              java.lang.String query,
                              boolean isEntireSite,
                              java.util.List<SearchResult> results,
                              java.lang.String[] words)
                       throws java.io.IOException,
                              java.sql.SQLException
Prints the content HTML that shows the output of a search. This output must include an additional search form named "search_two", with two fields named "search_query" and "search_target".

Throws:
java.io.IOException
java.sql.SQLException
See Also:
WebPage.doPostWithSearch(WebSiteRequest,HttpServletResponse)

startContent

public final void startContent(com.aoindustries.io.ChainWriter out,
                               WebSiteRequest req,
                               javax.servlet.http.HttpServletResponse resp,
                               int contentColumns,
                               int preferredWidth)
                        throws java.io.IOException,
                               java.sql.SQLException
Starts the content area of a page.

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

startContent

public abstract void startContent(com.aoindustries.io.ChainWriter out,
                                  WebSiteRequest req,
                                  javax.servlet.http.HttpServletResponse resp,
                                  int[] contentColumnSpans,
                                  int preferredWidth)
                           throws java.io.IOException,
                                  java.sql.SQLException
Starts the content area of a page.

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

printContentHorizontalDivider

public final void printContentHorizontalDivider(com.aoindustries.io.ChainWriter out,
                                                WebSiteRequest req,
                                                javax.servlet.http.HttpServletResponse resp,
                                                int colspan,
                                                boolean endsInternal)
                                         throws java.io.IOException,
                                                java.sql.SQLException
Prints a horizontal divider of the provided colspan.

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

printContentHorizontalDivider

public abstract void printContentHorizontalDivider(com.aoindustries.io.ChainWriter out,
                                                   WebSiteRequest req,
                                                   javax.servlet.http.HttpServletResponse resp,
                                                   int[] colspansAndDirections,
                                                   boolean endsInternal)
                                            throws java.io.IOException,
                                                   java.sql.SQLException
Prints a horizontal divider of the provided colspan.

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

printContentTitle

public final void printContentTitle(com.aoindustries.io.ChainWriter out,
                                    WebSiteRequest req,
                                    javax.servlet.http.HttpServletResponse resp,
                                    WebPage page,
                                    int contentColumns)
                             throws java.io.IOException,
                                    java.sql.SQLException
Prints the title of the page in one row in the content area.

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

printContentTitle

public abstract void printContentTitle(com.aoindustries.io.ChainWriter out,
                                       WebSiteRequest req,
                                       javax.servlet.http.HttpServletResponse resp,
                                       java.lang.String title,
                                       int contentColumns)
                                throws java.io.IOException,
                                       java.sql.SQLException
Prints the title of the page in one row in the content area.

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

startContentLine

public abstract void startContentLine(com.aoindustries.io.ChainWriter out,
                                      WebSiteRequest req,
                                      javax.servlet.http.HttpServletResponse resp,
                                      int colspan,
                                      java.lang.String align,
                                      java.lang.String width)
                               throws java.io.IOException,
                                      java.sql.SQLException
Starts one line of content with the initial colspan set to the provided colspan.

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

printContentVerticalDivider

public abstract void printContentVerticalDivider(com.aoindustries.io.ChainWriter out,
                                                 WebSiteRequest req,
                                                 javax.servlet.http.HttpServletResponse resp,
                                                 int direction,
                                                 int colspan,
                                                 int rowspan,
                                                 java.lang.String align,
                                                 java.lang.String width)
                                          throws java.io.IOException,
                                                 java.sql.SQLException
Ends one part of a line and starts the next.

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

endContentLine

public abstract void endContentLine(com.aoindustries.io.ChainWriter out,
                                    WebSiteRequest req,
                                    javax.servlet.http.HttpServletResponse resp,
                                    int rowspan,
                                    boolean endsInternal)
                             throws java.io.IOException,
                                    java.sql.SQLException
Ends one line of content.

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

endContent

public final void endContent(WebPage page,
                             com.aoindustries.io.ChainWriter out,
                             WebSiteRequest req,
                             javax.servlet.http.HttpServletResponse resp,
                             int contentColumns)
                      throws java.io.IOException,
                             java.sql.SQLException
Ends the content area of a page.

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

endContent

public abstract void endContent(WebPage page,
                                com.aoindustries.io.ChainWriter out,
                                WebSiteRequest req,
                                javax.servlet.http.HttpServletResponse resp,
                                int[] contentColumnSpans)
                         throws java.io.IOException,
                                java.sql.SQLException
Ends the content area of a page.

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

getBackgroundColor

public int getBackgroundColor(WebSiteRequest req)
The background color for the page or -1 for browser default.


getTextColor

public int getTextColor(WebSiteRequest req)
The text color for the page or -1 for browser default.


getLinkColor

public int getLinkColor(WebSiteRequest req)
The link color for the page or -1 for browser default.


getVisitedLinkColor

public int getVisitedLinkColor(WebSiteRequest req)
The visited link color for the page or -1 for browser default.


getActiveLinkColor

public int getActiveLinkColor(WebSiteRequest req)
The active link color for the page or -1 for browser default.


beginLightArea

public final void beginLightArea(WebSiteRequest req,
                                 javax.servlet.http.HttpServletResponse resp,
                                 com.aoindustries.io.ChainWriter out)
                          throws java.io.IOException
Begins a lighter colored area of the site.

Throws:
java.io.IOException

beginLightArea

public abstract void beginLightArea(WebSiteRequest req,
                                    javax.servlet.http.HttpServletResponse resp,
                                    com.aoindustries.io.ChainWriter out,
                                    java.lang.String width,
                                    boolean nowrap)
                             throws java.io.IOException
Begins a lighter colored area of the site.

Throws:
java.io.IOException

endLightArea

public abstract void endLightArea(WebSiteRequest req,
                                  javax.servlet.http.HttpServletResponse resp,
                                  com.aoindustries.io.ChainWriter out)
                           throws java.io.IOException
Ends a lighter area of the site.

Throws:
java.io.IOException

beginWhiteArea

public final void beginWhiteArea(WebSiteRequest req,
                                 javax.servlet.http.HttpServletResponse resp,
                                 com.aoindustries.io.ChainWriter out)
                          throws java.io.IOException
Begins an area with a white background.

Throws:
java.io.IOException

beginWhiteArea

public abstract void beginWhiteArea(WebSiteRequest req,
                                    javax.servlet.http.HttpServletResponse response,
                                    com.aoindustries.io.ChainWriter out,
                                    java.lang.String width,
                                    boolean nowrap)
                             throws java.io.IOException
Begins a lighter colored area of the site.

Throws:
java.io.IOException

endWhiteArea

public abstract void endWhiteArea(WebSiteRequest req,
                                  javax.servlet.http.HttpServletResponse resp,
                                  com.aoindustries.io.ChainWriter out)
                           throws java.io.IOException
Ends a lighter area of the site.

Throws:
java.io.IOException

getName

public abstract java.lang.String getName()
Each layout has a name.


printWebPageLayoutSelector

public boolean printWebPageLayoutSelector(WebPage page,
                                          com.aoindustries.io.ChainWriter out,
                                          WebSiteRequest req,
                                          javax.servlet.http.HttpServletResponse resp)
                                   throws java.io.IOException,
                                          java.sql.SQLException
Throws:
java.io.IOException
java.sql.SQLException

printJavaScriptIncludes

protected void printJavaScriptIncludes(WebSiteRequest req,
                                       javax.servlet.http.HttpServletResponse resp,
                                       com.aoindustries.io.ChainWriter out,
                                       WebPage page)
                                throws java.io.IOException,
                                       java.sql.SQLException
Throws:
java.io.IOException
java.sql.SQLException