Interface I_CmsDataView


  • public interface I_CmsDataView
    Interface for a data source for use by CmsDataViewWidget.

    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 Detail

      • getColumns

        java.util.List<CmsDataViewColumngetColumns()
        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

        java.util.List<CmsDataViewFiltergetFilters()
        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

        I_CmsDataViewItem getItemById​(java.lang.String id)
        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

        CmsDataViewResult 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.

        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 query
        offset - position of the first result to return (starts with 0)
        count - maximum number of results to return
        Returns:
        the result object
      • initialize

        void initialize​(CmsObject cms,
                        java.lang.String configData,
                        java.util.Locale locale)
        Initializes this data view instance.

        Parameters:
        cms - the CMS context to use for VFS operations
        configData - a string containing configuration data
        locale - the locale to use for the user interface
      • updateFilters

        java.util.List<CmsDataViewFilterupdateFilters​(java.util.List<CmsDataViewFilter> prevFilters)
        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