org.apache.jetspeed.portalsite.impl
Class PortalSiteRequestContextImpl

java.lang.Object
  extended by org.apache.jetspeed.portalsite.impl.PortalSiteRequestContextImpl
All Implemented Interfaces:
org.apache.jetspeed.portalsite.PortalSiteRequestContext

public class PortalSiteRequestContextImpl
extends Object
implements org.apache.jetspeed.portalsite.PortalSiteRequestContext

This class encapsulates managed request state for and interface to the portal-site component.

Version:
$Id: PortalSiteRequestContextImpl.java 517121 2007-03-12 07:45:49Z ate $
Author:
Randy Watler

Field Summary
private  Map menuDefinitionLocatorCache
          menuDefinitionLocatorCache - cached menu definition locators for relative menus valid for request
private  Set pageMenuDefinitionNames
          pageMenuDefinitionNames - cached menu definition names for request page
private  boolean requestFallback
          requestFallback - flag indicating whether request should fallback to root folder if locators do not select a page or access is forbidden
private  org.apache.jetspeed.om.page.Page requestPage
          page - cached request profiled page proxy
private  Map requestProfileLocators
          requestProfileLocators - map of request profile locators by locator names
private  org.apache.jetspeed.om.folder.Folder requestRootFolder
          rootFolder - cached request profiled root folder proxy
private  org.apache.jetspeed.page.document.NodeSet rootLinks
          rootLinks - cached node set of visible link proxies
private  boolean rootLinksCached
          rootLinksCached - cached flag for link proxies
private  PortalSiteSessionContextImpl sessionContext
          sessionContext - component session state/interface
private  org.apache.jetspeed.page.document.NodeSet siblingFolders
          siblingFolders - cached node set of visible sibling folder proxies
private  boolean siblingFoldersCached
          siblingFoldersCached - cached flag for sibling folder proxies
private  org.apache.jetspeed.page.document.NodeSet siblingPages
          siblingPages - cached node set of visible sibling page proxies
private  boolean siblingPagesCached
          siblingPagesCached - cached flag for sibling page proxies
private  boolean useHistory
          useHistory - flag indicating whether to use visited page history to select default page per site folder
 
Constructor Summary
PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators)
          PortalSiteRequestContextImpl - constructor
PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, boolean requestFallback)
          PortalSiteRequestContextImpl - constructor
PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, boolean requestFallback, boolean useHistory)
          PortalSiteRequestContextImpl - constructor
 
Method Summary
private static org.apache.jetspeed.page.document.NodeSet filterHiddenNodes(org.apache.jetspeed.page.document.NodeSet nodes)
          filterHiddenNodes - utility to filter hidden node proxies out of node sets
 Set getCustomMenuNames()
          getCustomMenuNames - get set of custom menu names available as defined for the request profiled page and folder
 org.apache.jetspeed.om.folder.Folder getFolder()
          getFolder - get folder proxy relative to request profiled page
 Map getLocators()
          getLocators - get profile locators by locator names
 org.apache.jetspeed.om.page.Page getManagedPage()
          getManagedPage - get request profiled concrete page instance as managed by the page manager
 org.apache.jetspeed.portalsite.Menu getMenu(String name)
          getMenu - get instantiated menu available for the request profiled page and folder
 org.apache.jetspeed.portalsite.Menu getMenu(String name, Set names)
          getMenu - get instantiated menu available for the request profiled page and folder, avoiding cyclic menu definition loops by propagating related menu names set from menu construction
 org.apache.jetspeed.om.page.Page getPage()
          getPage - get request profiled page proxy
 org.apache.jetspeed.om.folder.Folder getParentFolder()
          getParentFolder - get parent folder proxy relative to request profiled page
 org.apache.jetspeed.om.folder.Folder getRootFolder()
          getRootFolder - get root profiled folder proxy
 org.apache.jetspeed.page.document.NodeSet getRootLinks()
          getRootLinks - get node set of link proxies relative to profiled root folder
 org.apache.jetspeed.portalsite.PortalSiteSessionContext getSessionContext()
          getSessionContext - get component session context
 org.apache.jetspeed.page.document.NodeSet getSiblingFolders()
          getSiblingFolders - get node set of sibling folder proxies relative to request profiled page, (includes profiled page folder proxy)
 org.apache.jetspeed.page.document.NodeSet getSiblingPages()
          getSiblingPages - get node set of sibling page proxies relative to request profiled page, (includes profiled page proxy)
 Set getStandardMenuNames()
          getStandardMenuNames - get set of available standard menu names
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionContext

private PortalSiteSessionContextImpl sessionContext
sessionContext - component session state/interface


requestProfileLocators

private Map requestProfileLocators
requestProfileLocators - map of request profile locators by locator names


requestFallback

private boolean requestFallback
requestFallback - flag indicating whether request should fallback to root folder if locators do not select a page or access is forbidden


useHistory

private boolean useHistory
useHistory - flag indicating whether to use visited page history to select default page per site folder


requestPage

private org.apache.jetspeed.om.page.Page requestPage
page - cached request profiled page proxy


siblingPages

private org.apache.jetspeed.page.document.NodeSet siblingPages
siblingPages - cached node set of visible sibling page proxies


siblingPagesCached

private boolean siblingPagesCached
siblingPagesCached - cached flag for sibling page proxies


siblingFolders

private org.apache.jetspeed.page.document.NodeSet siblingFolders
siblingFolders - cached node set of visible sibling folder proxies


siblingFoldersCached

private boolean siblingFoldersCached
siblingFoldersCached - cached flag for sibling folder proxies


requestRootFolder

private org.apache.jetspeed.om.folder.Folder requestRootFolder
rootFolder - cached request profiled root folder proxy


rootLinks

private org.apache.jetspeed.page.document.NodeSet rootLinks
rootLinks - cached node set of visible link proxies


rootLinksCached

private boolean rootLinksCached
rootLinksCached - cached flag for link proxies


pageMenuDefinitionNames

private Set pageMenuDefinitionNames
pageMenuDefinitionNames - cached menu definition names for request page


menuDefinitionLocatorCache

private Map menuDefinitionLocatorCache
menuDefinitionLocatorCache - cached menu definition locators for relative menus valid for request

Constructor Detail

PortalSiteRequestContextImpl

public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext,
                                    Map requestProfileLocators,
                                    boolean requestFallback,
                                    boolean useHistory)
PortalSiteRequestContextImpl - constructor

Parameters:
sessionContext - session context
requestProfileLocators - request profile locators
requestFallback - flag specifying whether to fallback to root folder if locators do not select a page or access is forbidden
useHistory - flag indicating whether to use visited page history to select default page per site folder

PortalSiteRequestContextImpl

public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext,
                                    Map requestProfileLocators,
                                    boolean requestFallback)
PortalSiteRequestContextImpl - constructor

Parameters:
sessionContext - session context
requestProfileLocators - request profile locators
requestFallback - flag specifying whether to fallback to root folder if locators do not select a page or access is forbidden

PortalSiteRequestContextImpl

public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext,
                                    Map requestProfileLocators)
PortalSiteRequestContextImpl - constructor

Parameters:
sessionContext - session context
requestProfileLocators - request profile locators
Method Detail

getSessionContext

public org.apache.jetspeed.portalsite.PortalSiteSessionContext getSessionContext()
getSessionContext - get component session context

Specified by:
getSessionContext in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
component session context

getLocators

public Map getLocators()
getLocators - get profile locators by locator names

Specified by:
getLocators in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
request profile locators

getManagedPage

public org.apache.jetspeed.om.page.Page getManagedPage()
                                                throws org.apache.jetspeed.page.document.NodeNotFoundException
getManagedPage - get request profiled concrete page instance as managed by the page manager

Specified by:
getManagedPage in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
managed page
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getPage

public org.apache.jetspeed.om.page.Page getPage()
                                         throws org.apache.jetspeed.page.document.NodeNotFoundException
getPage - get request profiled page proxy

Specified by:
getPage in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
page proxy
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getFolder

public org.apache.jetspeed.om.folder.Folder getFolder()
                                               throws org.apache.jetspeed.page.document.NodeNotFoundException
getFolder - get folder proxy relative to request profiled page

Specified by:
getFolder in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
page folder proxy
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getSiblingPages

public org.apache.jetspeed.page.document.NodeSet getSiblingPages()
                                                          throws org.apache.jetspeed.page.document.NodeNotFoundException
getSiblingPages - get node set of sibling page proxies relative to request profiled page, (includes profiled page proxy)

Specified by:
getSiblingPages in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
sibling page proxies
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getParentFolder

public org.apache.jetspeed.om.folder.Folder getParentFolder()
                                                     throws org.apache.jetspeed.page.document.NodeNotFoundException
getParentFolder - get parent folder proxy relative to request profiled page

Specified by:
getParentFolder in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
parent folder proxy or null
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getSiblingFolders

public org.apache.jetspeed.page.document.NodeSet getSiblingFolders()
                                                            throws org.apache.jetspeed.page.document.NodeNotFoundException
getSiblingFolders - get node set of sibling folder proxies relative to request profiled page, (includes profiled page folder proxy)

Specified by:
getSiblingFolders in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
sibling folder proxies
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getRootFolder

public org.apache.jetspeed.om.folder.Folder getRootFolder()
                                                   throws org.apache.jetspeed.page.document.NodeNotFoundException
getRootFolder - get root profiled folder proxy

Specified by:
getRootFolder in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
parent folder proxy
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getRootLinks

public org.apache.jetspeed.page.document.NodeSet getRootLinks()
                                                       throws org.apache.jetspeed.page.document.NodeNotFoundException
getRootLinks - get node set of link proxies relative to profiled root folder

Specified by:
getRootLinks in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
root link proxies
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getStandardMenuNames

public Set getStandardMenuNames()
getStandardMenuNames - get set of available standard menu names

Specified by:
getStandardMenuNames in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
menu names set

getCustomMenuNames

public Set getCustomMenuNames()
                       throws org.apache.jetspeed.page.document.NodeNotFoundException
getCustomMenuNames - get set of custom menu names available as defined for the request profiled page and folder

Specified by:
getCustomMenuNames in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Returns:
menu names set
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getMenu

public org.apache.jetspeed.portalsite.Menu getMenu(String name)
                                            throws org.apache.jetspeed.page.document.NodeNotFoundException
getMenu - get instantiated menu available for the request profiled page and folder

Specified by:
getMenu in interface org.apache.jetspeed.portalsite.PortalSiteRequestContext
Parameters:
name - menu definition name
Returns:
menu instance
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

getMenu

public org.apache.jetspeed.portalsite.Menu getMenu(String name,
                                                   Set names)
                                            throws org.apache.jetspeed.page.document.NodeNotFoundException
getMenu - get instantiated menu available for the request profiled page and folder, avoiding cyclic menu definition loops by propagating related menu names set from menu construction

Parameters:
name - menu definition name
names - set of related menu definition names
Returns:
menu instance
Throws:
org.apache.jetspeed.page.document.NodeNotFoundException - if page not found
SecurityException - if page view access not granted

filterHiddenNodes

private static org.apache.jetspeed.page.document.NodeSet filterHiddenNodes(org.apache.jetspeed.page.document.NodeSet nodes)
filterHiddenNodes - utility to filter hidden node proxies out of node sets

Parameters:
nodes - proxy node set to filter
Returns:
input or filtered proxy node set


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.