Package it.eng.spagobi.wapp.bo

Examples of it.eng.spagobi.wapp.bo.Menu


    try{
      if(menu.getParentId()==null){
        return menu.getName();
      }
      else{
        Menu parent=DAOFactory.getMenuDAO().loadMenuByID(menu.getParentId());   
        // can happen that parent is not found
        if(parent == null){
          return menu.getName();
        }
        else{
View Full Code Here


  public static List filterListForUser(List menuList,IEngUserProfile userProfile){
    List filteredMenuList = new ArrayList();

    if(menuList!=null && !menuList.isEmpty()){
      for (int i=0; i<menuList.size(); i++){
        Menu menuElem = (Menu)menuList.get(i);
        boolean canView = false;
        if (menuElem.getCode() ==null)
          canView=MenuAccessVerifier.canView(menuElem,userProfile);
        else
          canView = true; //technical menu voice is ever visible if it's present
        if(canView){
          filteredMenuList.add(menuElem);
View Full Code Here

          List lstUserMenuItems  = DAOFactory.getMenuRolesDAO().loadMenuByRoleId(role.getId());
          if (lstUserMenuItems == null)
            logger.debug("Not found menu items for User Role " + (String)arrRoles[i] );
          else {
            for(int j=0; j<lstUserMenuItems.size(); j++){
              Menu tmpObj = (Menu)lstUserMenuItems.get(j);

              if (!containsMenu(lstFinalMenu, tmpObj)){           
                lstFinalMenu.add(tmpObj)
              }
              else{
                //checks merge of children's item               
                List tmpObjChildren = tmpObj.getLstChildren();
                List tmpNewObjChildren = new ArrayList();

                for (int k=0; k<tmpObjChildren.size();k++){
                  Menu tmpObjChild = (Menu)tmpObjChildren.get(k);               
                  if (!containsMenuChildren(lstFinalMenu, tmpObjChild)){   
                    tmpNewObjChildren.add(tmpObjChild);
                  }
                  else{
                    //if (!tmpNewObjChildren.contains(originalChild))
View Full Code Here

   * @param itemSB the technical item to add
   * @param father
   * @return
   */
  private static Menu getAdminItem(SourceBean itemSB, Integer progStart, IEngUserProfile profile){
    Menu node = new Menu();
    try{
      Integer menuId = new Integer(progStart*1000);         

      String functionality = (String) itemSB.getAttribute("functionality");
      String code = (String) itemSB.getAttribute("code");
      String titleCode = (String) itemSB.getAttribute("title");
      String iconUrl = (String) itemSB.getAttribute("iconUrl");
      String url = (String) itemSB.getAttribute("url");

      node.setMenuId(menuId);     
      node.setCode(code);   
      node.setParentId(null);
      node.setProg(progStart);
      node.setName(titleCode);
      node.setLevel(new Integer(1));
      node.setDescr(titleCode);
      node.setUrl(url);
      node.setViewIcons(true);
      node.setIconPath(iconUrl);
      node.setAdminsMenu(true);

      if (functionality == null) {
        //father node
        List subItems = itemSB.getAttributeAsList("ITEM")
        Iterator it = subItems.iterator();
        if (subItems == null || subItems.isEmpty())
          node.setHasChildren(false);
        else{
          node.setHasChildren(true);     
          List lstChildren = new ArrayList();
          while (it.hasNext()) {
            //defines children
            SourceBean subItem = (SourceBean) it.next();
            if (isAbleToSeeItem(subItem, profile)) {
              functionality = (String) subItem.getAttribute("functionality");
              code = (String) subItem.getAttribute("code");
              titleCode = (String) subItem.getAttribute("title");
              iconUrl = (String) subItem.getAttribute("iconUrl");
              url = (String) subItem.getAttribute("url");

              Menu subNode = new Menu();
              subNode.setMenuId(menuId++);
              subNode.setCode(code);                 
              subNode.setParentId(progStart*1000);
              subNode.setName(titleCode);
              subNode.setProg(progStart);
              subNode.setLevel(new Integer(2));
              subNode.setDescr(titleCode);             
              subNode.setUrl(url);
              subNode.setViewIcons(true);
              subNode.setIconPath(iconUrl)
              subNode.setAdminsMenu(true);
              lstChildren.add(subNode);
            }
          }
          node.setLstChildren(lstChildren);
        }
View Full Code Here

   */
  public static boolean containsMenu(List lst, Menu menu){
    if (lst == null)
      return false;
    for (int i=0; i<lst.size(); i++){
      Menu tmpMenu = (Menu)lst.get(i);

      if (tmpMenu.getMenuId().intValue() == menu.getMenuId().intValue()){     
        originalChild = tmpMenu;
        positionChild = i;       
        return true
      }

View Full Code Here

  public static boolean containsMenuChildren(List generalChildren, Menu menuChildren){

    if (generalChildren == null)
      return false;
    for (int i=0; i<generalChildren.size(); i++){
      Menu tmpMenu = (Menu)generalChildren.get(i);

      if (tmpMenu.getMenuId().intValue() == menuChildren.getMenuId().intValue()){       
        originalChild = tmpMenu; 
        return true
      }

    }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.wapp.bo.Menu

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.