Ready to get started?

Learn more about the CData FireDAC Components for Magento or download a free trial:

Download Now

Viewing Magento Data in RAD Studio Data Explorer

How to view Magento data in RAD Studio Data Explorer using the CData FireDAC Components for Magento.

Embarcadero RAD Studio provides a development environment for Delphi and C++Builder applications. With the CData FireDAC Components for Magento, you gain access to live Magento data within RAD Studio, abstracting the data into tables, views, and stored procedures that can be used to both retrieve and update Magento data. This article will walk through connecting to Magento using the Data Explorer.

Connecting to Magento Data Using Data Explorer

You can create a simple application for displaying Magento data by utilizing the CData FireDAC Components for Magento and a new VCL Forms Application:

  1. Open the Data Explorer in RAD Studio and expand FireDAC.
  2. Right-click on CData Magento Data Source and click Add New Connection.

  3. Name the connection.
  4. Fill in the necessary connection parameters and click OK.

    Magento uses the OAuth 1 authentication standard. To connect to the Magento REST API, you will need to obtain values for the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties by registering an app with your Magento system. See the "Getting Started" section in the help documentation for a guide to obtaining the OAuth values and connecting.

    You will also need to provide the URL to your Magento system. The URL depends on whether you are using the Magento REST API as a customer or administrator.

    • Customer: To use Magento as a customer, make sure you have created a customer account in the Magento homepage. To do so, click Account -> Register. You can then set the URL connection property to the endpoint of your Magento system.

    • Administrator: To access Magento as an administrator, set CustomAdminPath instead. This value can be obtained in the Advanced settings in the Admin menu, which can be accessed by selecting System -> Configuration -> Advanced -> Admin -> Admin Base URL.

      If the Use Custom Admin Path setting on this page is set to YES, the value is inside the Custom Admin Path text box; otherwise, set the CustomAdminPath connection property to the default value, which is "admin".

  5. Back in the Data Explorer, expand the tables for the connection.
  6. Create a new VCL Forms application and drag a table (for example: Products) onto the form.

  7. Select the ProductsTable object on the form and set the Active property to true.
  8. Right-click on the object, bind visually, and link everything (*) to a new control (TStringGrid).

  9. Arrange the TStringGrid on the form and run the application to see the Products data.