org.histpop.ohpr.frames
Class PageBrowserFrame2

java.lang.Object
  extended by org.histpop.ohpr.frames.PageBrowserFrame
      extended by org.histpop.ohpr.frames.PageBrowserFrame2
All Implemented Interfaces:
BasicFrame

public class PageBrowserFrame2
extends PageBrowserFrame

A frame class for generating a view of a target page image (Search version) for a master number item. The view is created from a HTML template. The template contains some placeholders which are replaced by dynamically generated HTML-code for the final output.


Field Summary
static java.lang.String DEFAULT_DATE
           
static java.lang.String DEFAULT_EXPRESSION_KIND
           
static java.lang.String[] DEFAULT_GEOGRAPHY
           
static java.lang.String DEFAULT_SEARCH_CONTENT
           
static java.lang.String DEFAULT_SORTING
           
static java.lang.String GEOGRAPHY_ALL
           
static java.lang.String SIMPLE_YES
           
 
Fields inherited from class org.histpop.ohpr.frames.PageBrowserFrame
DEFAULT_ZOOM_FACTOR, ROTATE, ZOOM
 
Constructor Summary
PageBrowserFrame2()
           
 
Method Summary
protected  java.lang.String createAssociatedContentURL(Page page, PageQueryState pagesState, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Generate a URL containing all the arguments for the LH menu browse tree and the target page for an associated content page (Search Version).
protected  java.lang.String createDownloadsURL(Page page, PageQueryState pagesState, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Generate a URL containing all the arguments for the LH menu browse tree and the target page for the Download page.
protected  java.lang.String createPageURL(SectionQueryNode node, boolean useSections, boolean useTables, boolean usePageTitles, java.lang.String pageSeq, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Create a URL for the target page browser.
protected  java.lang.String createPageURL(SectionQueryState sectionsState, boolean useSections, boolean useTables, boolean usePageTitles, java.lang.String pageSeq, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Create a URL for the target page browser.
 HTMLHandler display(java.lang.Object result, ServerContext ctx)
          Create an HTML view for browsing requests.
protected static java.lang.String generateGotoPageForm(Page page, PageQueryState pagesState, java.lang.String zoom, java.lang.String[] resourceType, java.lang.String searchTerms, java.lang.String searchContent, java.lang.String expressionKind, java.lang.String date, java.lang.String[] geography, java.lang.String sorting)
          Generate a Goto Page form.
protected  java.lang.String generateNextHitPageLink(Page page, PageQueryState pagesState, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Generate XHTML code for the next page link.
protected  java.lang.String generatePreviousHitPageLink(Page page, PageQueryState pagesState, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Generate XHTML code for the previous page link.
protected  java.lang.String generateTOCLink(SectionQueryNode node, ServerContext ctx)
          Generate a Table of Contents link.
 
Methods inherited from class org.histpop.ohpr.frames.PageBrowserFrame
findImagesDir, findImageSize, findPage, generateAssociatedContentLink, generateDownloadItems, generateDownloadsLink, generateGotoPageForm, generateImageLink, generateImageQuality, generateLocalSections, generateNextPageLink, generatePreviousPageLink, generatePrintFriendlyLink, generateRotateLink, generateZoomLink, removedArg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SEARCH_CONTENT

public static final java.lang.String DEFAULT_SEARCH_CONTENT
See Also:
Constant Field Values

DEFAULT_EXPRESSION_KIND

public static final java.lang.String DEFAULT_EXPRESSION_KIND
See Also:
Constant Field Values

DEFAULT_DATE

public static final java.lang.String DEFAULT_DATE
See Also:
Constant Field Values

DEFAULT_GEOGRAPHY

public static final java.lang.String[] DEFAULT_GEOGRAPHY

GEOGRAPHY_ALL

public static final java.lang.String GEOGRAPHY_ALL
See Also:
Constant Field Values

DEFAULT_SORTING

public static final java.lang.String DEFAULT_SORTING
See Also:
Constant Field Values

SIMPLE_YES

public static final java.lang.String SIMPLE_YES
See Also:
Constant Field Values
Constructor Detail

PageBrowserFrame2

public PageBrowserFrame2()
Method Detail

createPageURL

protected java.lang.String createPageURL(SectionQueryNode node,
                                         boolean useSections,
                                         boolean useTables,
                                         boolean usePageTitles,
                                         java.lang.String pageSeq,
                                         java.lang.String zoom,
                                         java.lang.String rotate,
                                         ServerContext ctx)
Create a URL for the target page browser.

Overrides:
createPageURL in class PageBrowserFrame
Parameters:
node - A node from the sections tree.
useSections - true if to include 'display=sections', only relevant when returning to the TOC from a target page.
useTables - true if to include 'display=tables', only relevant when returning to the TOC from a target page.
usePageTitles - true if to include 'display=pagetitles', only relevant when returning to the TOC from a target page.
pageSeq - The page sequence number.
zoom - The zooming level for the target page image. Possible values are from "1" to "5". Default is "3".
rotate - The rotation value for the target page image. Possible values are "0", "90", "180", "270" degrees. Default is "0" degrees.
ctx - The server context containing the request, response, and current session objects. Not used here.
Returns:
A URL for the target page browser.

createPageURL

protected java.lang.String createPageURL(SectionQueryState sectionsState,
                                         boolean useSections,
                                         boolean useTables,
                                         boolean usePageTitles,
                                         java.lang.String pageSeq,
                                         java.lang.String zoom,
                                         java.lang.String rotate,
                                         ServerContext ctx)
Create a URL for the target page browser.

Overrides:
createPageURL in class PageBrowserFrame
Parameters:
sectionsState - The session object containing the whole sections tree.
useSections - true if to include 'display=sections', only relevant when returning to the TOC from a target page.
useTables - true if to include 'display=tables', only relevant when returning to the TOC from a target page.
usePageTitles - true if to include 'display=pagetitles', only relevant when returning to the TOC from a target page.
pageSeq - The page sequence number.
zoom - The zooming level for the target page image. Possible values are from "1" to "5". Default is "3".
rotate - The rotation value for the target page image. Possible values are "0", "90", "180", "270" degrees. Default is "0" degrees.
ctx - The server context containing the request, response, and current session objects. Not used here.
Returns:
A URL for the target page browser.

generateGotoPageForm

protected static java.lang.String generateGotoPageForm(Page page,
                                                       PageQueryState pagesState,
                                                       java.lang.String zoom,
                                                       java.lang.String[] resourceType,
                                                       java.lang.String searchTerms,
                                                       java.lang.String searchContent,
                                                       java.lang.String expressionKind,
                                                       java.lang.String date,
                                                       java.lang.String[] geography,
                                                       java.lang.String sorting)
Generate a Goto Page form.

Parameters:
page - The current page.
pagesState - A session cache containing among others all the pages
zoom - The zooming level for the target page image. Possible values are from "1" to "5". Default is "3".
resourceType - The resource types as submitted by the original search form.
searchTerms - The search terms as submitted by the original search form.
searchContent - The search content as submitted by the original search form.
expressionKind - The expression kind as submitted by the original search form.
date - The date as submitted by the original search form.
geography - The geographies as submitted by the original search form.
sorting - The sorting order as submitted by the original search form.
Returns:
An XHTML form

generateTOCLink

protected java.lang.String generateTOCLink(SectionQueryNode node,
                                           ServerContext ctx)
Generate a Table of Contents link.

Overrides:
generateTOCLink in class PageBrowserFrame
Parameters:
node - The sections tree node to be used as a dynamic anchor point.
ctx - The server context containing the request, response, and current session objects.
Returns:
A link to the Table of Content.

createAssociatedContentURL

protected java.lang.String createAssociatedContentURL(Page page,
                                                      PageQueryState pagesState,
                                                      java.lang.String zoom,
                                                      java.lang.String rotate,
                                                      ServerContext ctx)
Generate a URL containing all the arguments for the LH menu browse tree and the target page for an associated content page (Search Version).

Overrides:
createAssociatedContentURL in class PageBrowserFrame

createDownloadsURL

protected java.lang.String createDownloadsURL(Page page,
                                              PageQueryState pagesState,
                                              java.lang.String zoom,
                                              java.lang.String rotate,
                                              ServerContext ctx)
Generate a URL containing all the arguments for the LH menu browse tree and the target page for the Download page.

Overrides:
createDownloadsURL in class PageBrowserFrame

generatePreviousHitPageLink

protected java.lang.String generatePreviousHitPageLink(Page page,
                                                       PageQueryState pagesState,
                                                       java.lang.String zoom,
                                                       java.lang.String rotate,
                                                       ServerContext ctx)
                                                throws java.lang.Exception
Generate XHTML code for the previous page link.

Parameters:
page - The current page.
pagesState - A session cache containing among others all the pages.
zoom - The zooming level for the target page image. Possible values are from "1" to "5". Default is "3".
rotate - The rotation value for the target page image. Possible values are "0", "90", "180", "270" degrees. Default is "0" degrees.
ctx - The server context containing the request, response, and current session objects.
Returns:
XHTML code for the link.
Throws:
java.lang.Exception

generateNextHitPageLink

protected java.lang.String generateNextHitPageLink(Page page,
                                                   PageQueryState pagesState,
                                                   java.lang.String zoom,
                                                   java.lang.String rotate,
                                                   ServerContext ctx)
                                            throws java.lang.Exception
Generate XHTML code for the next page link.

Parameters:
page - The current page.
pagesState - A session cache containing among others all the pages.
zoom - The zooming level for the target page image. Possible values are from "1" to "5". Default is "3".
rotate - The rotation value for the target page image. Possible values are "0", "90", "180", "270" degrees. Default is "0" degrees.
ctx - The server context containing the request, response, and current session objects.
Returns:
XHTML code for the link.
Throws:
java.lang.Exception

display

public HTMLHandler display(java.lang.Object result,
                           ServerContext ctx)
                    throws java.lang.Exception
Create an HTML view for browsing requests. It uses an HTML template with placeholders which are replaced by dynamcially generated HTML. The following URL arguments are expected after the '?' character:
ResourceType=Census or Legislation or Essays or Registrar General or TNA

SearchTerms=the actual search terms

SearchContent=All or Metadata

expressionKind=All or Any or Exact or Boolean

Date=the year or year range

Geography=E or W or S or I or C

Sorting=resource-type date geography or resource-type geography date or geography resource-type date path=path to tree node

treestate=contract or expand or expandnew
(Only used if not a leaf-node)

active=yes or no

titlepos=position of first title to be displayed
(default is zero, not needed here, but used when returning to the browse list)

mno=master number of volume or document

display=sections and/or tables and/or pagetitles
(one or more 'display' arguments to be used)

tocseq=TOC sequence number
(only used if 'display=sections' is there)

tocstate=contract or expand or expandnew
(only used if 'display=sections' is there)

pageseq=page sequence number

zoom=1 to 5
(optional, default is 3)

rotate=0 or 90 or 180 or 270
(optional, default is 0)

Specified by:
display in interface BasicFrame
Overrides:
display in class PageBrowserFrame
Parameters:
result - The result from a server method, always NULL, unless exception thrown.
ctx - The server context containing the request, response, and current session objects.
Returns:
An HTML handler containing the generated HTML ready to be sent back as a response by the servlet controller.
Throws:
java.lang.Exception