- Extend I18n support for MESSAGE attribute in UNIQ-CHECK and other tags. - Add code completion and reference navigation for CHECK-FIELDS resolving against related grid datasets. - Fix duplicate i18n Inlay Hints in JSP and JS files by targeting the innermost PSI elements. - Enhance MGET_PATTERN regex to support object-chained calls (e.g., factory.$M.get).
93 lines
2.9 KiB
Plaintext
Executable File
93 lines
2.9 KiB
Plaintext
Executable File
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
|
|
<%@ page import="java.lang.reflect.*" %>
|
|
<%@ page import="sdk.json.*" %>
|
|
<%@ page import="sdk.utils.*" %>
|
|
<%@ page import="sdk.api.client.*" %>
|
|
<%@ page import="java.util.*" %>
|
|
<%@ page import="com.apps.SystemFactory" %>
|
|
<%@ page import="sdk.db.connector.*" %>
|
|
<%@ page import="com.bgt.model.bean.*" %>
|
|
<%!
|
|
SDKLogger logger = new SDKLogger("Operate-actions");
|
|
|
|
|
|
public boolean bgt0102010_add(SystemFactory factory, JSONObject jsData) {
|
|
if (!jsData.getString("-- some important field --").isBlank()) {
|
|
DBConnector dbConn = factory.appDatabase.getXConnector();
|
|
try {
|
|
{
|
|
REFER_CODE dsRefcode = new REFER_CODE(dbConn);
|
|
dsRefcode.append();
|
|
dsRefcode.setRFG_GRP("STG-ITEMS");
|
|
dsRefcode.setRFC_CODE(jsData.getString(REFER_CODE.RFC_CODE));
|
|
dsRefcode.setRFC_DESC(jsData.getString(REFER_CODE.RFC_DESC));
|
|
dsRefcode.setRFC_FLAG(jsData.getString(REFER_CODE.RFC_FLAG));
|
|
dsRefcode.execute();
|
|
}
|
|
{
|
|
REFER_GROUP dsRefGroup = new REFER_GROUP(dbConn);
|
|
dsRefGroup.insert();
|
|
dsRefGroup.setRFG_CODE(jsData.getString(REFER_CODE.RFC_CODE));
|
|
dsRefGroup.setRFG_NAME(jsData.getString(REFER_CODE.RFC_DESC));
|
|
dsRefGroup.setRFG_FLAG(jsData.getString(REFER_CODE.RFC_FLAG));
|
|
dsRefGroup.setRFG_EDITOR("STG");
|
|
dsRefGroup.execute();
|
|
}
|
|
factory.setRestCode("OK");
|
|
dbConn.close();
|
|
} catch (Exception ex) {
|
|
factory.setRestCode("ERROR");
|
|
factory.setRestMsg(ex.getMessage());
|
|
dbConn.close();
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public boolean _action_skeleton(SystemFactory factory, JSONObject jsData) {
|
|
if (!jsData.getString("-- some important field --").isBlank()) {
|
|
DBConnector dbConn = factory.appDatabase.getXConnector();
|
|
try {
|
|
|
|
factory.setRestCode("OK");
|
|
dbConn.close();
|
|
} catch (Exception ex) {
|
|
factory.setRestCode("ERROR");
|
|
factory.setRestMsg(ex.getMessage());
|
|
dbConn.close();
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public boolean execute(String action, SystemFactory factory) {
|
|
try {
|
|
Class<?> thisClass = getClass();
|
|
Method mtAction = thisClass.getMethod(action, SystemFactory.class, JSONObject.class);
|
|
String data = factory.rqsCtx.getParameter("data", "{}");
|
|
JSONObject jsData = new JSONObject(data);
|
|
boolean result = (boolean) mtAction.invoke(this, factory, jsData);
|
|
return result;
|
|
} catch (Exception e) {
|
|
factory.setRestCode("ERROR");
|
|
factory.setRestMsg(e+"\n"+JUtils.stackToString(e,10));
|
|
logger.error(e);
|
|
return false;
|
|
}
|
|
}
|
|
%>
|
|
|
|
<%
|
|
SystemFactory factory = SystemFactory.getInstance(request);
|
|
String action = factory.rqsCtx.getParameter("action", "");
|
|
|
|
if (factory.isValidJaxVF()) {
|
|
action = action.replaceAll("-", "_").replaceAll(" ", "_");
|
|
this.execute(action, factory);
|
|
} else {
|
|
factory.setRestCode("ERROR");
|
|
factory.setRestMsg("TK-Controller mismatch.");
|
|
}
|
|
%> |