// access page to force request page resolution
Page page = getPage();
if ((page != null) && (name != null))
{
// get menu definition locator
SiteViewMenuDefinitionLocator locator = sessionContext.getMenuDefinitionLocator(page, name);
if (locator != null)
{
// lookup and return cached relative/request menus
if (menuDefinitionLocatorCache != null)
{
MenuImpl menu = (MenuImpl)menuDefinitionLocatorCache.get(locator);
if (menu != null)
{
return menu;
}
}
// lookup and return cached absolute/session menus
// if current page is not hidden; hidden pages generate
// menus that should be considered relative since
// explicitly addressed hidden pages are added to
// menus for display purposes
if (sessionContext.getMenuDefinitionLocatorCache() != null)
{
MenuImpl menu = (MenuImpl)sessionContext.getMenuDefinitionLocatorCache().get(locator);
if (menu != null)
{
return menu;
}
}
// construct new menu from menu definition in locator
// using current request context and propagating related
// names set to detect cyclic menu definitions
MenuImpl menu = new MenuImpl(locator.getMenuDefinition(), this, names);
// determine whether menu definition locator is
// relative/request, based on hidden page, or
// absolute/session cachable and cache accordingly
if (page.isHidden() || menu.isElementRelative())