Package com.eforce.baby.auth.vo

Examples of com.eforce.baby.auth.vo.MenuVO


            con = super.createConnection(dsName);
            stmt = con.prepareStatement(sql);
            stmt.setString(1, userId);
            rset = stmt.executeQuery();

            MenuVO menu = null;

            while(rset.next())
            {
                menu = new MenuVO();
                menu.setMenuId((rset.getString(1)) == null ? "" : rset.getString(1));
                menu.setMenuName((rset.getString(2)) == null ? "" : rset.getString(2));
                menu.setQuickMenuName((rset.getString(3)) == null ? "" : rset.getString(3));
                menu.setParentMenuId((rset.getString(4)) == null ? "" : rset.getString(4));
                menu.setLeaf((rset.getString(5)) == null ? "" : rset.getString(5));
                menu.setTarget((rset.getString(6)) == null ? "" : rset.getString(6));
                menu.setHyperlink((rset.getString(7)) == null ? "" : rset.getString(7));
                menu.setTagName((rset.getString(8)) == null ? "" : rset.getString(8));
                menu.setPrivilegeId((rset.getString(9)) == null ? "" : rset.getString(9));
                menu.setPopup((rset.getString(10)) == null ? "" : rset.getString(10));
                menu.setPrivilegeName((rset.getString(11)) == null ? "" : rset.getString(11));
                menu.setEnabled("Y");
                //add each menu to the menuList
                menuList.add(menu);
            }

        }
View Full Code Here


            con = super.createConnection(dsName);
            stmt = con.prepareStatement(sql);
            stmt.setString(1, userId);
            rset = stmt.executeQuery();
       
            MenuVO menu = null;
           
            while(rset.next())
            {
                menu = new MenuVO();
                menu.setMenuId((rset.getString(1)) == null ? "" : rset.getString(1));
                menu.setMenuName((rset.getString(2)) == null ? "" : rset.getString(2));
                menu.setQuickMenuName((rset.getString(3)) == null ? "" : rset.getString(3));
                menu.setParentMenuId((rset.getString(4)) == null ? "" : rset.getString(4));
                menu.setLeaf((rset.getString(5)) == null ? "" : rset.getString(5));
                menu.setTarget((rset.getString(6)) == null ? "" : rset.getString(6));
                menu.setHyperlink((rset.getString(7)) == null ? "" : rset.getString(7));
                menu.setTagName((rset.getString(8)) == null ? "" : rset.getString(8));
                menu.setPrivilegeId((rset.getString(9)) == null ? "" : rset.getString(9));
                menu.setPopup((rset.getString(10)) == null ? "" : rset.getString(10));
                menu.setPrivilegeName((rset.getString(11)) == null ? "" : rset.getString(11));
                menu.setEnabled((rset.getString(12)) == null ? "Y" : rset.getString(12));
               
                //add each menu to the menuList
                menuList.add(menu);
            }
           
View Full Code Here

        elem1 = elem1.addAttribute(ATTR_HREF, WELCOME_PAGE);


        for(int i=0; i < list.size(); i++)
        {
            MenuVO menu = (MenuVO) list.get(i);
            if(menu.getMenuName().equalsIgnoreCase(QUICK_MENU))
            {
              continue;
            }

            if (menu.getLeaf().equalsIgnoreCase(VALUE_YES))
            {
                Element elem = df.createElement(menu.getTagName());
                elem = elem.addAttribute(ATTR_ID, ATTR_VAL_ID + count);
                elem = elem.addAttribute(ATTR_NAME, menu.getQuickMenuName());
                elem = elem.addAttribute(ATTR_HREF, menu.getHyperlink());
                if(menu.getLeaf().equalsIgnoreCase(VALUE_YES))
                {
                    elem = elem.addAttribute(ATTR_LEAF, VALUE_TRUE);
                }
                else if(menu.getLeaf().equalsIgnoreCase(VALUE_NO))
                {
                    elem = elem.addAttribute(ATTR_LEAF, VALUE_FALSE);
                }
                elem = elem.addAttribute(ATTR_TARGET, menu.getTarget());

                if(menu.getPopup().equalsIgnoreCase(VALUE_YES))
                {
                    elem = elem.addAttribute(ATTR_POP, VALUE_TRUE);
                }
                else if(menu.getPopup().equalsIgnoreCase(VALUE_NO))
                {
                    elem = elem.addAttribute(ATTR_POP, VALUE_FALSE);
                }
               
                if(menu.getEnabled().equalsIgnoreCase(VALUE_NO))
                {
                    elem = elem.addAttribute(ATTR_ENABLED, VALUE_FALSE);
                }
                else
                {
View Full Code Here

        ArrayList permList = new ArrayList();
       
        // remove those menu items that the user does not have access to
        for (int i=0; i < list.size(); i++)
        {
            MenuVO menu = (MenuVO) list.get(i);
           
            if (menu.getPrivilegeId().length() > 0)
            {
                if (hasPrivilege(menu.getTagName(), menu.getPrivilegeName(), privList) == false)
                {
                    continue;
                }
            }
            permList.add(menu);
View Full Code Here

        ArrayList newList = new ArrayList();

        for (int i=0; i < list.size(); i++)
        {
            String menuId = "";
            MenuVO menu = (MenuVO) list.get(i);
           
            //log.debug(menu);
   
            if(menu.getLeaf().equalsIgnoreCase(IConstants.NO))
            {
                menuId = menu.getMenuId();
                int count = 0;
                for(int j=0; j < temp.size(); j++)
                {
                    String parentId = ((MenuVO)temp.get(j)).getParentMenuId();
                    if(menuId.equals(parentId))
                    {
                        count ++;
                    }
                }

                //log.debug(menuId + ", menuName: " + menu.getMenuName() + ", childcount: " + count);
                if(count > 0)
                {
                    newList.add(menu);
                }
            }
            else
            {
                newList.add(menu);
                continue;
            }
        }
       
        ArrayList idsToBeRemoved = new ArrayList();
       
        //check again on the nodes
        for (int i=0; i < newList.size(); i++)
        {
            MenuVO menu = (MenuVO) newList.get(i);
            //log.debug("id: " + menu.getMenuId() + ", name: " + menu.getMenuName());
            if(menu.getLeaf().equalsIgnoreCase(IConstants.NO))
            {
                //log.debug("entered....");
                String menuId = menu.getMenuId();
                int count = 0;
                for(int j=0; j < newList.size(); j++)
                {
                    String parentId = ((MenuVO)newList.get(j)).getParentMenuId();
                    if(menuId.equals(parentId))
View Full Code Here

        ArrayList bundleList = new ArrayList();
   
        String key = "";       
        for(int i=0; i < list.size(); i++)
        {
            MenuVO menu = (MenuVO) list.get(i);
            if(menu.getMenuName() != null && menu.getMenuName().trim().length() > 0)
            {
                key = menu.getMenuName();
                menu.setMenuName(bundle.getString(key));
            }
       
            if(menu.getQuickMenuName() != null && menu.getQuickMenuName().trim().length() > 0)
            {
                key = menu.getQuickMenuName();
                menu.setQuickMenuName(bundle.getString(key));
            }
       
            bundleList.add(menu);
        }
   
View Full Code Here

        DocumentFactory df = DocumentFactory.getInstance();
        Document doc = df.createDocument();
        int count = 1;
        for(int i=0; i < list.size(); i++)
        {
            MenuVO menu = (MenuVO) list.get(i);
           
            if(menu.getMenuName().equals(TAG_ROOT))
            {
                Element elem = doc.addElement(menu.getMenuName());
                elem = elem.addAttribute(ATTR_ID, ATTR_VAL_ID + 0);
                elem = elem.addAttribute(ATTR_HREF, menu.getHyperlink());
                map.put(menu.getMenuId(), elem);
                count = count + 1;
            }
            else
            {
                if(menu.getMenuName().equalsIgnoreCase(FULL_MENU))
                {
                  count = count + 1;
                  continue;
                }
               
                Element elem = ((Element) map.get(menu.getParentMenuId()));
                elem = elem.addElement(menu.getTagName());
                elem = elem.addAttribute(ATTR_ID, ATTR_VAL_ID + menu.getMenuId() + (menu.getLeaf().equalsIgnoreCase(VALUE_NO) ? VALUE_CLOSED : ""));
                elem = elem.addAttribute(ATTR_NAME, menu.getMenuName());
                elem = elem.addAttribute(ATTR_Q_NAME, menu.getQuickMenuName());
               
                elem = elem.addAttribute(ATTR_HREF, menu.getHyperlink());
                if(menu.getLeaf().equalsIgnoreCase(VALUE_YES))
                {
                    elem = elem.addAttribute(ATTR_LEAF, VALUE_TRUE);
                }
                else if(menu.getLeaf().equalsIgnoreCase(VALUE_NO))
                {
                    elem = elem.addAttribute(ATTR_LEAF, VALUE_FALSE);
                }
                elem = elem.addAttribute(ATTR_TARGET, menu.getTarget());
           
                if(menu.getPopup().equalsIgnoreCase(VALUE_YES))
                {
                    elem = elem.addAttribute(ATTR_POP, VALUE_TRUE);
                }
                else if(menu.getPopup().equalsIgnoreCase(VALUE_NO))
                {
                    elem = elem.addAttribute(ATTR_POP, VALUE_FALSE);
                }
               
                if(menu !=null && menu.getEnabled().equalsIgnoreCase(VALUE_NO))
                {
                    elem = elem.addAttribute(ATTR_ENABLED, VALUE_FALSE);
                }
                else
                {
                    elem = elem.addAttribute(ATTR_ENABLED, VALUE_TRUE);
                }
               
               
                map.put(menu.getMenuId(), elem);
               
                count = count + 1;
            }
        }
       
View Full Code Here

TOP

Related Classes of com.eforce.baby.auth.vo.MenuVO

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.