Skip to content

Commit

Permalink
Merge pull request #14 from Biruntha/master
Browse files Browse the repository at this point in the history
Update integration.txt file and Add connector documentation
  • Loading branch information
kesavany authored Dec 6, 2018
2 parents 47358e2 + 5d27dea commit 553e559
Show file tree
Hide file tree
Showing 8 changed files with 2,808 additions and 79 deletions.
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
### Google Spreadsheet ESB Connector
# Google Spreadsheet EI Connector

The Google Spreadsheet connector allows you to work with spreadsheets on Google Drive, a free, web-based service that
The Google Spreadsheet [connector](https://docs.wso2.com/display/EI640/Working+with+Connectors) allows you to work with spreadsheets on Google Drive, a free, web-based service that
allows users to create and edit spreadsheet documents online while collaborating in real-time with other users.
The connector uses the Google Spreadsheet API version 4.0 to connect to Google Drive and view, create, and update spreadsheets.
It allows you to access the [Google Spreadsheet API Version v4](https://developers.google.com/sheets/guides/concepts) through WSO2 Enterprise Integrator (WSO2 EI).

### Build

mvn clean install
## Compatibility

### How You Can Contribute
You can create a third party connector and publish in WSO2 Connector Store.
| Connector version | Google spreadsheet API version | Supported WSO2 EI version |
| ------------- | ------------- | ------------- |
| [3.0.0](https://github.com/wso2-extensions/esb-connector-googlespreadsheet/releases/tag/org.wso2.carbon.connector.googlespreadsheet-3.0.0) | v4 | ESB 4.9.0, ESB 5.0.0, EI 6.1.1, EI 6.2.0, EI 6.3.0, EI 6.4.0 |
| [2.0.1](https://github.com/wso2-extensions/esb-connector-googlespreadsheet/releases/tag/org.wso2.carbon.connector.googlespreadsheet-2.0.1) (Deprecated since google spreadsheet API v3 is deprecated) | v3 | ESB 5.0.0 ESB 4.9.0 |
| [2.0.0](https://github.com/wso2-extensions/esb-connector-googlespreadsheet/releases/tag/org.wso2.carbon.connector.googlespreadsheet-2.0.0) (Deprecated since google spreadsheet API v3 is deprecated) | v3 | ESB 4.9.0 |
| [1.0.0](https://github.com/wso2-extensions/esb-connector-googlespreadsheet/releases/tag/org.wso2.carbon.connector.googlespreadsheet-1.0.0) (Deprecated since google spreadsheet API v3 is deprecated) | v3 | ESB 4.9.0 |

https://docs.wso2.com/display/ESBCONNECTORS/Creating+a+Third+Party+Connector+and+Publishing+in+WSO2+Store
## Getting started

###### Download and install the connector

1. Download the connector from [WSO2 Store](https://store.wso2.com/store/assets/esbconnector/details/7181a316-bcac-4cbe-a617-a795abe4dcf3) by clicking the Download Connector button.
2. Then you can follow this [Documentation](https://docs.wso2.com/display/EI640/Working+with+Connectors+via+the+Management+Console) to add and enable the connector via the Management Console in your EI instance.
3. For more information on using connectors and their operations in your EI configurations, see [Using a Connector](https://docs.wso2.com/display/EI640/Using+a+Connector).
4. If you want to work with connectors via EI tooling, see [Working with Connectors via Tooling](https://docs.wso2.com/display/EI640/Working+with+Connectors+via+Tooling).

###### Configuring the connector operations

To get started with google spreadsheet connector and their operations, see [Configuring Google Spreadsheet Operations](docs/config.md).

## Building From the Source

If you want to build Google Spreadsheet connector from the source code:

1. Get a clone or download the source from [github](https://github.com/wso2-extensions/esb-connector-googlespreadsheet).
2. Run the following Maven command from the `esb-connector-googlespreadsheet` directory: `mvn clean install`.
3. The Google Spreadsheet connector zip file is created in the `esb-connector-googlespreadsheet/target` directory.

## How You Can Contribute

As an open source project, WSO2 extensions welcome contributions from the community.
Check the [issue tracker](https://github.com/wso2-extensions/esb-connector-googlespreadsheet/issues) for open issues that interest you. We look forward to receiving your contributions.
58 changes: 58 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Configuring Google Spreadsheet Operations

To use the Google Spreadsheet connector, add the `<googlespreadsheet.init>` element to your proxy configuration before using any other Google Spreadsheet connector
operations. The `<googlespreadsheet.init>` element authenticates the user using OAuth2 authentication and it allows users to access the Google account which contains the spreadsheets. For more information on authorizing requests in Google Spreadsheets, see [API Doc](https://developers.google.com/sheets/api/guides/authorizing).

<br/>

> Follow this [guide](https://docs.wso2.com/display/IntegrationCloud/Get+Credentials+for+Google+Spreadsheet) to set up the Google Spreadsheets and get credentials such as clientId, clientSecret, accessToken, refreshToken.
<br/>

**init**
```xml
<googlespreadsheet.init>
<accessToken>{$ctx:accessToken}</accessToken>
<clientId>{$ctx:clientId}</clientId>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<refreshToken>{$ctx:refreshToken}</refreshToken>
<apiUrl>{$ctx:apiUrl}</apiUrl>
</googlespreadsheet.init>
```

<br/>

To directly get the OAuth access token, call the **init** method (this method call getAccessTokenFromRefreshToken method itself ) or add `<googlespreadsheet.getAccessTokenFromRefreshToken>` element before `<googlespreadsheet.init>` element in your configuration.

<br/>

**getAccessTokenFromRefreshToken**
```xml
<googlespreadsheet.getAccessTokenFromRefreshToken>
<clientId>{$ctx:clientId}</clientId>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<refreshToken>{$ctx:refreshToken}</refreshToken>
</googlespreadsheet.getAccessTokenFromRefreshToken>
```

<br/>

>> **Note:** When trying it out for the first time, you need to use a valid accessToken to use the connector operations. If the accessToken has expired then the token refreshing flow will be handled inside the connector.
<br/>

**Properties**

* accessToken:Access token which is obtained through the OAuth2 playground.
* apiUrl: The application URL of Google Sheet version v4.
* clientId: Value of your client id, which can be obtained via Google developer console.
* clientSecret: Value of your client secret, which can be obtained via Google developer console.
* refreshToken: Refresh token which is obtained through the OAuth2 playground. It is used to refresh the accesstoken.

<br/>

Now that you have connected to Google Spreadsheet, use the information in the following topics to perform various operations with the google spreadsheet connector.

* To work with Spreadsheet operation, See [Working with Spreadsheet Operations](workWithSpreadsheet.md).
* To work with sheets in Spreadsheet, See [Working with Sheet Operations](workWithSheet.md).
* To work with data within the sheet, see [Working with Sheet Data Operations](workWithSheetData.md).
Loading

0 comments on commit 553e559

Please sign in to comment.