Search in sources :

Example 6 with NaviMap

use of app.hongs.action.NaviMap in project HongsCORE by ihongs.

the class MenuAction method getRedirect.

private String getRedirect(NaviMap site, Map<String, Map> menu) throws HongsException {
    for (Map.Entry<String, Map> et : menu.entrySet()) {
        String href = et.getKey();
        if (href.startsWith("!")) {
            continue;
        }
        if (href.startsWith("#") || href.startsWith(MENU_ACT_URI + "?")) {
            Map item = et.getValue();
            Map<String, Map> subs = (Map) item.get("menus");
            if (subs != null && !subs.isEmpty()) {
                href = getRedirect(site, subs);
                if (null != href) {
                    return href;
                }
            }
        } else {
            if (site.chkMenu(href)) {
                return href;
            }
        }
    }
    return null;
}
Also used : NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) HashMap(java.util.HashMap)

Example 7 with NaviMap

use of app.hongs.action.NaviMap in project HongsCORE by ihongs.

the class JointGate method getMenu.

private Map getMenu(String mod, String ent) throws HongsException {
    String cuf = FormSet.hasConfFile(mod + "/" + ent) ? mod + "/" + ent : mod;
    NaviMap navi = NaviMap.getInstance(cuf);
    return navi.getMenu(mod + "/" + ent + "/");
}
Also used : NaviMap(app.hongs.action.NaviMap)

Example 8 with NaviMap

use of app.hongs.action.NaviMap in project HongsCORE by ihongs.

the class AuthTag method doStartTag.

@Override
public int doStartTag() throws JspException {
    try {
        NaviMap nav = NaviMap.getInstance(this.cnf);
        this.ebb = (this.act == null || nav.chkAuth(this.act)) && (this.rol == null || nav.chkRole(this.rol)) && (this.men == null || nav.chkRole(this.men));
    } catch (HongsException ex) {
        throw new JspException(ex);
    }
    if (this.not) {
        this.ebb = !this.ebb;
    }
    if (this.ebb) {
        return BodyTagSupport.EVAL_BODY_BUFFERED;
    } else {
        return BodyTagSupport.SKIP_BODY;
    }
}
Also used : JspException(javax.servlet.jsp.JspException) HongsException(app.hongs.HongsException) NaviMap(app.hongs.action.NaviMap)

Aggregations

NaviMap (app.hongs.action.NaviMap)8 HashSet (java.util.HashSet)4 HongsException (app.hongs.HongsException)3 ActionHelper (app.hongs.action.ActionHelper)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Core (app.hongs.Core)1 HongsError (app.hongs.HongsError)1 HongsExpedient (app.hongs.HongsExpedient)1 Action (app.hongs.action.anno.Action)1 Set (java.util.Set)1 JspException (javax.servlet.jsp.JspException)1