Package org.apache.rave.portal.web.model

Examples of org.apache.rave.portal.web.model.NavigationMenu


      model.addAttribute(ModelKeys.REFERRING_PAGE_ID, referringPageId);
    }

    public static void addNavItemsToModel(String view, ModelMap model, Long referringPageId, User user, List<Person> friendRequests) {
        long refPageId = referringPageId != null ? referringPageId : 0;
        final NavigationMenu topMenu = new NavigationMenu("topnav");

        NavigationItem friendRequestItems = new NavigationItem("page.profile.friend.requests", String.valueOf(friendRequests.size()) , "#");
        for(Person request : friendRequests) {
          NavigationItem childItem = new NavigationItem((request.getDisplayName()!=null && !request.getDisplayName().isEmpty())? request.getDisplayName() : request.getUsername(), request.getUsername(), "#");
          friendRequestItems.addChildNavigationItem(childItem);
        }
      topMenu.addNavigationItem(friendRequestItems);
      topMenu.getNavigationItems().addAll((ControllerUtils.getTopMenu(view, refPageId, user, false).getNavigationItems()));

      model.addAttribute(topMenu.getName(), topMenu);
    }
View Full Code Here


        log.debug("viewName: " + viewName);
        return viewName;
    }

    public static void addNavItemsToModel(String view, Model model, long referringPageId, User user) {
        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, true);
        model.addAttribute(topMenu.getName(), topMenu);
    }
View Full Code Here

        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, true);
        model.addAttribute(topMenu.getName(), topMenu);
    }

    public static void addNavItemsToModel(String view, Model model, long referringPageId, User user, boolean addStore) {
        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, addStore);
        model.addAttribute(topMenu.getName(), topMenu);
    }
View Full Code Here

        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, addStore);
        model.addAttribute(topMenu.getName(), topMenu);
    }
   
    public static NavigationMenu getTopMenu(String view, long referringPageId, User user, boolean addStoreLink) {
        NavigationMenu menu = new NavigationMenu("topnav");
        if(view.startsWith(ViewNames.PAGE) || view.startsWith(ViewNames.MOBILE_HOME)) {
            NavigationItem profile = new NavigationItem("page.profile.title", getDisplayName(user), "/app/person/id/" + user.getId() + "?referringPageId=" + referringPageId);
            menu.addNavigationItem(profile);

            if(addStoreLink){
                NavigationItem store = new NavigationItem("page.store.title", null, "/app/store?referringPageId=" + referringPageId);
                menu.addNavigationItem(store);
            }
            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        } else if (view.startsWith(ViewNames.STORE)) {
            NavigationItem addWidget = new NavigationItem("page.addwidget.title", null, "/app/store/widget/add?referringPageId=" + referringPageId);
            menu.addNavigationItem(addWidget);

            NavigationItem back = getBackItem(referringPageId);
            menu.addNavigationItem(back);

            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        } else if (view.startsWith(ViewNames.PERSON_PROFILE)) {
            NavigationItem back = getBackItem(referringPageId);
            menu.addNavigationItem(back);

            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        } else if (view.startsWith(ViewNames.ADD_WIDGET_FORM) || view.startsWith(ViewNames.WIDGET)) {
            NavigationItem addWidget = new NavigationItem("page.widget.backToStore", null, "/app/store?referringPageId=" + referringPageId);
            menu.addNavigationItem(addWidget);

            NavigationItem back = getBackItem(referringPageId);
            menu.addNavigationItem(back);

            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        }

        return menu;
    }
View Full Code Here

      model.addAttribute(ModelKeys.REFERRING_PAGE_ID, referringPageId);
    }

    public static void addNavItemsToModel(String view, ModelMap model, Long referringPageId, User user) {
        long refPageId = referringPageId != null ? referringPageId : 0;
        final NavigationMenu topMenu = ControllerUtils.getTopMenu(view, refPageId, user, false);
        model.addAttribute(topMenu.getName(), topMenu);
    }
View Full Code Here

        log.debug("viewName: " + viewName);
        return viewName;
    }

    public static void addNavItemsToModel(String view, Model model, long referringPageId, User user) {
        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, true);
        model.addAttribute(topMenu.getName(), topMenu);
    }
View Full Code Here

        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, true);
        model.addAttribute(topMenu.getName(), topMenu);
    }

    public static void addNavItemsToModel(String view, Model model, long referringPageId, User user, boolean addStore) {
        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, addStore);
        model.addAttribute(topMenu.getName(), topMenu);
    }
View Full Code Here

        final NavigationMenu topMenu = getTopMenu(view, referringPageId, user, addStore);
        model.addAttribute(topMenu.getName(), topMenu);
    }
   
    public static NavigationMenu getTopMenu(String view, long referringPageId, User user, boolean addStoreLink) {
        NavigationMenu menu = new NavigationMenu("topnav");
        if(view.startsWith(ViewNames.PAGE) || view.startsWith(ViewNames.MOBILE_HOME)) {
            NavigationItem profile = new NavigationItem("page.profile.title", getDisplayName(user), "/app/person/" + user.getUsername() + "?referringPageId=" + referringPageId);
            menu.addNavigationItem(profile);

            if(addStoreLink){
                NavigationItem store = new NavigationItem("page.store.title", null, "/app/store?referringPageId=" + referringPageId);
                menu.addNavigationItem(store);
            }

            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        } else if (view.startsWith(ViewNames.STORE)) {
            NavigationItem addWidget = new NavigationItem("page.addwidget.title", null, "/app/store/widget/add?referringPageId=" + referringPageId);
            menu.addNavigationItem(addWidget);

            NavigationItem back = getBackItem(referringPageId);
            menu.addNavigationItem(back);

            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        } else if (view.startsWith(ViewNames.PERSON_PROFILE)) {
            NavigationItem back = getBackItem(referringPageId);
            menu.addNavigationItem(back);

            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        } else if (view.startsWith(ViewNames.ADD_WIDGET_FORM) || view.startsWith(ViewNames.WIDGET)) {
            NavigationItem addWidget = new NavigationItem("page.widget.backToStore", null, "/app/store?referringPageId=" + referringPageId);
            menu.addNavigationItem(addWidget);

            NavigationItem back = getBackItem(referringPageId);
            menu.addNavigationItem(back);

            NavigationItem admin = getAdminItem();
            menu.addNavigationItem(admin);

            NavigationItem logout = getLogoutItem();
            menu.addNavigationItem(logout);
        }

        return menu;
    }
View Full Code Here

            throw new SecurityException("Token does not match");
        }
    }

    static void addNavigationMenusToModel(String selectedItem, Model model) {
        final NavigationMenu topMenu = getTopMenu();
        model.addAttribute(topMenu.getName(), topMenu);
        final NavigationMenu tabMenu = getTabMenu(selectedItem);
        model.addAttribute(tabMenu.getName(), tabMenu);
    }
View Full Code Here

        model.addAttribute(tabMenu.getName(), tabMenu);
    }

    // For the time being hard coded NavigationMenu's
    private static NavigationMenu getTopMenu() {
        NavigationMenu menu = new NavigationMenu("topnav");

        NavigationItem raveHome = new NavigationItem("page.general.back", "/");
        menu.addNavigationItem(raveHome);

        NavigationItem logout = new NavigationItem("page.general.logout", "/j_spring_security_logout");
        menu.addNavigationItem(logout);

        return menu;
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.web.model.NavigationMenu

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.