Need a special offer?Find out if your project fits.
+
All documentation
  • Introduction
  • Connecting to Data Source
    1. Supported data sources
    2. Connecting to other data sources
  • Browser compatibility
  • Documentation for older versions
  • 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.

    The GetFields() method

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

    • Schema GetFields(string index)
      Parameters: index is the same parameter as in the /fields request
    • Schema GetFields(FieldsRequest request)
      Parameters: request has the FieldsRequest type. FieldsRequest is a class from the DLL that describes the structure of the /fields request.

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

    The GetMembers() method

    The GetMembers() method returns a list of all field members. Use this method to create 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 class from the DLL that describes the structure of the /members request. serverFilter is an optional parameter containing the server filters.
    • MembersResponse GetMembers(MembersRequest membersRequest, ServerFilter serverFilter)
      Parameters: membersRequest has the MembersRequest type. MembersRequest is a class from the DLL that describes the structure of the /members request. serverFilter contains the server filters.

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

    The GetAggregatedData() method

    The GetAggregatedData() method returns the aggregated data. Use this method to create the response to the /select request for the pivot table, the flat table, or the drill-through view. 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 requests for the pivot table, the flat table, and the drill-through view. serverFilter is an optional parameter containing the server filters.
    • SelectResponse GetAggregatedData(SelectRequest selectRequest, [IEnumerable<ServerFilter> serverFilter])
      Parameters: selectRequest has the SelectRequest type. SelectRequest is a class from the DLL that describes the structure of the /select requests for the pivot table, the flat table, and the drill-through view. serverFilter is an optional parameter containing the server filters.
    • SelectResponse GetAggregatedData(SelectRequest selectRequest, ServerFilter serverFilter)
      Parameters: selectRequest has the SelectRequest type. SelectRequest is a class from the DLL that describes the structure of the /select requests for the pivot table, the flat table, and the drill-through view. serverFilter contains the server filter.

    SelectResponse is a class from the DLL that describes the structure of the responses to the /select requests for the pivot table, the flat table, and the drill-through view.

    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: