org.histpop.ohpr.frames
Class AssociatedContentFrame

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

public class AssociatedContentFrame
extends java.lang.Object
implements BasicFrame

A frame class for generating a view of an associated content list for a target page or target document. 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.


Constructor Summary
AssociatedContentFrame()
           
 
Method Summary
protected  java.lang.String createAssociatedContent(Page page, java.lang.String oldTitle, java.lang.String oldPageLabel, ServerContext ctx)
          Create a list of associated items
static java.lang.String createAssociatedDocumentURL(java.lang.Integer mno, java.lang.String oldTitle, java.lang.String oldPageLabel)
          Create a URL for an associated target document
static java.lang.String createAssociatedPageURL(java.lang.Integer mno, java.lang.Integer pageSeq, java.lang.String oldTitle, java.lang.String oldPageLabel)
          Create a URL for an associated target page
protected  java.lang.String createAssociatedTableOfContentsURL(java.lang.Integer mno, java.lang.String oldTitle, java.lang.String oldPageLabel)
          Create a URL for a Table of Contents view of an associated target volume
protected  java.lang.String createDocumentURL(SectionQueryState sectionsState, ServerContext ctx)
          Create a target document URL for the 'Back to document' link.
protected  java.lang.String createPageLink(SectionQueryState sectionsState, java.lang.String pageSeq, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Create a link for the 'Back to last page'.
protected  java.lang.String createPageURL(SectionQueryState sectionsState, java.lang.String pageSeq, java.lang.String zoom, java.lang.String rotate, ServerContext ctx)
          Create a target page URL for the 'Back to page' link.
 HTMLHandler display(java.lang.Object result, ServerContext ctx)
          Create an HTML view for the Associated Content list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociatedContentFrame

public AssociatedContentFrame()
Method Detail

createDocumentURL

protected java.lang.String createDocumentURL(SectionQueryState sectionsState,
                                             ServerContext ctx)
Create a target document URL for the 'Back to document' link.

Parameters:
sectionsState - A session cached state of the sections of a master number item.
ctx - The server context containing the request, response, and current session objects. Can be used for finding additional URL arguments from the original request.
Returns:
The target document URL.

createPageURL

protected java.lang.String createPageURL(SectionQueryState sectionsState,
                                         java.lang.String pageSeq,
                                         java.lang.String zoom,
                                         java.lang.String rotate,
                                         ServerContext ctx)
Create a target page URL for the 'Back to page' link.

Parameters:
sectionsState - The session object containing the whole sections tree.
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.
Returns:
Target page URL.

createPageLink

protected java.lang.String createPageLink(SectionQueryState sectionsState,
                                          java.lang.String pageSeq,
                                          java.lang.String zoom,
                                          java.lang.String rotate,
                                          ServerContext ctx)
Create a link for the 'Back to last page'.

Parameters:
sectionsState - The session object containing the whole sections tree.
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 link to the last page.

createAssociatedDocumentURL

public static java.lang.String createAssociatedDocumentURL(java.lang.Integer mno,
                                                           java.lang.String oldTitle,
                                                           java.lang.String oldPageLabel)
Create a URL for an associated target document


createAssociatedPageURL

public static java.lang.String createAssociatedPageURL(java.lang.Integer mno,
                                                       java.lang.Integer pageSeq,
                                                       java.lang.String oldTitle,
                                                       java.lang.String oldPageLabel)
Create a URL for an associated target page


createAssociatedTableOfContentsURL

protected java.lang.String createAssociatedTableOfContentsURL(java.lang.Integer mno,
                                                              java.lang.String oldTitle,
                                                              java.lang.String oldPageLabel)
Create a URL for a Table of Contents view of an associated target volume


createAssociatedContent

protected java.lang.String createAssociatedContent(Page page,
                                                   java.lang.String oldTitle,
                                                   java.lang.String oldPageLabel,
                                                   ServerContext ctx)
                                            throws ServerException
Create a list of associated items

Throws:
ServerException

display

public HTMLHandler display(java.lang.Object result,
                           ServerContext ctx)
                    throws java.lang.Exception
Create an HTML view for the Associated Content list. 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)

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