use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class UnitAction method doSave.
@Action("save")
@Verify(conf = "matrix", form = "unit")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
Map data = helper.getRequestData();
String id = model.set(data);
Map info = new HashMap();
info.put("id", id);
info.put("name", data.get("name"));
CoreLocale lang = CoreLocale.getInstance().clone();
lang.load("matrix");
String ms = lang.translate("core.save.unit.success");
helper.reply(ms, info);
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class UnitAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map data = helper.getRequestData();
int rows = model.delete(data);
CoreLocale lang = CoreLocale.getInstance().clone();
lang.load("matrix");
String ms = lang.translate("core.delete.unit.success", Integer.toString(rows));
helper.reply(ms, rows);
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class MenuAction method list.
@Action("list")
public void list(ActionHelper helper) throws HongsException {
String m = helper.getParameter("m");
String n = helper.getParameter("n");
String d = helper.getParameter("d");
List l;
int b;
if (m == null || m.length() == 0) {
m = "default";
}
if (d != null && d.length() != 0) {
b = Integer.parseInt(d);
} else {
b = 1;
}
if (n != null && n.length() != 0) {
l = NaviMap.getInstance(m).getMenuTranslated(n, b);
} else {
l = NaviMap.getInstance(m).getMenuTranslated(b);
}
Map data = new HashMap();
data.put("list", l);
helper.reply(data);
}
use of app.hongs.action.anno.Action 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);
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class DBAction method search.
@Action("search")
@Preset(conf = "", form = "")
@Select(conf = "", form = "")
@Override
public void search(ActionHelper helper) throws HongsException {
Model ett = getEntity(helper);
Map req = helper.getRequestData();
req = getReqMap(helper, ett, "search", req);
Map rsp = ett.search(req);
rsp = getRspMap(helper, ett, "search", rsp);
helper.reply(rsp);
}
Aggregations