Search in sources :

Example 16 with FetchCase

use of app.hongs.db.util.FetchCase in project HongsCORE by ihongs.

the class UserAction method getList.

@Action("list")
public void getList(ActionHelper helper) throws HongsException {
    Map rd = helper.getRequestData();
    FetchCase fc = model.fetchCase();
    fc.setOption("INCLUDE_REMOVED", Synt.declare(rd.get("include-removed"), false));
    fc.setOption("INCLUDE_PARENTS", Synt.declare(rd.get("include-parents"), false));
    rd = model.getList(rd, fc);
    // Remove the password field, don't show password in page
    List<Map> list = (List) rd.get("list");
    for (Map info : list) {
        info.remove("password");
        info.remove("passcode");
    }
    helper.reply(rd);
}
Also used : FetchCase(app.hongs.db.util.FetchCase) List(java.util.List) HashMap(java.util.HashMap) NaviMap(app.hongs.action.NaviMap) Map(java.util.Map) RoleMap(app.hongs.serv.auth.RoleMap) Action(app.hongs.action.anno.Action)

Example 17 with FetchCase

use of app.hongs.db.util.FetchCase in project HongsCORE by ihongs.

the class DBAction method isUnique.

@Action("unique")
public void isUnique(ActionHelper helper) throws HongsException {
    Model ett = getEntity(helper);
    Map req = helper.getRequestData();
    req = getReqMap(helper, ett, "unique", req);
    FetchCase c = new FetchCase();
    c.setOption("INCLUDE_REMOVED", Synt.declare(req.get("include-removed"), false));
    boolean val = ett.unique(req, c);
    helper.reply(null, val ? 1 : 0);
}
Also used : FetchCase(app.hongs.db.util.FetchCase) Map(java.util.Map) Action(app.hongs.action.anno.Action) IAction(app.hongs.dh.IAction)

Aggregations

FetchCase (app.hongs.db.util.FetchCase)17 Map (java.util.Map)14 Action (app.hongs.action.anno.Action)8 HashMap (java.util.HashMap)8 NaviMap (app.hongs.action.NaviMap)5 RoleMap (app.hongs.serv.auth.RoleMap)5 Table (app.hongs.db.Table)4 HashSet (java.util.HashSet)4 HongsException (app.hongs.HongsException)3 LinkedHashMap (java.util.LinkedHashMap)3 LinkedHashSet (java.util.LinkedHashSet)3 Set (java.util.Set)3 DB (app.hongs.db.DB)2 IAction (app.hongs.dh.IAction)2 Collection (java.util.Collection)2 CoreLocale (app.hongs.CoreLocale)1 CommitSuccess (app.hongs.action.anno.CommitSuccess)1 Verify (app.hongs.action.anno.Verify)1 RoleSet (app.hongs.serv.auth.RoleSet)1 Iterator (java.util.Iterator)1