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

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


    }
   
    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


        String displayName = user.getDisplayName();
        return (displayName == null || "".equals(displayName)) ? user.getUsername() : displayName;
    }

    private static NavigationItem getBackItem(long referringPageId) {
        NavigationItem back = new NavigationItem();
        back.setName("page.general.back");
        if (referringPageId > 0) {
            back.setUrl("/app/page/view/" + referringPageId);
        } else {
            back.setUrl("/");
        }
        return back;
    }
View Full Code Here

        }
        return back;
    }

    private static NavigationItem getAdminItem() {
        return new NavigationItem("page.general.toadmininterface", null, "/app/admin/");
    }
View Full Code Here

    private static NavigationItem getAdminItem() {
        return new NavigationItem("page.general.toadmininterface", null, "/app/admin/");
    }

    private static NavigationItem getLogoutItem() {
        return new NavigationItem("page.general.logout", null, "/j_spring_security_logout");
    }
View Full Code Here

    }
   
    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

        String displayName = user.getDisplayName();
        return (displayName == null || "".equals(displayName)) ? user.getUsername() : displayName;
    }

    private static NavigationItem getBackItem(long referringPageId) {
        NavigationItem back = new NavigationItem();
        back.setName("page.general.back");
        if (referringPageId > 0) {
            back.setUrl("/app/page/view/" + referringPageId);
        } else {
            back.setUrl("/");
        }
        return back;
    }
View Full Code Here

        }
        return back;
    }

    private static NavigationItem getAdminItem() {
        return new NavigationItem("page.general.toadmininterface", null, "/app/admin/");
    }
View Full Code Here

    private static NavigationItem getAdminItem() {
        return new NavigationItem("page.general.toadmininterface", null, "/app/admin/");
    }

    private static NavigationItem getLogoutItem() {
        return new NavigationItem("page.general.logout", null, "/j_spring_security_logout");
    }
View Full Code Here

    // 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

    }

    private static NavigationMenu getTabMenu(String selectedItem) {
        NavigationMenu menu = new NavigationMenu("tabs");

        NavigationItem home = new NavigationItem("admin.home.shorttitle", "/app/admin/");
        home.setSelected("home".equals(selectedItem));
        menu.addNavigationItem(home);

        NavigationItem users = new NavigationItem("admin.users.shorttitle", "/app/admin/users");
        users.setSelected("users".equals(selectedItem));
        menu.addNavigationItem(users);

        NavigationItem widgets = new NavigationItem("admin.widgets.shorttitle", "/app/admin/widgets");
        widgets.setSelected("widgets".equals(selectedItem));
        menu.addNavigationItem(widgets);

        return menu;
    }
View Full Code Here

TOP

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

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.