© 2005 BEA Systems, Inc.

com.bea.netuix.servlets.controls.page
Class BookPresentationContext

java.lang.Object
  extended bycom.bea.netuix.servlets.controls.ControlContext
      extended bycom.bea.netuix.servlets.controls.PresentationContext
          extended bycom.bea.netuix.servlets.controls.window.WindowPresentationContext
              extended bycom.bea.netuix.servlets.controls.page.PagePresentationContext
                  extended bycom.bea.netuix.servlets.controls.page.BookPresentationContext
All Implemented Interfaces:
Serializable

public class BookPresentationContext
extends PagePresentationContext

This class represents a portal book component. All presentation-related attributes of a book component are available from instances of this class. Such instances are typically used during portal rendering via look and feel skeleton files (e.g. book.jsp).

See Also:
getBookPresentationContext(javax.servlet.http.HttpServletRequest), Serialized Form

Field Summary
protected static String CLASS_NAME
           
 
Fields inherited from class com.bea.netuix.servlets.controls.ControlContext
debug
 
Method Summary
 String getActivePage()
          Get the currently active page's label.
static BookPresentationContext getBookPresentationContext(HttpServletRequest request)
          This is a convenience method for returning a reference to the current BookPresentationContext.
 BookPresentationContext getBookPresentationContextRecursive(String definitionLabel)
          Return a book searching the entire tree recursively.
 String getCurrentPage()
          Deprecated. Use getActivePage() instead
 String getDefaultPage()
          The default page's label as specified for the book.
 List getEntitledPagePresentationContexts()
          Return the collection of entitled PagePresentationContexts (which may be either BookPresentationContext or PagePresentationContext objects) for this book.
 String getLabel()
          Gets the label for this book.
 int getPageCount()
          Return the total number of pages contained in this book.
 PagePresentationContext getPagePresentationContext(String instanceId)
          Return a page from the list of pages for this book.
 PagePresentationContext getPagePresentationContextByUniqueId(String uniqueId)
          Return a page from the list of pages for this book.
 PagePresentationContext getPagePresentationContextByUnqiueId(String uniqueId)
          Deprecated. Misspelled method name; use getPagePresentationContextByUniqueId(String)
 PagePresentationContext getPagePresentationContextRecursive(String definitionLabel)
          Return a book or a page but traverse the entire tree, this will go inside books that are on pages too.
 ArrayList getPagePresentationContexts()
          Deprecated. Use getEntitledPagePresentationContexts()
 PortletPresentationContext getPortletPresentationContextRecursive(String instanceLabel)
          Return the PortletPresentationContext matching the supplied instance label.
 PortletPresentationContext[] getPortletsPresentationContextRecursive(String definitionLabel)
          Returns PortletPresentationContexts matching the supplied definition label.
 boolean isContained()
          Returns true if the Book represented by this presentation context is "contained", that is if the the Book's next Book, Window, or Page ancestor is a Book or Window then it is contained and this method will return true.
 boolean isDesktopBook()
          Returns true if the Book represented by this presentation context is the desktop Book in otherwords is it the top most Book in the control tree.
 boolean isLikePage()
          Indicates whether or not this book is a page in another book.
 
Methods inherited from class com.bea.netuix.servlets.controls.page.PagePresentationContext
getActiveImage, getInactiveImage, getPagePresentationContext, getRolloverImage, getWindowPresentationContexts, isActive, isDisplayed, isHidden, isVisible
 
Methods inherited from class com.bea.netuix.servlets.controls.window.WindowPresentationContext
getCapability, getContentPresentationClass, getContentPresentationContextChildren, getContentPresentationStyle, getDefinitionId, getDefinitionLabel, getInstanceId, getOrientation, getParentPagePresentationContext, getPreviousWindowMode, getThemePresentationContext, getTitle, getTitlebarPresentationContext, getWindowMode, getWindowPresentationContext, getWindowState, isCapable, isPacked
 
Methods inherited from class com.bea.netuix.servlets.controls.PresentationContext
getChildren, getChildren, getFirstChild, getParsedProperties, getPresentationClass, getPresentationId, getPresentationStyle, getProperties, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsInt, getResolvedLocale, getTagName, setVisible
 
Methods inherited from class com.bea.netuix.servlets.controls.ControlContext
getContextFromRequest, getContextFromRequest, getControl, getRequestKey, getUniqueId, removeContextFromRequest, setContextInRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

protected static final String CLASS_NAME
Method Detail

getActivePage

public String getActivePage()
Get the currently active page's label.

Returns:
The label of the current page

getBookPresentationContext

public static BookPresentationContext getBookPresentationContext(HttpServletRequest request)
This is a convenience method for returning a reference to the current BookPresentationContext. Note this method will only work if called from within a portal (typically, from the book.jsp skeleton). This method may return null if called when no appropriate context exists, but such a context should safely exist when being fetched from the associated skeleton JSP during normal portal rendering.

Parameters:
request - The current HTTPServletRequest instance
Returns:
A reference to the current BookPresentationContext, if any

getBookPresentationContextRecursive

public BookPresentationContext getBookPresentationContextRecursive(String definitionLabel)
Return a book searching the entire tree recursively. If you are interested in both books AND pages use getPagePresentationContextRecursive(java.lang.String) as that method returns both.

Overrides:
getBookPresentationContextRecursive in class PagePresentationContext
Parameters:
definitionLabel - The definitionLabel of the desired book
Returns:
The Book of interest or null if it is not found

getCurrentPage

public String getCurrentPage()
Deprecated. Use getActivePage() instead

Get the currently active page's label. This is equivalent to calling getActivePage().

Returns:
The label of the current page
See Also:
getActivePage()

getDefaultPage

public String getDefaultPage()
The default page's label as specified for the book.

Returns:
The label of the default page

getEntitledPagePresentationContexts

public List getEntitledPagePresentationContexts()
Return the collection of entitled PagePresentationContexts (which may be either BookPresentationContext or PagePresentationContext objects) for this book. If no pages exist returns an empty list.

Returns:
A list of PagePresentationContext and/or BookPresentationContext objects

getLabel

public String getLabel()
Gets the label for this book. This is equivalent to calling WindowPresentationContext.getDefinitionLabel().

Overrides:
getLabel in class PagePresentationContext
Returns:

getPageCount

public int getPageCount()
Return the total number of pages contained in this book.

Returns:
The total number of pages

getPagePresentationContext

public PagePresentationContext getPagePresentationContext(String instanceId)
Return a page from the list of pages for this book. If the page does not exist, null is returned. Note this method will not search recursively, if you need that functionality call getPagePresentationContextRecursive(java.lang.String).

Returns:
An immediate page child for the given instanceId, or null if it does not exist

getPagePresentationContextByUniqueId

public PagePresentationContext getPagePresentationContextByUniqueId(String uniqueId)
Return a page from the list of pages for this book. If the page does not exist or this is called from a .portal file, null is returned.

Returns:
The PagePresentationContext for the unique id, or null if it is not found

getPagePresentationContextByUnqiueId

public PagePresentationContext getPagePresentationContextByUnqiueId(String uniqueId)
Deprecated. Misspelled method name; use getPagePresentationContextByUniqueId(String)

Return a page from the list of pages for this book. If the page does not exist, null is returned.

Returns:
The PagePresentationContext for the unique id, or null if it is not found

getPagePresentationContextRecursive

public PagePresentationContext getPagePresentationContextRecursive(String definitionLabel)
Return a book or a page but traverse the entire tree, this will go inside books that are on pages too.

Overrides:
getPagePresentationContextRecursive in class PagePresentationContext
Parameters:
definitionLabel - The definitionLabel of the desired page or book
Returns:
A PagePresentationContext (or BookPresentationContext if a book) of the page or book with a matching definition label

getPagePresentationContexts

public ArrayList getPagePresentationContexts()
Deprecated. Use getEntitledPagePresentationContexts()

Return the collection of PagePresentationContexts (which may be either BookPresentationContext or PagePresentationContext objects) for this book. If no pages exist returns an empty list.

Returns:
An ArrayList of PagePresentationContext and/or BookPresentationContext objects
See Also:
getEntitledPagePresentationContexts()

getPortletPresentationContextRecursive

public PortletPresentationContext getPortletPresentationContextRecursive(String instanceLabel)
Return the PortletPresentationContext matching the supplied instance label.

Overrides:
getPortletPresentationContextRecursive in class PagePresentationContext
Parameters:
instanceLabel - The unique instance label for the desired portlet
Returns:
A reference to the PortletPresentationContext if it exists; null otherwise

getPortletsPresentationContextRecursive

public PortletPresentationContext[] getPortletsPresentationContextRecursive(String definitionLabel)
Returns PortletPresentationContexts matching the supplied definition label. Since many portlets can share the same definition label, more than one portlet can be returned. If you are interested in just one portlet then try getPortletPresentationContextRecursive(java.lang.String).

Overrides:
getPortletsPresentationContextRecursive in class PagePresentationContext
Parameters:
definitionLabel - The definition label for the desired portlet(s)
Returns:
A non-null array of PortletPresentationContexts

isContained

public boolean isContained()
Returns true if the Book represented by this presentation context is "contained", that is if the the Book's next Book, Window, or Page ancestor is a Book or Window then it is contained and this method will return true. This is useful for formatting the book differently when it is a child of such a component.

Returns:
True, if this book is directly contained by another book or window

isDesktopBook

public boolean isDesktopBook()
Returns true if the Book represented by this presentation context is the desktop Book in otherwords is it the top most Book in the control tree.

Returns:
True, if this is the primary book in the portal

isLikePage

public boolean isLikePage()
Indicates whether or not this book is a page in another book.

Returns:
True, if this book is a page in another book

© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved