Package org.zkybase.web.sitemap

Examples of org.zkybase.web.sitemap.SitemapNode


   
    // Commenting these out since they're currently breaking the unit tests.
//    notNull(resolvedNodeName);
//    notNull(resolvedNodePath);
   
    SitemapNode node = new SitemapNode(nodeId, resolvedNodeName, sitemapNode.getUseNameAsPageTitle(), resolvedNodePath);
   
    if (sitemapNode.hasParent()) {
      buildNavigationNode(sitemapNode.getParent()).addChild(node);
    }
   
View Full Code Here


   
    if (breadcrumbs.size() < 3) { return null; }
   
    List<NavigationNode> menu = new ArrayList<NavigationNode>();
   
    SitemapNode overviewBreadcrumb = breadcrumbs.get(2);
    SitemapNode overviewMapNode = sitemap.getNode(overviewBreadcrumb.getId());
   
    String resolvedPath = sitemap.resolve(overviewMapNode.getPath(), context);
   
    NavigationNode overviewNavNode =
      new NavigationNode(overviewMapNode.getId(), "Overview", resolvedPath, false, false);
    menu.add(overviewNavNode);
   
    List<SitemapNode> children = overviewMapNode.getChildren();
    for (SitemapNode child : children) {
      if (!child.getShowInDetailsSidebar()) { continue; }
     
      String resolvedChildName = sitemap.resolve(child.getName(), context);
     
      String resolvedChildPath = sitemap.resolve(child.getPath(), context);
      List<SitemapNode> grandchildren = child.getChildren();
     
      NavigationNode childNavNode =
        new NavigationNode(child.getId(), resolvedChildName, resolvedChildPath, false, false);
      menu.add(childNavNode);
     
      boolean foundGrandchild = false;
      for (SitemapNode grandchild : grandchildren) {
        if (!grandchild.getShowInDetailsSidebar()) { continue; }
       
        foundGrandchild = true;
       
        String resolvedGcName = sitemap.resolve(grandchild.getName(), context);
        String resolvedGcPath = sitemap.resolve(grandchild.getPath(), context);
       
        NavigationNode gcNavNode =
          new NavigationNode(grandchild.getId(), resolvedGcName, resolvedGcPath, false, false);
        menu.add(gcNavNode);
      }
     
      if (foundGrandchild) {
        childNavNode.setHeader(true);
      }
    }
   
    // Find the active node. Search from the end of the list to ensure that we check lower nodes before higher ones.
    int menuSize = menu.size();
   
    matchMenuItem: for (int i = menuSize - 1; i >= 0; i--) {
      NavigationNode menuItem = menu.get(i);
      String menuItemId = menuItem.getId();

      // Compare the current node to the current menu item's ancestry to find a match.
      SitemapNode sitemapNode = getCurrentNode();
      while (!sitemapNode.getId().equals(menuItemId)) {
        sitemapNode = sitemapNode.getParent();
        if (sitemapNode == null) {
          continue matchMenuItem;
        }
      }
View Full Code Here

  @Test
  public void testPostConstruct() {
    sitemap.postConstruct();
   
    // Get a node
    SitemapNode appModulesNode = sitemap.getNode("applicationModuleList");
    assertNotNull(appModulesNode);
    assertEquals("applicationModuleList", appModulesNode.getId());
    assertEquals("'Modules'", appModulesNode.getName());
   
    // Resolve an expression
    // TODO
  }
View Full Code Here

TOP

Related Classes of org.zkybase.web.sitemap.SitemapNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.