Thursday, September 22, 2016In TMS VCL Cloud Pack v3.7, new components TAdvmyCloudDataConnection and TAdvmyCloudDataDataSet have been added. With these 2 components, access to structured data on the cloud via the myCloudData service becomes easier than ever.
TAdvmyCloudDataConnection is a non-visual component that manages access to myCloudData. It works as the intermediator for the authentication and authorization to access myCloudData for one or multiple TAdvmyCloudDataDataSet instances. This means that via the TAdvmyCloudDataConnection at least a one-time authentication and authorization is done with myCloudData to obtain the access token and the TAdvmyCloudDataDataSet can then work through TAdvmyCloudDataConnection to use this access token. To let the TAdvmyCloudDataDataSet use the connection is as simple as assigning the TAdvmyCloudDataConnection instance to TAdvmyCloudDataDataSet.Connection, just like we are used to assign a TADOConnection to a TADOTable for example.
TAdvmyCloudDataDataSet is a wrapper as a dataset of a table in the myCloudData service. When a connection is provided, set either the name of the table via the Table property or the unique ID of the table via the TableID property. When a connection has been made (i.e. access token was obtained), setting the property TAdvmyCloudDataDataSet.Active to true will fetch the table data from the myCloudData table and present it as a TDataSet through a TDataSource to any DB-aware component in VCL or via LiveBindings in FireMonkey applications. Note that this approach works both at run-time and design-time, so we can work with the cloud data at design-time to configure our DB-aware controls connected to it.
An easy way is provided to perform basic dataset filtering. The TAdvmyCloudDataDataSet has a filter property which is presented as a collection of filter conditions. The filter condition consists of a field name, filter value, a filter condition logical operator and a filter comparison operator. The filter condition can be easily set at design-time where the dataset field can be picked and the values set.
From here we can work with the cloud data in much the same way from our code on the dataset as Delphi developers have been doing all the time with datasets, i.e. insert, delete, update records.
But with the updated myCloudData service, there is much more than this possible as myCloudData now offers rich metadata for its structured data. This rich metadata can be programmatically accessed, created and updated but also easily configured via the myCloudData web interface. We'll cover this in a follow-up blog focused on how we can benefit from this rich metadata, but here you can already glance over the web interface you can access from your myCloudData account:
You can explore all this with a free myCloudData account. Create a new table via this account and you can use our TAdvmyCloudDataDataSetDemo application included in TMS VCL Cloud Pack to explore this.
Stay tuned for more!
This blog post has received 2 comments.
Previous | Next | Index