TMS VCL Cloud Pack DEVELOPERS GUIDE

Please download to get full document.

View again

of 165
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Essays

Published:

Views: 140 | Pages: 165

Extension: PDF | Download: 3

Share
Related documents
Description
December 2016 Copyright by tmssoftware.com bvba Web: 1 Index Getting started with cloud storage access File organisation File
Transcript
December 2016 Copyright by tmssoftware.com bvba Web: 1 Index Getting started with cloud storage access File organisation File operations Public shared files CloudStorage specific settings TCloudTreeViewAdapter / TCloudAdvTreeViewAdapter TAdvTwitter TAdvFacebook TAdvFlickr TAdvFourSquare TAdvGCalendar TAdvGContacts TAdvPayPal TAdvPicasa TAdvYouTube TAdvInstagram TAdvLinkedIn TAdvLiveCalendar TAdvLiveContacts TAdvOutlookCalendar TAdvOutlookContacts TAdvOutlookMail TAdvURLShortener TAdvWeather TAdvCloudLookupEdit TAdvWeatherLocationLookupProvider TAdvGoogleLookupProvider TAdvGoogleLocationLookupProvider TAdvCloudImage TAdvCloudExifImage TAdvPushOver TAdvTwilio TAdvEsendex TAdvBulkSMS TAdvTelAPI TAdvIPLocation TCloudDataSet TAdvmyCloudData TAdvmyCloudDataConnection TAdvmyCloudDataDataSet TAdvCardDAV TAdvCalDAV TAdvCardDAVFilter TAdvCalDAVFilter TiCloudContacts TiCloudCalendar TAdvWebDAVStorage TAdvWebDAVSync TAdvWebDAVDataSet TAdvWebDAVCollectionFieldDataSet TAdvDropBoxDataStore TAdvPryv TAdvTrello TAdvGSheets TAdvGMail TAdvMSComputerVision TAdvMSEmotion TAdvMSBingSpeech TAdvCustomImgur TAdvCustomCloudinary Authentication persistence Availability is a set of VCL components for Win32 & Win64 application development and is available for Embarcadero Delphi & C++Builder XE, XE2, XE3, XE4, XE5, XE6, XE7, XE8, 10 Seattle & 10.1 Berlin. Online references TMS software website: page: Purchase a license The is available separately and also as part of the TMS VCL Subscription: - : - TMS VCL Subscription: There is also a version of for FireMonkey, IntraWeb and Visual Studio.NET & ASP.NET: - for FireMonkey: - TMS IntraWeb Cloud Pack: - for.net: 4 Terms of use With the purchase of, you are entitled to our consulting and support services to integrate the Amazon Cloud Drive, Apple icloud, Google GDrive, Microsoft SkyDrive, DropBox, Box, Flickr, Google Calendar, Google Contacts, Google Picasa, Google Mail, Google Sheets, Google Analytics, Microsoft Live Calendar, Microsoft Live Contacts, Wunderground weather, Google Location Lookup, Google Search Lookup, Google DataStore, Facebook, Twitter, LinkedIn, PushOver, Instagram, FourSquare, Twilio, Esendex, BulkSMS, FreeGEOIp, Esendex, YouTube, Pryv, CloudConvert, Barcodes4me, PayPal, Hubic, HiDrive, myclouddata, Exceptionless, Outlook, Microsoft Cognitive, Imgur, Cloudinary service in Delphi applications and with this consulting and support comes the full source code needed to do this integration. As uses the Amazon Cloud Drive, Apple icloud, Google GDrive, Microsoft OneDrive, DropBox, Box, Flickr, Google Calendar, Google Contacts, Google Picasa, Google DataStore, Microsoft Live Calendar, Microsoft Live Contacts, Wunderground weather, Google Location Lookup, Google Search Lookup, Facebook, Twitter, LinkedIn, PushOver, Instagram, FourSquare, Twilio, Esendex, BulkSMS, FreeGEOIp, Esendex, YouTube, Pryv, CloudConvert, PayPal, Hubic, HiDrive, Trello, myclouddata, Exceptionless, Outlook Calendar, Outlook Contacts, Outlook Mail, Microsoft Cognitive, Imgur, Cloudinary service, you're bound to the terms of these services that can be found at: https://www.dropbox.com/terms https://m.box.com/static/html/terms.html https://pushover.net/terms https://foursquare.com/legal/terms https://www.twilio.com/legal/tos https://www.youtube.com/static?template=terms https://cloudconvert.com/terms https://www.paypal.com/webapps/mpp/ua/legalhub-full?country.x=us&locale.x=en_us https://hubic.com/en/contracts/contrat_hubic_2014.pdf https://dev.strato.com/hidrive/terms-of-service https://trello.com/legal https://exceptionless.com/terms/ 5 https://msdn.microsoft.com/en-us/cc https://imgur.com/tos includes components for accessing WebDAV, CalDAV, CardDAV servers as well as the icloud contacts & icloud calendar. You re bound to the terms of each of these specific servers and/or services. TMS software is not responsible for the use of components. The purchase of does not include any license fee that you might possibly be required to pay to Amazon, Apple, Google, Microsoft, DropBox, Box, Flickr, Wunderground, Facebook, Twitter, LinkedIn, PushOver, Instagram, FourSquare, Twilio, Esendex, BulkSMS, TelAPI, YouTube, Pryv, CloudConvert, Barcodes4me, PayPal, Hubic, HiDrive, Trello, myclouddata, Exceptionless, Outlook Calendar, Outlook Contacts, Outlook Mail, Microsoft Cognitive, Imgur, Cloudinary. It will depend on your type of usage of these services whether a license fee needs to be paid. It is the sole responsibility of the user or company providing the application that integrates the Amazon, Apple, Google, Microsoft, DropBox, Box, Flickr, Facebook, Twitter, Wunderground, LinkedIn, PushOver, Instagram, FourSquare, Twilio, Esendex, BulkSMS, TelAPI, YouTube, Pryv, CloudConvert, Barcodes4me, PayPal, Hubic service to respect the Google, Microsoft, DropBox, Facebook, Twitter, Wunderground, LinkedIn, PushOver, Instagram, Twilio, Esendex, BulkSMS, TelApi, YouTube, Pryv, CloudConvert, myclouddata, Exceptionless, Outlook Calendar, Outlook Contacts, Outlook Mail, Microsoft Cognitive, Imgur, Cloudinary terms and conditions. TMS software does not take any responsibility nor indemnifies any party violating the Google, Microsoft, DropBox, Box, Flickr, Facebook, Twitter, Wunderground, LinkedIn, PushOver, Instagram, FourSquare, Twilio, Esendex, BulkSMS, TelAPI, YouTube, Pryv, CloudConvert, Barcodes4me, PayPal, Hubic, HiDrive, Trello, myclouddata, Exceptionless, Outlook Calendar, Outlook Contacts, Outlook Mail, Microsoft Cognitive, Imgur, Cloudinary service terms & conditions. We cannot guarantee that a 3 rd party cloud service will approve or allow the use of the services used in components in your application(s) now or at any time in the future. This is up to the 3 rd party cloud service provider to decide and not under our control. In case the 3 rd party cloud service provider makes changes to the conditions for using the service, the API itself or anything else that causes an incompatibility with our component implementations, tmssoftware.com will do its best to accommodate the changes but cannot be forced in any way or within any timeframe to do so and might be technically limited to do so. 6 Limited warranty TMS software cannot guarantee the current or future operation & uptime of the Amazon, Google Drive, Microsoft OneDrive, Microsoft Live Calendar, Microsoft Live Contacts, DropBox, Box, Flickr, Facebook, Twitter, Wunderground, Google Contacts, Google Calendar, Google Picasa, LinkedIn, PushOver, Instagram, Twilio, Esendex, BulkSMS, TelAPI, FreeGEOIP, YouTube, Pryv, CloudConvert, Barcodes4me, PayPal, Hubic, HiDrive, Trello, myclouddata, Exceptionless, Outlook Calendar, Outlook Contacts, Outlook Mail, Microsoft Cognitive, Imgur, Cloudinary services. TMS software offers the consulting and support for in good faith that the Amazon, Apple, Google Drive, Google DataStore, Microsoft OneDrive, Microsoft Live Calendar, Microsoft Live Contacts, DropBox, Box, Flickr, Facebook, Twitter, Wunderground, Google Contacts, Google Calendar, Google Picasa, Google Mail, Google Sheets, Google Analytics, LinkedIn, PushOver, Instagram, Twilio, Esendex, BulkSMS, TelAPI, FreeGEOIP, YouTube, Pryv, CloudConvert, Barcodes4me, PayPal, Hubic, HiDrive, Trello, myclouddata, Exceptionless, Outlook Calendar, Outlook Contacts, Outlook Mail, Microsoft Cognitive, Imgur, Cloudinary service is a reliable and future-proof service. In no case, TMS software shall offer refunds or any other compensation in case the Amazon, Apple, Google Drive, Microsoft OneDrive, Microsoft Live Calendar, Microsoft Live Contacts, DropBox, Box, Flickr, Facebook, Twitter, Wunderground, Google Contacts, Google Calendar, Google Picasa, LinkedIn, PushOver, Instagram, Twilio, Esendex, BulkSMS, TelAPI, FreeGEOIP, YouTube, Pryv, CloudConvert, Barcodes4me, PayPal, Hubic, HiDrive, Trello, myclouddata, Exceptionless, Outlook Calendar, Outlook Contacts, Outlook Mail, Microsoft Cognitive, Imgur, Cloudinary service terms/operation changes or stops. 7 Main features Set of VCL components to offer easy access from Windows applications to cloud services Component to get access to Amazon cloud drive Component to get access to Apple CloudKit Component to get access to DropBox storage Component to get access to Box storage Component to get access to HiDrive storage Component to get access to Hubic storage Component to get access to CloudConvert API Component to get access to Google Drive storage Component to get access to Microsoft SkyDrive storage Component to get access to Facebook API Component to get access to Twitter API Component to get access to Google Contacts API Component to get access to Google Calendar API Component to get access to Google Picasa API Component to get access to Google Places API Component to get access to Google Tasks API Component to get access to Google DataStore API Component to get access to Google Mail API Component to get access to Google Sheets API Component to get access to Google Analytics API Component to get access to Flickr API Component to get access to Windows Live Contacts API Component to get access to Windows Live Calendar API Component to get access to Wunderground weather forecast service Component to get access to LinkedIn API Component to get access to Instagram API Component to get access to FourSquare API Component to get access to YouTube API Component to get access to DropBox DataStore API Component to get access to Pryv API Component to get access to Barcodes4me API Component to get access to PayPal API Component to get access to Trello API Component to get access to MyCloudData API Component to get access to Exceptionless API Component to get access to Outlook Calendar API Component to get access to Outlook Contacts API Component to get access to Outlook Mail API Component to get access to Microsoft Computer Vision API Component to get access to Microsoft Emotion API Component to get access to Microsoft Bing Speech API Component to get access to Imgur API Component to get access to Cloudinar API Component to display images (JPG, PNG, GIF, BMP) from an URL Component to shorten URLs based on Google URL shortener service Component to send push messages to ios devices running the PushOver client Components to access WebDAV, CalDAV, CardDAV servers 8 Components to access icloud Contacts and icloud Calendar Component to send SMS messages via the Twilio service Component to send SMS messages via the Esendex service Component to send SMS messages via the TelAPI service Component to send SMS messages via the BulkSMS service Component to determine machine location via the FreeGEOIP service WebDAV, CalDAV, CardDAV local storage, synchronization & filtering components Edit control with lookup capabilities based on web services lookup data Built-in support for OAuth 1.0 & 2.0 handling Built-in support for use of refresh tokens for use with one time authentication 9 Registering your application A first step will be to register your application so you can obtain an application key and secret at the different cloud services. Please refer to our online documentation. 10 Getting started with cloud storage access Once your application is registered and you have an application ID or client ID and application secret or client secret, you can get started to use the TAdvSkyDrive/TAdvOneDrive, TAdvDropBox, TAmazonCloudDrive, TAdvBoxNetDrive, TAdvGDrive, TAdvHubic and TAdvHiDrive components to access your cloud storage. All storage components work in a similar way: 1) Drop the component on the form. 2) Setup the client ID, client secret via the.app.key and.app.secret property. 3) Call the.doauth method. Code: AdvGDrive1.App.Key := 'xxxxxxxxx.apps.googleusercontent.com'; AdvGDrive1.App.Secret := 'yyyyyyyyyyyyyyyy'; AdvGDrive1.DoAuth; 11 And this will show the Google login screen: The size of the login screen and the caption are controlled by the properties: AuthFormSettings.Caption: string; AuthFormSettings.Height: integer; AuthFormSettings.Width: integer; When the login screen has been closed without a successful authentication, the event OnAuthFormClose will be triggered. Alternatively, it is also possible to use any other TWebBrowser instance as login screen. To do this, just assign this TWebBrowser instance to TAdvXXXDrive.AuthBrowser: TWebBrowser. When the user has provided the correct credentials, the event OnReceivedAccessToken will be triggered and from that moment, the component has access to the online cloud APIs. File organisation The file structure of a cloud storage service typically has a hierarchical organization in folders and files. This is represented in the cloud access component as a collection of the type TCloudItems. The common structure of this collection is: TCloudItems = class(tcollection) in this collection are items of the type: 12 TCloudItem = class(tcollectionitem) Properties: property FileName: string; Holds the filename of a file or folder property Folder: TCloudItems; When the ItemType is itfolder, this contains in turn a collection of files and folders property Size: int64; Holds the size of the item property ItemType: TCloudItemType; Defines whether the item is a file or folder (cifile, cifolder) property CreationDate: TDateTime; Holds the creation date of the file or folder property ModifiedDate: TDateTime; Holds the timestamp when the file was last modified property Tag: integer; Integer property that can be freely used. These are the common file/folder properties. Note that for different cloud storage services, there might be different extra properties available. Methods: GetDriveInfo; Use the cloud storage API to query the list of all files and folders, then store this hierarchically in the Drive: TCloudItems collection property. FillTreeView(TreeView: TTreeView); A helper method to immediately visualize the file structure retrieved by GetDriveInfo in a Treeview control. GetFolderList(Folder: TCloudItem): TCloudItems; Get the list of all files and folders of the Folder without recursion into subfolders. Returns the collection of TCloudItems. If no Folder is specified the root folder is retrieved. For TAdvGDrive, TAdvAmazonCloudDrive, TAdvOneDrive, TAdvBoxNetDrive only the Folder.ID property is required. For TAdvDropBox, TAdvHiDrive only the Folder.Path property is required. (This method is not supported for TAdvHubic due to API limitations) GetFolderListHierarchical(Folder: TCloudItem; IsRootFolder: boolean): TCloudItems; See GetFolderList for usage information. This method will add the retrieved list of files and folders to the Drive collection hierarchically. It is required that the specified Folder is already part of the 13 Drive collection unless the optional parameter IsRootFolder is set to True. If IsRootFolder is True, the Folder will appear as the root folder in the Drive collection. (This method is not supported for TAdvHubic due to API limitations) A helper component TCloudTreeviewAdapter is available to automatically and progressively visualize the file structure in a Treeview control. SearchList(Query: string; ExactMatch: Boolean; Folder: TCloudItem): TCloudItems; Only supported in TAdvDropBox, TAdvGDrive, TAdvOneDrive and TAdvBoxNetDrive. Performs a search for the Query value in the File and Folder names available on the cloud storage. A list of TCloudItems with the results of the search action is returned. ExactMatch is only supported in TAdvGDrive. Specify a Folder to limit the search to a specific folder (Only supported in TAdvDropBox, TAdvGDrive). File operations Following operations are available: Create a folder Delete a file or folder Download a file Upload a file Creating a folder Creating a folder is simple. You can either create a folder in the root by calling: TAdvXXXDrive.CreateFolder(nil, New folder ): TCloudItem; or create a subfolder in a specific folder. To do this, you need the instance of the TCloudItem representing the folder and use it as first parameter of the CreateFolder() call. TAdvXXXDrive.CreateFolder(ParentFolderItem, New folder ): TCloudItem; This function returns a new TCloudItem instance representing the created folder. Delete a file or folder Deleting a file can be done by calling the function TAdvXXXDrive.Delete(CloudItem): Boolean. This function returns true on a successful delete. The parameter is the TCloudItem instance that represents the file or folder to be deleted Download a file 14 Downloading a file is equally simple. Call the function TAdvXXXDrive.Download(CloudItem, TargetFileName): Boolean. For a successful download, this function returns true. Note that the progress of the download can be tracked via the event OnDownloadProgress. Upload a file Uploading a file means creating the file on the cloud storage and uploading its data. The function that is used for upload is: TAdvXXXDrive.Upload(Folder: TCloudItem; FileName:string): TCloudItem. The file is uploaded in the root (when Folder parameter is nil) or in the folder as specified by the Folder TCloudItem. The local file that will be uploaded is set via the FileName parameter. When successful, this function returns an instance of the new created file. Note that this item will also automatically be added in the TAdvXXXDrive.Drive collection. The progress during the upload can also be tracked via the OnUploadProgress event. Public shared files TAdvDropBox, TAdvSkyDrive/TAdvOneDrive, TAdvBoxNetDrive, TAdvGDrive, TAdvHubic and TAdvHiDrive have a built-in function to create a public share URL for a file on the cloud storage. To create & get the share URL, you can use either: property TCloudItem.Share: string Property returning a public accessible HTTP URL to download the file. or function TCloudStorage.GetShare(CloudItem): string With the property property TCloudItem.Shared: Boolean it can be retrieved whether the file is shared or not. Notes: 15 - TADVGDrive: For TAdvGDrive, the permissions are organized in a slightly different way: TGDriveItem.PublicShare := true; Set this item as public accessible. TGDriveItem.PublicShare := false; Remove the public accessible permission for this item. The property TGDriveItem.Shared: boolean will return true when the file can be shared with other users. The property TGDriveItem.DownloadURL: string can return the HTTP URL for such shared file. The property TGDriveItem.AlternateURL: string can return a link for opening the file using a relevant Google editor or viewer. The property TGDriveItem.WebContentURL: string can return a link for downloading the content of the file. In cases where the content is shared publicly, the content can be downloaded without credentials. - TAdvHiDrive: For TAdvHiDrive, shared URLs can expire after the shared file has been downloaded a specific number of times or after a specific amount of time. The number of times a shared file can be downloaded or the amount of time before the shared link expires depends on the HiDrive account type of the authenticated user. To re-enable an expired share, first delete the existing share and then create a new share for the same THiDriveItem. function THiDriveItem.DeleteShare: Boolean or function TAdvHiDrive.DeleteShare(ShareURL: string): Boolean Function to delete an existing share. The share will be deleted if it is expired or not. CloudStorage specific settings TAdvDropBox 16 TAdvDropBox has a few extra settings to take control of specific behavior of the DropBox service. The public property ExternalBrowser: boolean is added. When setting this to true, the authentication/authorization step can be done via the default browser. Secondly, a property TAdvDropBox.FileLimit: integer is added. This controls how many files the DropBox API can return for a folder file listing. The default value is If you have more than files in a DropBox folder, this can be increased to a maximum value of The maximum value of is a limitation of the DropBox API itself. Note: The TAdvDropBox component now supports the DropBox API v2. In v2 the FileLimit
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks