A query table registered via Queries.addTableDef. Wraps the name of a JavaScript function that supplies the table's rows, and the column headings declared for it, so it can be used as a data source for reports and admin table views.

Implements: Table


Properties

PropertyReturnsDescription
descriptionStringThe human readable name for this table, shown when choosing a data source.
headersList<String>The column headings declared for this table, in the order they were added.
tableIdStringThe unique identifier this table was registered under.

Inherited from Table

Methods

getRows(int start, Integer maxRows)

Returns: RowsResult

Reads a page of rows starting at the given row, discarding any progress status. Delegates to the three argument overload with a status callback that does nothing.

ParameterDescription
startthe zero based index of the first row to return
maxRowsthe maximum number of rows to return, or null for no limit

getRows(int start, Integer maxRows, Consumer<String> status)

Returns: RowsResult

Reads a page of rows starting at the given row, reporting progress through the supplied callback. This is the core method every table implementation provides; the other getRows overloads delegate to it.

ParameterDescription
startthe zero based index of the first row to return
maxRowsthe maximum number of rows to return, or null for no limit
statuscallback invoked with progress messages while the rows are being read

getRows(int start, Integer maxRows, Consumer<String> status, Map<String,Object> extraParams)

Returns: RowsResult

Reads a page of rows, optionally taking extra parameters that a specific table implementation can use to filter its results. The default implementation ignores extraParams and reads from row zero rather than the given start; implementations that use extraParams override this method directly.

ParameterDescription
startthe zero based index of the first row to return; not used by the default implementation
maxRowsthe maximum number of rows to return, or null for no limit
statuscallback invoked with progress messages while the rows are being read
extraParamsimplementation specific filter parameters; not used by the default implementation

Methods

getHeaders()

Returns: List<String>

The column headings declared for this table, in the order they were added.

getTableId()

Returns: String

The unique identifier this table was registered under.

getDescription()

Returns: String

The human readable name for this table, shown when choosing a data source.

addHeader(String text)

Returns: QueryTable

Declares one column heading for this table, in call order. Used immediately after addTableDef to describe the columns returned by the table's JavaScript function.

ParameterDescription
textthe column heading text

supportsPagination()

Returns: boolean

Whether this table's rows can be paged through, as declared with supportsPagination(boolean). True unless declared otherwise. This path is not handed start and maxRows as function arguments, so a table that pages reads them from the RowsResult it is given.

supportsPagination(boolean b)

Returns: QueryTable

Declares whether this table's rows can be paged through. Pass false for a table that aggregates, pivots, or must see every row to produce any: consumers then know not to offer a pager, and the table's admin page becomes export only.

ParameterDescription
btrue if this table supports paging, false if it always returns all rows
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.