Google Spreadsheet Data Sources

The Google JCA connector is named teiid-connector-google.rar. The examples include a sample google.xml file. The JCA connector has number of config-properties to drive authentication.  The JCA connector connects to exactly one spreadsheet with each sheet exposed as a table.

Authentication to your google account may be done using OAuth, which requires a refresh token (outlined below).

Config property Description

AuthMethod

Method to access Google. This property can only be OAuth2.

RefreshToken

Use guide below to retrieve RefreshToken. Request access to Google Drive and Spreadsheet API.

SpreadsheetName

Required property with name of the Spreadsheet that is datasource for this connector. By default it is assumed to be a title.

Key

Optional boolean property to designate the spreadsheet name is a key rather than a title.

BatchSize

Maximum number of rows that can be fetched at a time. Defaults to 4096.

Getting an OAuth Refresh Token

Use this request:

Then copy the authorization code into following POST request and run it in command line:

curl \--data-urlencode code=<AUTH_CODE> \
--data-urlencode client_id=217138521084.apps.googleusercontent.com \
--data-urlencode client_secret=gXQ6-lOkEjE1lVcz7giB4Poy \
--data-urlencode redirect_uri=urn:ietf:wg:oauth:2.0:oob \
--data-urlencode grant_type=authorization_code https://accounts.google.com/o/oauth2/token

The refresh token will be in the response

Implementation Details

Google Translator is implemented using GData API [1] (java library for [4]) and Google Visualization Protocol [2]. Authentication is implemented using OAuth2 for devices [3]. 1. https://developers.google.com/google-apps/spreadsheets/ 2. https://developers.google.com/chart/interactive/docs/querylanguage 3. https://developers.google.com/accounts/docs/OAuth2ForDevices 4. https://developers.google.com/google-apps/spreadsheets

results matching ""

    No results matching ""