Package cronapi
Class QueryManager
- java.lang.Object
-
- cronapi.QueryManager
-
public class QueryManager extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDISABLE_AUTHstatic ThreadLocal<com.google.gson.JsonObject>JSON_CACHE
-
Constructor Summary
Constructors Constructor Description QueryManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddCalcFields(com.google.gson.JsonObject query, DataSource ds)static voidaddCalcFields(com.google.gson.JsonObject query, Object ds, boolean post)static voidaddDefaultValues(com.google.gson.JsonObject query, Var ds, boolean onlyNull)static voidaddFilter(com.google.gson.JsonObject query, String field, String type, String operator, String value)static voidcheckEntityFilterSecurity(Object obj, List<String> filters)static voidcheckFieldSecurity(com.google.gson.JsonObject query, Object ds, String method)static voidcheckFilterSecurity(com.google.gson.JsonObject query, DataSourceFilter filter)static voidcheckFilterSecurity(com.google.gson.JsonObject query, List<String> filter)static voidcheckMultiTenant(com.google.gson.JsonObject query, DataSource ds)static voidcheckSecurity(com.google.gson.JsonObject obj, String verb)static voidcheckSecurity(com.google.gson.JsonObject obj, String verb, boolean checkAuthorities)static voidcheckSecurity(Class clazz, String method)static com.google.gson.JsonObjectcreateDefaultPermission(com.google.gson.JsonElement permission, String method)static com.google.gson.JsonObjectcreateNewQuery(String entityFullName)static VardoExecuteBlockly(com.google.gson.JsonObject blockly, String method, Var... params)static VarexecuteBlockly(com.google.gson.JsonObject query, String method, Var... vars)static VarexecuteEvent(com.google.gson.JsonObject query, Object ds, String eventName)static VarexecuteEvent(com.google.gson.JsonObject query, Object ds, String eventName, List<Object> keys, String entityName, Map<String,Var> customValues)static voidexecuteEvent(com.google.gson.JsonObject query, String eventName, Var... params)static voidexecuteEvent(com.google.gson.JsonObject query, String eventName, Map<String,Var> customValues)static voidexecuteNavigateEvent(com.google.gson.JsonObject query, DataSource ds)static com.google.gson.JsonArraygetAuthorities(com.google.gson.JsonObject datasource, String verb)static StringgetBlocklyMethod(com.google.gson.JsonObject query, String method)static Map<String,Object>getCalcFieldValues(com.google.gson.JsonObject query, Object bean)static Map<String,Object>getDefaultValues(com.google.gson.JsonObject query, Object bean)static StringgetJPQL(com.google.gson.JsonObject query, boolean checkMultitenant)static com.google.gson.JsonObjectgetJSON()static VargetParameterValue(com.google.gson.JsonObject customQuery, String param, Object ds, Map<String,Var> customValues)static VargetParameterValue(com.google.gson.JsonObject customQuery, String param, Map<String,Var> customValues)static com.google.gson.JsonObjectgetQuery(String id)static StringgetType(com.google.gson.JsonObject obj)static booleanhasParameterValue(com.google.gson.JsonObject customQuery, String param)static booleanisDynamicField(com.google.gson.JsonObject query, String field)static booleanisFieldAuthorized(com.google.gson.JsonObject query, String field, String method)static booleanisFieldAuthorized(Class clazzToCheck, String key, String method)static booleanisNull(com.google.gson.JsonElement value)static voidloadJSONFromFile(File file)static VarparseExpressionValue(com.google.gson.JsonElement element)static VarparseExpressionValue(com.google.gson.JsonObject query, Object ds, String str, Map<String,Var> customValues)static VarparseExpressionValue(Object ds, com.google.gson.JsonElement element, Map<String,Var> customValues)static VarparseExpressionValue(Object ds, String str, Map<String,Var> customValues)static VarparseExpressionValue(String id, com.google.gson.JsonObject query, Object ds, com.google.gson.JsonElement element, Map<String,Var> customValues)
-
-
-
Field Detail
-
JSON_CACHE
public static ThreadLocal<com.google.gson.JsonObject> JSON_CACHE
-
DISABLE_AUTH
public static boolean DISABLE_AUTH
-
-
Method Detail
-
loadJSONFromFile
public static void loadJSONFromFile(File file) throws IOException
- Throws:
IOException
-
getJSON
public static com.google.gson.JsonObject getJSON()
-
getQuery
public static com.google.gson.JsonObject getQuery(String id)
-
getJPQL
public static String getJPQL(com.google.gson.JsonObject query, boolean checkMultitenant)
-
getType
public static String getType(com.google.gson.JsonObject obj)
-
checkSecurity
public static void checkSecurity(com.google.gson.JsonObject obj, String verb)
-
getAuthorities
public static com.google.gson.JsonArray getAuthorities(com.google.gson.JsonObject datasource, String verb)
-
checkSecurity
public static void checkSecurity(com.google.gson.JsonObject obj, String verb, boolean checkAuthorities)
-
isNull
public static boolean isNull(com.google.gson.JsonElement value)
-
addDefaultValues
public static void addDefaultValues(com.google.gson.JsonObject query, Var ds, boolean onlyNull)
-
executeEvent
public static Var executeEvent(com.google.gson.JsonObject query, Object ds, String eventName)
-
executeEvent
public static Var executeEvent(com.google.gson.JsonObject query, Object ds, String eventName, List<Object> keys, String entityName, Map<String,Var> customValues)
-
executeEvent
public static void executeEvent(com.google.gson.JsonObject query, String eventName, Map<String,Var> customValues)
-
executeEvent
public static void executeEvent(com.google.gson.JsonObject query, String eventName, Var... params)
-
executeNavigateEvent
public static void executeNavigateEvent(com.google.gson.JsonObject query, DataSource ds)
-
doExecuteBlockly
public static Var doExecuteBlockly(com.google.gson.JsonObject blockly, String method, Var... params) throws Exception
- Throws:
Exception
-
executeBlockly
public static Var executeBlockly(com.google.gson.JsonObject query, String method, Var... vars)
-
hasParameterValue
public static boolean hasParameterValue(com.google.gson.JsonObject customQuery, String param)
-
getParameterValue
public static Var getParameterValue(com.google.gson.JsonObject customQuery, String param, Object ds, Map<String,Var> customValues)
-
getParameterValue
public static Var getParameterValue(com.google.gson.JsonObject customQuery, String param, Map<String,Var> customValues)
-
getBlocklyMethod
public static String getBlocklyMethod(com.google.gson.JsonObject query, String method)
-
isFieldAuthorized
public static boolean isFieldAuthorized(Class clazzToCheck, String key, String method) throws Exception
- Throws:
Exception
-
checkSecurity
public static void checkSecurity(Class clazz, String method) throws Exception
- Throws:
Exception
-
createDefaultPermission
public static com.google.gson.JsonObject createDefaultPermission(com.google.gson.JsonElement permission, String method)
-
isDynamicField
public static boolean isDynamicField(com.google.gson.JsonObject query, String field)
-
isFieldAuthorized
public static boolean isFieldAuthorized(com.google.gson.JsonObject query, String field, String method) throws Exception- Throws:
Exception
-
checkFieldSecurity
public static void checkFieldSecurity(com.google.gson.JsonObject query, Object ds, String method) throws Exception- Throws:
Exception
-
checkFilterSecurity
public static void checkFilterSecurity(com.google.gson.JsonObject query, DataSourceFilter filter)
-
checkEntityFilterSecurity
public static void checkEntityFilterSecurity(Object obj, List<String> filters)
-
checkFilterSecurity
public static void checkFilterSecurity(com.google.gson.JsonObject query, List<String> filter)
-
getCalcFieldValues
public static Map<String,Object> getCalcFieldValues(com.google.gson.JsonObject query, Object bean)
-
getDefaultValues
public static Map<String,Object> getDefaultValues(com.google.gson.JsonObject query, Object bean)
-
parseExpressionValue
public static Var parseExpressionValue(Object ds, String str, Map<String,Var> customValues)
-
parseExpressionValue
public static Var parseExpressionValue(com.google.gson.JsonObject query, Object ds, String str, Map<String,Var> customValues)
-
parseExpressionValue
public static Var parseExpressionValue(Object ds, com.google.gson.JsonElement element, Map<String,Var> customValues)
-
parseExpressionValue
public static Var parseExpressionValue(String id, com.google.gson.JsonObject query, Object ds, com.google.gson.JsonElement element, Map<String,Var> customValues)
-
parseExpressionValue
public static Var parseExpressionValue(com.google.gson.JsonElement element)
-
addCalcFields
public static void addCalcFields(com.google.gson.JsonObject query, DataSource ds)
-
addCalcFields
public static void addCalcFields(com.google.gson.JsonObject query, Object ds, boolean post)
-
checkMultiTenant
public static void checkMultiTenant(com.google.gson.JsonObject query, DataSource ds)
-
createNewQuery
public static com.google.gson.JsonObject createNewQuery(String entityFullName)
-
-