org.paneris.bibliomania
Class Bib

java.lang.Object
  extended by org.paneris.bibliomania.Bib

public class Bib
extends java.lang.Object

A TemplateContext utility. This is a utility object that is pretty widly used. It provides shortcuts to frequently used functions.

See Also:
BibliomaniaDatabase

Constructor Summary
Bib(BibliomaniaDatabase db)
           
 
Method Summary
 java.lang.String anchorURL(Chapter chapter, java.lang.String anchor)
          Given a chapter and an anchor return an anchor url.
 Unit atMostAuthor(Unit object)
          Walk up the content hierarchy until Author level is reached.
 Unit atMostBook(Unit object)
          Walk up the content hierarchy until Book level is reached.
static java.lang.String bibliomaniaTemplate(java.lang.String name)
          We need to add the extension as this is used in a template context so the TemplateEngine does not get a chance to add an extension.
 Book book(java.lang.Integer troid)
          Given a Book id return the book
 java.lang.String framesetURL(Chapter chapter, java.lang.String page)
          Given a chapter and page return the frameset url
 java.lang.String framesetURL(Unit object)
          Given any object return its frameset url
 java.lang.String getCacheRootURL()
           
 java.lang.String getCommentURL()
           
 java.lang.String getContentStaticRootURL()
           
 BibliomaniaDatabase getDatabase()
           
 java.lang.String getFaqURL()
           
 java.lang.String getHomepageURL()
           
 java.lang.String getLogoURL()
          Return the URL for the logo frame
 java.lang.String getStaticRootURL()
          Return the URL for the root of the static content directory (set via the `StaticRootURL' setting in the Settings table, generally `* /bibliomania-static').
 java.lang.String getTrolleyURL()
           
 java.lang.String url(Chapter object, java.lang.Integer page)
           
 java.lang.String url(Chapter object, java.lang.String page)
          Given a chapter and page return the url
 java.lang.String url(SectionGroup area, Section section, Unit object, java.lang.Integer page)
           
 java.lang.String url(SectionGroup area, Unit object)
          Given a SectionGroup and any Unit return the url for that Unit within this SectionGroup
 java.lang.String url(Unit object)
          Given any object return its url
 java.lang.StringBuffer urlDirectoryPrefixedReally(java.lang.String prefix, SectionGroup area, Section section, Unit object)
           
 java.lang.String urlPrefixed(java.lang.String prefix, SectionGroup area, Section section, Unit object, java.lang.Integer page)
           
 java.lang.String urlPrefixedReally(java.lang.String prefix, SectionGroup area, Section section, Unit object, java.lang.Integer page)
           
 java.lang.String urlReally(Unit object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bib

public Bib(BibliomaniaDatabase db)
Method Detail

getDatabase

public BibliomaniaDatabase getDatabase()

bibliomaniaTemplate

public static java.lang.String bibliomaniaTemplate(java.lang.String name)
We need to add the extension as this is used in a template context so the TemplateEngine does not get a chance to add an extension.

Parameters:
name - with path and extension
Returns:
A name WebMacro can find in the CLASSPATH.

getStaticRootURL

public java.lang.String getStaticRootURL()
Return the URL for the root of the static content directory (set via the `StaticRootURL' setting in the Settings table, generally `* /bibliomania-static').


getContentStaticRootURL

public java.lang.String getContentStaticRootURL()

getCacheRootURL

public java.lang.String getCacheRootURL()

getHomepageURL

public java.lang.String getHomepageURL()

getLogoURL

public java.lang.String getLogoURL()
Return the URL for the logo frame


getFaqURL

public java.lang.String getFaqURL()

getCommentURL

public java.lang.String getCommentURL()

getTrolleyURL

public java.lang.String getTrolleyURL()

urlPrefixedReally

public java.lang.String urlPrefixedReally(java.lang.String prefix,
                                          SectionGroup area,
                                          Section section,
                                          Unit object,
                                          java.lang.Integer page)

urlDirectoryPrefixedReally

public java.lang.StringBuffer urlDirectoryPrefixedReally(java.lang.String prefix,
                                                         SectionGroup area,
                                                         Section section,
                                                         Unit object)

urlPrefixed

public java.lang.String urlPrefixed(java.lang.String prefix,
                                    SectionGroup area,
                                    Section section,
                                    Unit object,
                                    java.lang.Integer page)

url

public java.lang.String url(SectionGroup area,
                            Section section,
                            Unit object,
                            java.lang.Integer page)

url

public java.lang.String url(SectionGroup area,
                            Unit object)
Given a SectionGroup and any Unit return the url for that Unit within this SectionGroup


url

public java.lang.String url(Chapter object,
                            java.lang.Integer page)

url

public java.lang.String url(Chapter object,
                            java.lang.String page)
Given a chapter and page return the url


url

public java.lang.String url(Unit object)
Given any object return its url


framesetURL

public java.lang.String framesetURL(Unit object)
Given any object return its frameset url


framesetURL

public java.lang.String framesetURL(Chapter chapter,
                                    java.lang.String page)
Given a chapter and page return the frameset url


urlReally

public java.lang.String urlReally(Unit object)

book

public Book book(java.lang.Integer troid)
Given a Book id return the book


anchorURL

public java.lang.String anchorURL(Chapter chapter,
                                  java.lang.String anchor)
Given a chapter and an anchor return an anchor url.


atMostBook

public Unit atMostBook(Unit object)
Walk up the content hierarchy until Book level is reached. I.e., return the book from which a chapter comes, or the object itself if it is a book, author, section or sectiongroup.


atMostAuthor

public Unit atMostAuthor(Unit object)
Walk up the content hierarchy until Author level is reached. I.e., return the author of a book or chapter, or the object itself if it is an author, section or sectiongroup.



Copyright © 2000-2009 PanEris. All Rights Reserved.