Package com.groiss.reporting
Class QueryEngine
java.lang.Object
com.groiss.reporting.QueryEngine
initalize reporting and executes reports
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Aborts a query executionstatic String
Executes a query Object using cacheExecutes a query Object using cachestatic void
the method executes report in a iframe context.static String
generateQueryId
(Query q, User u) returns a unique query ID for caching purposesstatic Query
static int
static String
getLocalizeString
(String key) static int
protected static int
static Query
getQueryObject
(String id, String title, Document queryDoc, Report q, Map<String, String[]> paramMap, Date execution) Create Query Objectstatic Query
getQueryObject
(HttpServletRequest req, boolean isStandardSearch) static ReportingData
getReportingDataInstance
(String entity, String attribute) static ReportingData
static String
returns always "reporting.xml"static ReportingTableModel
getTableModel
(List<List<Object>> values, Query q) static boolean
static boolean
hasStatRight
(User u) check if a specified user has the statistic rightstatic boolean
static void
init
(boolean forceInitalize) initalize the engine configurationstatic boolean
isOracle()
static String
static boolean
static void
sendReportRefreshToClient
(String reportId) Send refresh notification to clients to refresh displayed reports with the given id.static void
sendReportRefreshToClient
(String reportId, int maxSecondsDelayToRefresh) Send refresh notification to clients to refresh displayed reports with the given id.static void
setThreadTzAndLocale
(String tz, String locale) static void
shedules reinitalization for Reporting enginestatic void
showStatus
(HttpServletRequest req, HttpServletResponse resp)
-
Method Details
-
init
public static void init(boolean forceInitalize) initalize the engine configuration -
sheduleReinit
public static void sheduleReinit()shedules reinitalization for Reporting engine -
setThreadTzAndLocale
- Parameters:
tz
-locale
-
-
hasStatRight
check if a specified user has the statistic right- Parameters:
u
- the user- Returns:
true
if the user has the rightstatistic
-
hasStatRight
public static boolean hasStatRight() -
getQueryObject
-
getQueryObject
public static Query getQueryObject(String id, String title, Document queryDoc, Report q, Map<String, String[]> paramMap, Date execution) Create Query Object- Parameters:
id
- the query idtitle
- the query titlequeryDoc
- the xml structure of the reportq
- the base stored query - maybe nullparamMap
- the map with parametersexecution
- execution timestamp- Returns:
-
executeQuery
the method executes report in a iframe context. it loads the result in the main-window, if executed in the 'right' frame, or fully standalone if loaded in any other frame -
getTableModel
- Parameters:
values
- the result values
the list of lists contains instances of com.groiss.reporting.data.ReportingExportable or java.lang.Stringq
- the query object- Returns:
- the result tablemodel
-
inCache
-
execute
-
execute
Executes a query Object using cache- Parameters:
q
- - the query object- Returns:
- a Pair. first Entry is the query Object, the second the result values
the list of lists contains instances of com.groiss.reporting.data.ReportingExportable or java.lang.String
This matrix is the raw data of the ReportingTableModel
-
execute
Executes a query Object using cache- Parameters:
q
- - the query objectquery_id
- - the internal cache id of the query, use generateQueryId Method to generate an unique ID.- Returns:
- a Pair. first Entry is the query Object, the second the result values
the list of lists contains instances of com.groiss.reporting.data.ReportingExportable or java.lang.String
This matrix is the raw data of the ReportingTableModel
-
encodeId
-
isOracle
public static boolean isOracle()- Returns:
true
if Database is Oracle
-
generateQueryId
returns a unique query ID for caching purposes -
abort
Aborts a query execution- Parameters:
query_id
- the queryid to abort
-
openFormInEditMode
public static boolean openFormInEditMode()- Returns:
- true if forms should be opened in edit mode
-
getDocSearchMode
public static int getDocSearchMode()- Returns:
- the configured documet search mode
-
getSystemSchemaFile
returns always "reporting.xml"- Returns:
- the name of the configured system schema file path
-
getReportingDataInstance
- Parameters:
entity
- the referenced entity id of schemaattribute
- the referenced attribute id of schema- Returns:
- the ReportingData Object for this attribute
-
getReportingDataInstance
- Parameters:
e
- the xml element of the query xml- Returns:
- the ReportingData Object for this attribute
- See Also:
-
getContextQuery
- Returns:
- current executed queryobject
-
localize
-
getLocalizeString
-
getMaxTable
protected static int getMaxTable()- Returns:
- the maxTable
-
sendReportRefreshToClient
Send refresh notification to clients to refresh displayed reports with the given id. Maximum refresh delay is 30 seconds- Parameters:
reportId
- the report to refresh - must not be null
-
sendReportRefreshToClient
Send refresh notification to clients to refresh displayed reports with the given id.- Parameters:
reportId
- the report to refresh - must not be nullmaxSecondsDelayToRefresh
- - maximum delay (in seconds, default:30) to refresh report, the actual delay is random. If a negative number is used, the event is sent immediately, if not, the notification is done after commit of the user transaction
-
showStatus
- Throws:
Exception
-
getMaxParallel
public static int getMaxParallel()- Returns:
- the maxParallel
-