org.appng.api

## Interface DataProvider

-     public interface DataProvider

  An `DataProvider` usually retrieves some data from the persistence layer and returns it as a `DataContainer`. The implementing class needs to be defined in the application's `beans.xml`. This bean is then being referenced within an `Action` or a `SectionelementDef` using a `DatasourceRef`.

  Author:
    Matthias Müller

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataContainer` | `getData(Site site, Application application, Environment environment, Options options, Request request, FieldProcessor fieldProcessor)` Retrieves some data from the application, wrapped in a `DataContainer`.

- - ### Method Detail

    - #### getData

          DataContainer getData(Site site,
                                Application application,
                                Environment environment,
                                Options options,
                                Request request,
                                FieldProcessor fieldProcessor)

      Retrieves some data from the application, wrapped in a `DataContainer`.

      Either `DataContainer.setItem(Object)` or one of

      - `DataContainer.setItems(java.util.Collection)`
      - `DataContainer.setPage(java.util.Collection, org.springframework.data.domain.Pageable)`
      - `DataContainer.setPage(org.springframework.data.domain.Page)`
      must have been called on the returned `DataContainer`.

      Those item(s) need(s) to be of the type defined in `MetaData.getBindClass()` of the `Datasource`'s `DataConfig`.

      Parameters:
        `site` - the current `Site`
        `application` - the current `Application`
        `environment` - the current `Environment`
        `options` - the `Options` for this `DataProvider`
        `request` - the current `Request`
        `fieldProcessor` - the `FieldProcessor` containing all readable `FieldDef`initions for this DataProvider
      Returns:
        a `DataContainer` holding the `Data` for the defining `Datasource`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.