use of io.github.ihongs.action.anno.Select in project HongsCORE by ihongs.
the class UserAction method getInfo.
@Action("info")
@Select(conf = "master", form = "user")
public void getInfo(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
String id = helper.getParameter("id");
String nc = helper.getParameter("with-roles");
String ud = (String) helper.getSessibute(Cnst.UID_SES);
if (id != null && id.length() != 0) {
rd = model.getInfo(rd);
} else {
rd = new HashMap();
}
// With all roles
if (nc != null && nc.length() != 0) {
List rs = NaviMap.getInstance(nc).getRoleTranslated(0, !Cnst.ADM_UID.equals(ud) ? AuthKit.getUserRoles(ud) : null);
Dict.put(rd, rs, "enfo", "roles..role");
}
// Remove the password field, don't show password in page
Map info = (Map) rd.get("info");
if (info != null) {
info.remove("password");
info.remove("passcode");
}
helper.reply(rd);
}
use of io.github.ihongs.action.anno.Select in project HongsCORE by ihongs.
the class FormAction method getList.
@Action("list")
@Select(conf = "matrix", form = "form")
public void getList(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
Map sd = model.getList(rd);
helper.reply(sd);
}
use of io.github.ihongs.action.anno.Select in project HongsCORE by ihongs.
the class SearchAction method search.
@Action("search")
@Preset(conf = "", form = "")
@Select(conf = "", form = "")
@Override
public void search(ActionHelper helper) throws HongsException {
/**
* 有指定查询条件则按匹配度排序
*/
Map rd = helper.getRequestData();
Object wd = rd.get(Cnst.WD_KEY);
if (wd != null && !"".equals(wd)) {
Set xb = Synt.toTerms(rd.get(Cnst.OB_KEY));
List ob;
if (xb == null) {
ob = new ArrayList(1);
rd.put(Cnst.OB_KEY, ob);
ob.add(0, "-");
} else if (!xb.contains("-") && !xb.contains("*")) {
ob = new ArrayList(xb);
rd.put(Cnst.OB_KEY, ob);
ob.add(0, "-");
}
}
super.search(helper);
}
Aggregations