SimpleReportingComponent implements IStreamingPojo, IAcceptsRuntimeInputs { protected int checkAndGetUserInputQueryLimit( final Object userInputQueryLimit, final int reportQueryLimit ) { int systemQueryLimit = 0; final IPluginManager pm = PentahoSystem.get( IPluginManager.class ); if ( pm != null ) { final boolean isQueryLimitControlEnabled = Boolean.parseBoolean( (String) pm.getPluginSetting( "reporting", "settings/query-limit-ui-enabled", "false" ) ); systemQueryLimit = isQueryLimitControlEnabled ? NumberUtils.toInt( (String) pm.getPluginSetting( "reporting", "settings/query-limit", "0" ), 0 ) : 0; } if ( reportQueryLimit > 0 ) { if ( reportQueryLimit > 0 && systemQueryLimit > 0 ) { return Math.min( reportQueryLimit, systemQueryLimit ); } else { return reportQueryLimit; } } else { final int userLimit = NumberUtils.toInt( (String) userInputQueryLimit, -1 ); if ( userLimit > 0 && systemQueryLimit > 0 ) { return Math.min( userLimit, systemQueryLimit ); } else if ( systemQueryLimit > 0 ) { return systemQueryLimit; } else { return userLimit; } } } SimpleReportingComponent(); String getDefaultOutputTarget(); void setDefaultOutputTarget( final String defaultOutputTarget ); void setForceDefaultOutputTarget( final boolean forceDefaultOutputTarget ); boolean isForceDefaultOutputTarget(); void setForceUnlockPreferredOutput( boolean forceUnlockPreferredOutput ); boolean isForceUnlockPreferredOutput(); String getOutputTarget(); void setOutputTarget( final String outputTarget ); void setOutputType( final String outputType ); String getOutputType(); IActionSequenceResource getReportDefinition(); void setReportDefinition( final IActionSequenceResource reportDefinition ); void setReportDefinitionInputStream( final InputStream reportDefinitionInputStream ); Serializable getReportFileId(); void setReportFileId( final Serializable fileId ); String getReportDefinitionPath(); void setReportDefinitionPath( String reportDefinitionPath ); boolean isPaginateOutput(); void setPaginateOutput( final boolean paginateOutput ); int getAcceptedPage(); void setAcceptedPage( final int acceptedPage ); void setSession( final IPentahoSession session ); boolean isDashboardMode(); void setDashboardMode( final boolean dashboardMode ); String getMimeType(); void setOutputStream( final OutputStream outputStream ); boolean isPrint(); void setPrint( final boolean print ); String getPrinter(); void setPrinter( final String printer ); Map<String, Object> getInputs(); void setInputs( final Map<String, Object> inputs ); void setReport( MasterReport report ); MasterReport getReport(); String getComputedOutputTarget(); void applyInputsToReportParameters( final MasterReport report, final ParameterContext context ); @Deprecated ValidationResult applyInputsToReportParameters( final ParameterContext context,
                                                         ValidationResult validationResult ); int getPageCount(); boolean outputSupportsPagination(); boolean validate(); boolean execute(); int paginate(); static final String OUTPUT_TARGET; static final String OUTPUT_TYPE; static final String MIME_TYPE_HTML; static final String MIME_TYPE_EMAIL; static final String MIME_TYPE_PDF; static final String MIME_TYPE_XLS; static final String MIME_TYPE_XLSX; static final String MIME_TYPE_RTF; static final String MIME_TYPE_CSV; static final String MIME_TYPE_TXT; static final String MIME_TYPE_XML; static final String MIME_TYPE_PNG; static final String XLS_WORKBOOK_PARAM; static final String REPORTLOAD_RESURL; static final String REPORT_DEFINITION_INPUT; static final String REPORTHTML_CONTENTHANDLER_PATTERN; static final String REPORTGENERATE_YIELDRATE; static final String ACCEPTED_PAGE; static final String PAGINATE_OUTPUT; static final String PRINT; static final String PRINTER_NAME; static final String DASHBOARD_MODE; static final String PNG_EXPORT_TYPE; }
@Test public void checkAndGetUserInputQueryLimitTest() { assertEquals( result, new SimpleReportingComponent().checkAndGetUserInputQueryLimit( String.valueOf( userLimit ), reportLimit ) ); }