Need a special offer?Find out if your project fits.
+
  1. API reference
Connecting to Data Source
  1. Supported data sources
  2. Connecting to other data sources
Configuring the component
  • Documentation for older versions
  • Table of contents

    The controller's methods for request handling

    The API controller’s task is to accept and handle the custom data source API requests from Flexmonster Pivot. To simplify the request handling, Flexmonster.DataServer.Core.dll provides a set of ready-to-use methods that allow getting fields, members, and aggregated data. These methods belong to the DLL's IApiService class.

    This guide contains the following sections:

    The GetFields() method

    The GetFields() method returns a list of all fields with their types (see the response to the /fields request). This method has two signatures:

    • Schema GetFields(string index)
      Parameters: GetFields with this signature has the same parameter as the /fields request
    • Schema GetFields(FieldsRequest request)
      Parameters: the request parameter has the FieldsRequest type. FieldsRequest is a predefined class from the DLL that describes the /fields request’s structure.

    Schema is a class that describes the structure of the response to the /fields request.

    The GetMembers() method

    The GetMembers() method returns a list of all field members (see the response to the /members request). This method has the following signatures:

    • MembersResponse GetMembers(string index, Field field, int page, LogicFilter filter, [IEnumerable<ServerFilter> serverFilter])
      Parameters: index, field, filter, and page are the same parameters as in the /members request. serverFilter is an optional parameter containing the server filters.
    • MembersResponse GetMembers(MembersRequest membersRequest, [IEnumerable<ServerFilter> serverFilter])
      Parameters: membersRequest has the MembersRequest type. MembersRequest is a predefined class from the DLL that describes the /members request’s structure. serverFilter is an optional parameter containing the server filters.
    • MembersResponse GetMembers(MembersRequest membersRequest, ServerFilter serverFilter)
      Parameters: membersRequest has the MembersRequest type. MembersRequest is a predefined class from the DLL that describes the /members request’s structure. serverFilter contains the server filters.

    MembersResponse is a class that describes the structure of the response to the /members request

    The GetAggregatedData() method

    The GetAggregatedData() method returns the aggregated data (see the response to the /select request). This method has the following signatures:

    • SelectResponse GetAggregatedData(string index, Query query, int page, [IEnumerable<ServerFilter> serverFilter])
      Parameters: index, query, and page are the same parameters as in the /select request. serverFilter is an optional parameter containing the server filters.
    • SelectResponse GetAggregatedData(SelectRequest selectRequest, [IEnumerable<ServerFilter> serverFilter])
      Parameters: selectRequest has the type SelectRequest. SelectRequest is a predefined class from the DLL that describes the /select request's structure. serverFilter is an optional parameter containing the server filters.
    • SelectResponse GetAggregatedData(SelectRequest selectRequest, ServerFilter serverFilter)
      Parameters: selectRequest has the type SelectRequest. SelectRequest is a predefined class from the DLL that describes the /select request's structure. serverFilter contains the server filter.

    SelectResponse is a class that describes the structure of the response to the /select request.

    Note The DLL’s methods and classes can be overridden and adjusted to your needs.

    What's next?

    You may be interested in the following articles: