org.histpop.ohpr.frames
Class GoToFrame

java.lang.Object
  extended by org.histpop.ohpr.frames.GoToFrame
All Implemented Interfaces:
BasicFrame
Direct Known Subclasses:
GoToFrame2

public class GoToFrame
extends java.lang.Object
implements BasicFrame

A frame class for generating a view for a 'Go to page' dialogue. 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 MSG_NO_PAGE_SPECIFIED
           
static java.lang.String MSG_NOT_FOUND
           
protected static java.lang.String TARGET
          URL argument name for the 'target' parameter
 
Constructor Summary
GoToFrame()
           
 
Method Summary
protected  java.lang.String createPageURL(Page page, PageQueryState pagesState, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Generate a target page URL containing all the arguments for the LH menu browse tree and the target page.
 HTMLHandler display(java.lang.Object result, ServerContext ctx)
          Create an HTML view for 'Go to page' requests from the target page browser.
protected  java.util.Vector findPages(PageQueryState pagesState, java.lang.String target)
          Find all the pages with a matching target page number
protected  java.lang.String generatePageSections(java.util.Vector pages, PageQueryState pagesState, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Generate the local hierachies with page links for each page of the same page number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET

protected static final java.lang.String TARGET
URL argument name for the 'target' parameter

See Also:
Constant Field Values

MSG_NOT_FOUND

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

MSG_NO_PAGE_SPECIFIED

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

GoToFrame

public GoToFrame()
Method Detail

findPages

protected java.util.Vector findPages(PageQueryState pagesState,
                                     java.lang.String target)
Find all the pages with a matching target page number


createPageURL

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


generatePageSections

protected java.lang.String generatePageSections(java.util.Vector pages,
                                                PageQueryState pagesState,
                                                java.lang.String zoom,
                                                java.lang.String rotate,
                                                ServerContext ctx)
                                         throws java.lang.Exception
Generate the local hierachies with page links for each page of the same page number.

Parameters:
pages - A collection of persistent objects of type Page.
pagesState - A session cache containing among others all the pages.
zoom - The current zooming level for the target page image. Possible values are from "1" to "5". Default is "3".
rotate - The current 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 containing section titles with links to the target pages.
Throws:
java.lang.Exception

display

public HTMLHandler display(java.lang.Object result,
                           ServerContext ctx)
                    throws java.lang.Exception
Create an HTML view for 'Go to page' requests from the target page browser. It uses an HTML template with placeholders which are replaced by dynamcially generated HTML. The following URL arguments are expected after the '?' character:
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)

target=target page number (Roman or arabic)

Specified by:
display in interface BasicFrame
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