예제 #1
0
  public Collection<MenuVo> getMenuView(Collection<MenuVo> todPermMenu, long idMnuPai) {
    Set retorno = new HashSet();
    for (Iterator it = todPermMenu.iterator(); it.hasNext(); ) {
      MenuVo vo = (MenuVo) it.next();
      if (vo.getMnuPai() == idMnuPai) {
        retorno.add(vo);
      }
    }

    return ordenar(retorno);
  }
예제 #2
0
  public Collection<MenuVo> percorreMenu(
      String mappingpath, Collection<MenuVo> menuViewAtual, Collection<MenuVo> todMenusAcesso) {
    MenuVo menuAcessado = null;

    Set retorno = new HashSet();

    for (Iterator it = menuViewAtual.iterator(); it.hasNext(); ) {
      MenuVo mnu = (MenuVo) it.next();

      StringBuffer buffer = new StringBuffer(mappingpath);

      buffer = buffer.delete(0, 1);

      String uriAcesso = "javascript:menuSubmit(\"" + buffer.toString() + ".do\");";

      if (uriAcesso.equalsIgnoreCase(mnu.getMnuUri())) {
        menuAcessado = mnu;
      }
    }

    if (menuAcessado == null) {
      return null;
    }

    for (Iterator it2 = todMenusAcesso.iterator(); it2.hasNext(); ) {
      MenuVo mnu = (MenuVo) it2.next();
      if (mnu.getMnuPai() == menuAcessado.getMnuId()) {
        retorno.add(mnu);
      }
    }

    if (retorno.isEmpty()) {
      return null;
    }

    return ordenar(retorno);
  }