// Create the page header area
//
MarlinBean globalHeaders = _sCreateGlobalHeader();
// If no start child add quickSearch
BoundValue hasNavigation3 = BaseDesktopUtils.createIsRenderedBoundValue(NAVIGATION3_CHILD);
BoundValue hasSearch =
BaseDesktopUtils.createIsRenderedBoundValue(SEARCH_CHILD);
BoundValue hasSearchAndNoNavigation3 =
new AndBoundValue( new NotBoundValue(hasNavigation3),
hasSearch);
BoundValue hasNavigation3AndSearch = new AndBoundValue( hasNavigation3, hasSearch);
MarlinBean qsNoStartFlow = new MarlinBean(FLOW_LAYOUT_NAME);
UINode quickSearch = ContextPoppingUINode.getUINode(SEARCH_CHILD);
qsNoStartFlow.addIndexedChild( quickSearch );
qsNoStartFlow.setAttributeValue(RENDERED_ATTR,
hasSearchAndNoNavigation3);
MarlinBean pageHeader = _sCreatePageHeader(globalHeaders,
qsNoStartFlow);
// @todo if there is a navigation3 child, the search should go in the sideBar,
// however we need a search component that will lay itself out properly
// for the reduced space of a sideBar before we do that.
MarlinBean startRegionLayout = new MarlinBean(SIDE_BAR_NAME);
startRegionLayout.addIndexedChild(
ContextPoppingUINode.getUINode(NAVIGATION3_CHILD));
startRegionLayout.setAttributeValue(RENDERED_ATTR, hasNavigation3);
//
// Create the page content area
//
// If a start child quickSearch rendered on the top of content area
MarlinBean qsStartStack = new MarlinBean(STACK_LAYOUT_NAME);
MarlinBean qsSeparator = new MarlinBean(SEPARATOR_NAME);
qsStartStack.addIndexedChild(quickSearch);
qsStartStack.addIndexedChild(qsSeparator);
qsStartStack.setAttributeValue(RENDERED_ATTR, hasNavigation3AndSearch);
//
// Create layout used for locators at the top of the page
//
MarlinBean locatorLayout = new MarlinBean(STACK_LAYOUT_NAME);
MarlinBean topSpacer = new MarlinBean(SPACER_NAME);
topSpacer.setAttributeValue(HEIGHT_ATTR,"5");
BoundValue locatorBoundValue =
RootChildBoundValue.getBoundValue(LOCATION_CHILD);
BoundValue isLocatorRendered =
BaseDesktopUtils.createIsRenderedBoundValue(locatorBoundValue);
BoundValue isUserInfoRendered =
BaseDesktopUtils.createIsRenderedBoundValue(INFO_USER_CHILD);
BoundValue isEndRendered =
BaseDesktopUtils.createIsRenderedBoundValue(INFO_SUPPLEMENTAL_CHILD);
BoundValue hasTrainBean =
new PageLayoutRenderer.TreeWalkerBoundValue( locatorBoundValue,
PROCESS_TRAIN_NAME );
BoundValue isTrainRendered =
new AndBoundValue(isLocatorRendered,
hasTrainBean);
// only render the top spacer if the Locator is rendered
topSpacer.setAttributeValue(RENDERED_ATTR, isLocatorRendered);
MutableUINode locatorUserInfoLayout = _sCreateLocatorUserInfoLayout(
isEndRendered,
isLocatorRendered,
isUserInfoRendered);
// the train separator is only rendered if the train is rendered
MarlinBean trainSeparator = new MarlinBean(SEPARATOR_NAME);
trainSeparator.setAttributeValue(RENDERED_ATTR, isTrainRendered);
locatorLayout.addIndexedChild(topSpacer);
locatorLayout.addIndexedChild(qsStartStack);
locatorLayout.addIndexedChild(locatorUserInfoLayout);
locatorLayout.addIndexedChild(trainSeparator);
locatorLayout.addIndexedChild(
ContextPoppingUINode.getUINode( MESSAGES_CHILD ));
//
// Create the content footer
//
// if content footer child has returnNavigation child and/or
// pageButtons child use these, otherwise
// if the content footer child is a MarlinBean or
// has a contentMarlinBean as a descendent
// add it directly, otherwise create a MarlinBean and add the
// content footer child as its indexed child
MarlinBean contentFooterSwitcher = new MarlinBean(SWITCHER_NAME);
BoundValue contentFooterBoundValue =
RootChildBoundValue.getBoundValue(CONTENT_FOOTER_CHILD);
// Is there a MarlinBean inside of the CONTENT_FOOTER_CHILD
BoundValue hasContentMarlinBean =
new PageLayoutRenderer.TreeWalkerBoundValue( contentFooterBoundValue,
CONTENT_FOOTER_NAME );
// Create MarlinBean using what's in ACTIONS_CHILD
// and INFO_RETURN_CHILD
MarlinBean pageNavContentFooter = new MarlinBean(CONTENT_FOOTER_NAME);
pageNavContentFooter.addIndexedChild(
ContextPoppingUINode.getUINode(ACTIONS_CHILD));
pageNavContentFooter.setNamedChild(START_CHILD,
ContextPoppingUINode.getUINode(INFO_RETURN_CHILD));
// Create MarlinBean using what's in CONTENT_FOOTER_CHILD
MarlinBean contentMarlinBean = new MarlinBean(CONTENT_FOOTER_NAME);
contentMarlinBean.addIndexedChild(
ContextPoppingUINode.getUINode(CONTENT_FOOTER_CHILD));
// Use content footer created with
// ACTIONS_CHILD and INFO_RETURN_CHILD
contentFooterSwitcher.setNamedChild( _HAS_PAGE_NAV, pageNavContentFooter);
// Use content footer already in CONTENT_FOOTER_CHILD
contentFooterSwitcher.setNamedChild(
_HAS_CONTENT_FOOTER,
ContextPoppingUINode.getUINode(CONTENT_FOOTER_CHILD));
// Use content footer created with what's in CONTENT_FOOTER_CHILD
contentFooterSwitcher.setNamedChild( _NO_CONTENT_FOOTER, contentMarlinBean);
// figure out which one to use:
// First Choice: Use the one created with ACTIONS_CHILD
// and INFO_RETURN_CHILD if these children exist.
// Second Choice: Use one already in CONTENT_FOOTER_CHILD.
// Third Choice: Use one created with what's in CONTENT_FOOTER_CHILD
BoundValue pageButtonsExistBV =
BaseDesktopUtils.createIsRenderedBoundValue(ACTIONS_CHILD);
BoundValue returnNavExistsBV =
BaseDesktopUtils.createIsRenderedBoundValue(INFO_RETURN_CHILD);
OrBoundValue newChildrenExist = new OrBoundValue( pageButtonsExistBV,
returnNavExistsBV);