@Test void testGetFooterNavigation_MainNav() throws Exception { Resource footerNavResource = context.resourceResolver().getResource("/content/wcm-io-samples/en/tools/navigation/footernav"); context.resourceResolver().delete(footerNavResource); NavigationPageItem rootItem = underTest.getFooterNavigation(); List<NavigationPageItem> footerNavItems = rootItem.getChildren(); assertEquals(5, footerNavItems.size()); assertNoLinkItem("CONFERENCE", footerNavItems.get(0)); assertNoLinkItem("ARCHIVE", footerNavItems.get(4)); List<NavigationPageItem> confItems = footerNavItems.get(0).getChildren(); assertEquals(2, confItems.size()); assertLinkItem("CONFERENCE", "/content/wcm-io-samples/en/conference.html", confItems.get(0)); assertLinkItem("Call for Papers", "/content/wcm-io-samples/en/conference/call-for-papers.html", confItems.get(1)); }
@Override public NavigationPageItem getFooterNavigation() { Page footerNavRoot = siteRoot.getRelativePage(FOOTERNAV_RELATIVE_PATH); if (footerNavRoot != null) { return getFooterNavigationSpecific(footerNavRoot); } else { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } return getFooterNavigationDerivedFromMainNav(siteRootPage); } }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getFooterNavigation() { Page footerNavRoot = siteRoot.getRelativePage(FOOTERNAV_RELATIVE_PATH); if (footerNavRoot != null) { return getFooterNavigationSpecific(footerNavRoot); } else { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } return getFooterNavigationDerivedFromMainNav(siteRootPage); } } }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getFooterNavigation() { Page footerNavRoot = siteRoot.getRelativePage(FOOTERNAV_RELATIVE_PATH); if (footerNavRoot != null) { return getFooterNavigationSpecific(footerNavRoot); } else { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } return getFooterNavigationDerivedFromMainNav(siteRootPage); } }  }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getFooterNavigation() { Page footerNavRoot = siteRoot.getRelativePage(FOOTERNAV_RELATIVE_PATH); if (footerNavRoot != null) { return getFooterNavigationSpecific(footerNavRoot); } else { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } return getFooterNavigationDerivedFromMainNav(siteRootPage); } }  @Override NavigationPageItem getMainNavigation(final int maxLevels); @Override NavigationPageItem getFooterNavigation(); }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getFooterNavigation() { Page footerNavRoot = siteRoot.getRelativePage(FOOTERNAV_RELATIVE_PATH); if (footerNavRoot != null) { return getFooterNavigationSpecific(footerNavRoot); } else { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } return getFooterNavigationDerivedFromMainNav(siteRootPage); } }  @Override NavigationPageItem getMainNavigation(final int maxLevels); @Override NavigationPageItem getFooterNavigation();  }