Interface I_CmsDataView
This provides everything the widget needs to query an external data source, display the query results (items) in tabular form, and provide the data to be stored when the user selects one or multiple items.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the list of columns to be displayed in the external data view widget.Gets the initial list of filters.getItemById
(String id) Retrieves the data item with the given id.int
Gets the page size, used for paging results.getResults
(CmsDataViewQuery query, int offset, int count) Gets the result for the given query, with the given offset and limited to the given number of results.void
initialize
(CmsObject cms, String configData, Locale locale) Initializes this data view instance.updateFilters
(List<CmsDataViewFilter> prevFilters) Returns an updated list of filters based on the current filters and their values.
-
Method Details
-
getColumns
Retrieves the list of columns to be displayed in the external data view widget.This method should always return the same columns.
- Returns:
- a list of column definitions
-
getFilters
Gets the initial list of filters.This is only used for the initial display of the data table; if the user changes the filters, the method updateFilters() is called instead.
- Returns:
- the initial list of filters
-
getItemById
Retrieves the data item with the given id.If no data item with that id exists, this method should return null.
- Parameters:
id
- the id for which to retrieve the item- Returns:
- the data item with the given the
-
getPageSize
int getPageSize()Gets the page size, used for paging results.- Returns:
- the page size
-
getResults
Gets the result for the given query, with the given offset and limited to the given number of results.The returned result includes a list of result items, and a total hit count for the given query (i.e. the number of results that would be returned for offset 0 and unlimited result count). The hit count should be as accurate as possible.
- Parameters:
query
- the queryoffset
- position of the first result to return (starts with 0)count
- maximum number of results to return- Returns:
- the result object
-
initialize
Initializes this data view instance.- Parameters:
cms
- the CMS context to use for VFS operationsconfigData
- a string containing configuration datalocale
- the locale to use for the user interface
-
updateFilters
Returns an updated list of filters based on the current filters and their values.This is called when the user changes any of the current filters in the data select widget. The list passed as a parameter should not be modified, instead a new filter list should be returned. If you do not need a dynamically changing set of filters, just return the argument 'prevFilters' in your implementation.
- Parameters:
prevFilters
- the current set of filters- Returns:
- the new list of filters
-