Package org.opencustomer.webapp.util.menu

Examples of org.opencustomer.webapp.util.menu.MenuItem


        if (forward == LOGIN_OK) {
            Menu menu     = (Menu) request.getSession().getAttribute(Globals.MENU_KEY);
           
            if(form.getDeeplink() != null) {
                MenuItem item = null;
               
                if(log.isDebugEnabled())
                    log.debug("execute deeplink");

                if("EVENT".equals(form.getDeeplink())) {
                    if(log.isDebugEnabled()) {
                        log.debug("prepare deeplink to event with id: "+form.getId());
                    }
                    item   = menu.findItem("/calendar/showMainCalendar");
                } else if("JOB".equals(form.getDeeplink())) {
                    if(log.isDebugEnabled()) {
                        log.debug("prepare deeplink to job with id: "+form.getId());
                    }
                    item   = menu.findItem("/home/jobs");
                }

                if(item != null) {
                    if(log.isDebugEnabled())
                        log.debug("active menu item with id: "+item.getId());
                       
                    menu.activate(item.getId());
                }
            }

            return new ActionForward(getActionURL(request, menu.getActiveItem().getAction()));
        else {
View Full Code Here


    @Override
    public ActionForward execute(ActionMapping mapping, MenuForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        Menu menu = (Menu)request.getSession().getAttribute(Globals.MENU_KEY);
       
        MenuItem menuItem = null;
       
        if(menu == null)
        {
            if(log.isDebugEnabled())
                log.debug("no menu found in session");
           
            // not protected by rights -> write error and go to login manually
            ActionMessages errors = new ActionMessages();
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.common.error.notLoggedIn"));
            saveErrors(request, errors);
        }
        else
        {
            menuItem = menu.activate(form.getMenuId());

            if(menuItem == null)
            {
                menuItem = menu.getActiveItem();
                if(log.isDebugEnabled())
                    log.debug("could not activate menu item / use active item: "+menuItem);
            }
            else if(log.isDebugEnabled())
                log.debug("activate item: "+menuItem);
           
            // do always delete the stack when click the menu
            PanelStack panelStack = Panel.getPanelStack(request);
            panelStack.clear();
           
            return Panel.getForward(menuItem.getAction(), request);
        }
       
        return mapping.findForward("login");
    }
View Full Code Here

TOP

Related Classes of org.opencustomer.webapp.util.menu.MenuItem

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.