Package su.onno.ui
Class ListDataController
java.lang.Object
su.onno.ui.ListDataController
Serves pages of list data to the list grid. The default is keyset (seek) pagination: the
client passes an opaque
cursor (the nextCursor from the previous window) plus a
limit, and the server seeks straight to the next window with an indexed comparison — so
page 1 and page 10 000 cost the same, and rows are never skipped/duplicated when data shifts mid
scroll. The envelope is {rows, nextCursor, hasMore}; a COUNT runs only when the client
opts in via ?count=exact (or estimate for a cheap planner figure), since the
scroller needs hasMore, not a live total, to keep loading.
Sort, case-insensitive search, and column filters are applied server-side; the descriptor
(columns, labels, sort, actions) comes from the DivKit list surface.-
Constructor Summary
ConstructorsConstructorDescriptionListDataController(CatalogQueryService catalogQuery, DocumentQueryService documentQuery, UiAccessService access, UiActionResolver actionResolver, UiViewResolver viewResolver) -
Method Summary
Modifier and TypeMethodDescriptioncatalogAggregate(String name, WidgetBuckets.Request request, Principal principal) Pre-aggregated buckets for a chart/stat/sparkline/gauge widget (#199): a server-sideGROUP BY groupBy[, seriesBy]with an optional date-unit bucket and time window, returning O(buckets) rows instead of the entity's whole table.catalogGroups(String name, String groupBy, String granularity, String q, String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal) Group a catalog list by a column: one collapsible header per distinct value (or per date bucket), with a row count + requested subtotals, over the same sort/search/filters as the flat list.catalogPage(String name, int limit, String sort, String dir, String q, String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal) documentAggregate(String name, WidgetBuckets.Request request, Principal principal) The document analogue ofcatalogAggregate(java.lang.String, su.onno.ui.WidgetBuckets.Request, java.security.Principal).documentGroups(String name, String groupBy, String granularity, String q, String from, String to, String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal) Group a document list by a column — the document analogue ofcatalogGroups(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, jakarta.servlet.http.HttpServletRequest, java.security.Principal).documentPage(String name, int limit, String sort, String dir, String q, String from, String to, String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal)
-
Constructor Details
-
ListDataController
public ListDataController(CatalogQueryService catalogQuery, DocumentQueryService documentQuery, UiAccessService access, UiActionResolver actionResolver, UiViewResolver viewResolver)
-
-
Method Details
-
catalogPage
@GetMapping("/catalogs/{name}") public Map<String,Object> catalogPage(@PathVariable String name, @RequestParam(defaultValue="100") int limit, @RequestParam(required=false) String sort, @RequestParam(required=false) String dir, @RequestParam(required=false) String q, @RequestParam(required=false) String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal) -
documentPage
@GetMapping("/documents/{name}") public Map<String,Object> documentPage(@PathVariable String name, @RequestParam(defaultValue="100") int limit, @RequestParam(required=false) String sort, @RequestParam(required=false) String dir, @RequestParam(required=false) String q, @RequestParam(required=false) String from, @RequestParam(required=false) String to, @RequestParam(required=false) String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal) -
catalogGroups
@GetMapping("/catalogs/{name}/groups") public Map<String,Object> catalogGroups(@PathVariable String name, @RequestParam String groupBy, @RequestParam(required=false) String granularity, @RequestParam(required=false) String q, @RequestParam(required=false) String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal) Group a catalog list by a column: one collapsible header per distinct value (or per date bucket), with a row count + requested subtotals, over the same sort/search/filters as the flat list. The flat list (catalogPage(java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, jakarta.servlet.http.HttpServletRequest, java.security.Principal)) loads a group's rows via theexpandfilter each header carries. Envelope:{groups, capped}—cappedtrue when the group count hitListGroups.MAX_GROUPS. -
documentGroups
@GetMapping("/documents/{name}/groups") public Map<String,Object> documentGroups(@PathVariable String name, @RequestParam String groupBy, @RequestParam(required=false) String granularity, @RequestParam(required=false) String q, @RequestParam(required=false) String from, @RequestParam(required=false) String to, @RequestParam(required=false) String filter, jakarta.servlet.http.HttpServletRequest request, Principal principal) Group a document list by a column — the document analogue ofcatalogGroups(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, jakarta.servlet.http.HttpServletRequest, java.security.Principal). -
catalogAggregate
@GetMapping("/catalogs/{name}/aggregate") public Map<String,Object> catalogAggregate(@PathVariable String name, WidgetBuckets.Request request, Principal principal) Pre-aggregated buckets for a chart/stat/sparkline/gauge widget (#199): a server-sideGROUP BY groupBy[, seriesBy]with an optional date-unit bucket and time window, returning O(buckets) rows instead of the entity's whole table. BlankgroupByyields one grand-total bucket (the gauge case). SeeWidgetBucketsfor the envelope. -
documentAggregate
@GetMapping("/documents/{name}/aggregate") public Map<String,Object> documentAggregate(@PathVariable String name, WidgetBuckets.Request request, Principal principal) The document analogue ofcatalogAggregate(java.lang.String, su.onno.ui.WidgetBuckets.Request, java.security.Principal).
-