Bi-Directional Integration: This adapter supports both inbound and outbound data transfer between SAP and Google Drive, allowing you to push data from SAP to Google Drive and pull data from Google Drive into SAP.
Secure Authentication: The adapter provides secure authentication mechanisms to ensure that your data remains protected during the integration process.
Customizable Configuration: You can easily configure the adapter to suit your specific integration needs, including specifying folders and document types within Google Drive.
Real-time and Batch Processing: The adapter supports real-time and batch processing, giving you flexibility in how you exchange data between SAP and Google Drive.
Sender and Receiver Adapter: This adapter support both Sender and Receiver type configuration.
Scheduler Support: Sender adapter can be configured to run as per the schedule.
Externalized Parameters: All the parameters of the adapter can be externalized.
Simple Camel Expression Support: Simple Camel expressions are supported as input variables.
Archive and Delete Support: Archiving with or without added timestamp supported.
Huge File Upload Support: A resumable upload method is used to upload huge data in chunks.
In order to access Google Drive API v3, you need to create OAuth 2.0 credentials, which include a client ID and secret. Follow these steps to obtain your credentials:
https://client.com/callback
and https://<cf-domain>.integrationsuite.cfapps.jp10.hana.ondemand.com/itspaces/odata/api/v1/OAuthTokenF...
).https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force
and https://oauth2.googleapis.com/token
respectively.https://www.googleapis.com/auth/drive
in the Scope input box.<response>Authorization was successful: Refresh Token was added to the OAuth2 Authorization Code Credential 'GoogleAPI'.</response>
Now you have successfully created OAuth 2.0 credentials (client ID and secret) for the Google Drive. You can use this security material in your iFlow to authenticate and access Google Drive resources.
Make sure to handle your credentials securely and never expose them in publicly accessible code or repositories.
In this guide, we will explore two methods for deploying a Custom Google Drive Adapter in SAP Integration Suite:
Note: This method may take long time to upload.
asutosh.drive.esa
file from the build path.asutosh.drive.esa
file for the adapter.Process Integration Runtime
and Plan api
. If not found, quickly navigate to Service Marketplace
and search for Process Integration Runtime
service.api
.AuthGroup_IntegrationDeveloper
and WorkspacePackagesEdit
roles. Then click on the "Create" button.Service Key Name
.import
button. Drag and drop the JSON specification and click on the import
button to create the collection.Integration Content
collection.Authorization
tab. Select OAuth 2.0
as the Type
and Client Credentials
as the Grant Type
.Access Token URL
, Client ID
, and Client Secret
as per the Service Key JSON file created in Step 1.Variables
tab and give your Cloud Integration API URL (e.g., https://<cf name>.it-<cf id>.cfapps.jp10.hana.ondemand.com/api/v1
. You can get the same URL from the Service Key JSON url
field + /api/v1
).Integration Content/IntegrationPackages/Get all integration packages.
request and Add the header x-csrf-token
with the value fetch
. Click on the Send
button and copy the x-csrf-token
header value and package Id
from the response.git clone https://github.com/Asutosh-Integration/asutosh.drive.git
command (if you have git
installed) or else you can directly Download ZIP from GitHub.src/main/java/asutosh/google/FileToBase64AndSaveToFile.java
file.target/build/asutosh.drive-Base64.txt
path and copy the file content (Base64 encoded string of asutosh.drive.esa
file).Integration Content/IntegrationAdapterDesigntimeArtifacts/Import integration adapter artifact
request.Base64Content
and packageID
with the copied file content and Integration package ID).{
"PackageId": "packageID",
"ArtifactContent": "Base64Content"
}
X-CSRF-Token
with the value received in the previous request.Congratulations! You have successfully deployed a Custom Google Drive Adapter in SAP Integration Suite using either of the above two different methods. Please refer the Documentation for step-by-step guide on adapter configuration in the iFlow.
Note: For more detailed instructions and troubleshooting tips, refer to SAP Integration Suite documentation or consult your SAP support resources.
Before proceeding, ensure you have the following prerequisites in place:
Once you have created a sender channel and selected the Google Drive sender adapter, you can configure the following attributes.
General
Parameter | Description |
---|---|
Name | Enter the name of the Google Drive channel. |
Settings
Parameter | Description |
---|---|
Choose Operation | Only Download operation is supported in Sender Channel. |
File Path | Name of the file to Download. Use of Simple Camel expression is also supported. ⚠️Caution: Multiple filenames are not supported. Please always mention absolute path from the root ( / ).While using both Simple Expression and constant, Please always mention extension of the file separated by . .ℹ️Note: Example of supported file paths are below. /<rootFolder>/<subFolder>/<filename>.<ext> , /<filename>.<ext> , ${header.filepathwithext} , /<rootFolder>/${property.filenamewithext} Example of file paths not supported are below. <rootFolder>/<filename>.<ext> (should start with / or ${<expression>} ), /<rootFolder>/<filename> (extension should be there in the filename) |
Credential Name | Name of the Oauth2 Authorization Code artifact. |
Archive (Optional) | Allow you to specify if you want to Archive the file. Choosing only archive (without Delete) will not delete the original file (only make a copy of file in the archive path). |
Delete (Optional) | Allow you to specify if you want to Delete the file. Choosing only Delete (without Archive) will move the file to trash. |
Archive File Path (Mandatory if Archive selected) | Specifies the target directory where to move the file. ⚠️Caution: Target folder creation is not supported as of now so always mention the folders which are present in the drive. |
Add Timestamp (Optional) | Allow you to specify if you want to add timestamp to the archive file name. e.g. archiveFilename2023-09-14 17:15:20.217.pdf |
Scheduler
Scheduler Option | Field | Description |
---|---|---|
Run Once | Specify if you want to run only once. | |
Schedule on Day | On Date | Specify the date on which you want the operation to be executed. |
On Time | Specify the time at which you want the operation to be executed. | |
Every | Specify a time period (e.g., every hour) in a dedicated time window. | |
Time Zone | Select the time zone that you want the scheduler to use as a reference for the date and time. | |
Schedule to Recur | Daily | Select the time or interval and time zone for the schedule to recur. |
Weekly | Select the checkboxes to indicate the days of the week on which the operation has to be executed. Also, specify the time or interval for the schedule to recur. | |
Monthly | Select the day of the month on which the operation has to be executed. Also, indicate the time or the interval for the schedule to recur. |
Once you have created a sender channel and selected the Google Drive receiver adapter, you can configure the following attributes.
General
Parameter | Description |
---|---|
Name | Enter the name of the Google Drive channel. |
Settings
Parameter | Description |
---|---|
Choose Operation | Select the type of operation you want to perform. 1. Download: Export the file from the Google Drive. 2. Upload: Import the file to the Google Drive. |
File Path | Name of the filepath to Download/Upload. Use of Simple Camel expression is also supported. ⚠️Caution: Multiple filenames are not supported. Please always mention absolute path from the root ( / ).While using both Simple Expression and constant, Please always mention extension of the file separated by . .ℹ️Note: Example of supported file paths are below. /<rootFolder>/<subFolder>/<filename>.<ext> , /<filename>.<ext> , ${header.filepathwithext} , /<rootFolder>/${property.filenamewithext} Example of file paths not supported are below. <rootFolder>/<filename>.<ext> (should start with / or ${<expression>} ), /<rootFolder>/<filename> (extension should be there in the filename) |
Credential Name | Name of the Oauth2 Authorization Code artifact. |
Archive (Optional) | Allow you to specify if you want to Archive the file. Choosing only archive (without Delete) will not delete the original file (only make a copy of file in the archive path). |
Delete (Optional) | Allow you to specify if you want to Delete the file. Choosing only Delete (without Archive) will move the file to trash. |
Archive File Path (Mandatory if Archive selected) | Specifies the target directory where to move the file. ⚠️Caution: Target folder creation is not supported as of now so always mention the folders which are present in the drive. |
Add Timestamp (Optional) | Allow you to specify if you want to add timestamp to the archive file name. e.g. archiveFilename2023-09-14 17:15:20.217.pdf |
The sender adapter is configured to download the file and scheduled to run once. The Archive, Delete and Add Timestamp is also added.
A content modifier is added to define the file name as a property and assign a string "x" as the body to be uploaded by the receiver adapter.
The receiver adapter is configured to upload the file to google drive with simple camel expression in the file path.
The iFlow run will Download the TestFile.pdf
file from TestFolder
and archive the same with added timestamp in TestFolder
. This will also upload a file named as TestFile1.pdf
in TestFolder
as per the file path configuration /TestFolder/${property.x}
.
There is only one file named TestFile.pdf
in TestFolder
.
There are 2 files in the TestFolder
.
TestFile1.pdf
contain "x" which was configured in the content modifier body.
You have successfully configured and deployed a SAP Integration Suite iFlow with a custom Google Drive adapter, enabling scheduled runs, file downloads, archiving, timestamping, and handling large files. Make sure to test the adapter thoroughly in your tenant to ensure it meets your integration requirements.
If not then you can always clone the repo and change the code as per the requirement and then use maven mvn clean install
command to build the adapter again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
10 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 | |
2 | |
2 |