mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-881 - Refactoring exports & reports
- add some fields together into ReportDestination class - pass more data into export streamers (views) and add preRun method - Add queryHint POTENTIALLY_LARGE_NUMBER_OF_RESULTS - add pivot views - optionally take in full ReportMetaData object instead of a name (e.g., for a user-defined/saved report)
This commit is contained in:
@ -77,6 +77,7 @@ import com.kingsrook.qqq.backend.core.model.actions.metadata.TableMetaDataInput;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.metadata.TableMetaDataOutput;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ExportInput;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ExportOutput;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportDestination;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportFormat;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.tables.QInputSource;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.tables.count.CountInput;
|
||||
@ -1492,10 +1493,11 @@ public class QJavalinImplementation
|
||||
setupSession(context, exportInput);
|
||||
|
||||
exportInput.setTableName(tableName);
|
||||
exportInput.setReportFormat(reportFormat);
|
||||
|
||||
String filename = optionalFilename.orElse(tableName + "." + reportFormat.toString().toLowerCase(Locale.ROOT));
|
||||
exportInput.setFilename(filename);
|
||||
exportInput.withReportDestination(new ReportDestination()
|
||||
.withReportFormat(reportFormat)
|
||||
.withFilename(filename));
|
||||
|
||||
Integer limit = QJavalinUtils.integerQueryParam(context, "limit");
|
||||
exportInput.setLimit(limit);
|
||||
@ -1526,7 +1528,7 @@ public class QJavalinImplementation
|
||||
|
||||
UnsafeFunction<PipedOutputStream, ExportAction, Exception> preAction = (PipedOutputStream pos) ->
|
||||
{
|
||||
exportInput.setReportOutputStream(pos);
|
||||
exportInput.getReportDestination().setReportOutputStream(pos);
|
||||
|
||||
ExportAction exportAction = new ExportAction();
|
||||
exportAction.preExecute(exportInput);
|
||||
|
@ -60,6 +60,7 @@ import com.kingsrook.qqq.backend.core.model.actions.processes.ProcessState;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.processes.QUploadedFile;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.processes.RunProcessInput;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.processes.RunProcessOutput;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportDestination;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportFormat;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportInput;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.tables.insert.InsertInput;
|
||||
@ -203,10 +204,12 @@ public class QJavalinProcessHandler
|
||||
QJavalinImplementation.setupSession(context, reportInput);
|
||||
PermissionsHelper.checkReportPermissionThrowing(reportInput, reportName);
|
||||
|
||||
reportInput.setReportFormat(reportFormat);
|
||||
reportInput.setReportName(reportName);
|
||||
reportInput.setInputValues(null); // todo!
|
||||
reportInput.setFilename(filename);
|
||||
|
||||
reportInput.setReportDestination(new ReportDestination()
|
||||
.withReportFormat(reportFormat)
|
||||
.withFilename(filename));
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// process the report's input fields, from the query string //
|
||||
@ -239,7 +242,7 @@ public class QJavalinProcessHandler
|
||||
|
||||
UnsafeFunction<PipedOutputStream, GenerateReportAction, Exception> preAction = (PipedOutputStream pos) ->
|
||||
{
|
||||
reportInput.setReportOutputStream(pos);
|
||||
reportInput.getReportDestination().setReportOutputStream(pos);
|
||||
|
||||
GenerateReportAction reportAction = new GenerateReportAction();
|
||||
// any pre-action?? export uses this for "too many rows" checks...
|
||||
|
Reference in New Issue
Block a user