Modules:Google Apps Integration/Configuration
![]() | Back to Modules:Google Apps Integration |
Contents |
Summary
This document explains the common configuration required for all integrations with Google APIs.
It is divided in two main sections Google API Project which is required in order to make accessible Google API from Openbravo, and Error Handling which is strongly recommended to have a proper tracking of possible errors occurred during the integration.
Google API Project
Openbravo accesses Google through a Google API Project. The first step is to create a Project associated to a Google account. Note this account is not necessarily the one that will be associated to retrieve elements (i.e. calendars) from, but it will be used for API purposes, for example, Google has different quotas for each API accessible from each project.
Create a New Project
In Google APIs Console click on Create...
Open Services for different Google Apps
In Services tab select the APIs that will be usable from this project. For example, Calendar API.
Authorize API
In API Access, click on Create an OAuth2 Client ID... and set it up. It is important to select Web Application in Application Type dialog.
Define Redirect URIs
In the new Client ID for web applications, click on Edit Settings...====. In the dialog
enter the URI(s) that will be accessed your Openbravo instance from, you can have multiple each on a new line, they must be in the following way [yourOpenbravoServer/openbravoContext]/org.openbravo.integration.google.common/OAuth2Callback
, for example http://www.yourCompany.com/openbravo/org.openbravo.integration.google.common/OAuth2Callback
. No Authorized JavaScript Origins are required.
Get Client Secrets
Finally download "Client Secrets" by clicking on Download JSON link, this will download a file.
Configure Google API Project in Openbravo
Log in Openbravo as System Administrator and open Google Integration Configuration window, create a new record and in Client Secrets field paste the contents of the file downloaded in the previous step.
Error Handling
During the integration with Google APIs may occur errors due to different reasons such as incorrect configuration, unavailability of the service, reached quotas, etc.
The following sections explain how to deal with these errors when they happen.
Integration Log
All integration events are logged in Openbravo within Google Integration Log window.
The most relevant information available in this window is:
- Google App: Refers to the Google API the integration event is related to
- Status: Which is the status of the event (note, by default, when the window is opened, Success events are hidden). Possible values are:
Success
: The event was correctly synchronized with Google.Error
: There was an error during the synchronization and the event is not in Google App.Fixed
: The event was not initially synchronized, but after retrying synchronization, it was finally successfully synchronized.Given Up
: The event initially failed and after retrying to automatically synchronize it the configured number of times it was not possible. Events in this status will not be further tried to be synchronized in an automatic manner.
- Executions: Number of times the event was tried to be synchronized.
- Log: For each time the event was tried to be synchronized, information about the causes making it to fail.
From this window, it is possible to select one or several rows within an status different to Success or Fixed and manually retry execution by executing the Retry Execution action button.
Automated Log Maintenance
In addition to manually retry failed executions it is possible to automatically maintain Integration Log. This is achieved by scheduling Google Integration Log Background Process.
This process is in charge of two actions, both of them can be configured as System Administrator from Google Integration Configuration window:
- Retrying failed executions. If configured, the process will look in the log for events in Error status to try to synchronize them again. This action is set up by Retry Failed Log n Times field in Google Integration Configuration window, possible values for this field are:
-1
: Failed events are never tried to be automatically synchronized.0
: Failed events are 'always tried to be automatically synchronized without any limit of failed executions.>0
: Failed events are tried to be automatically synchronized n number of times, wheren
is the value of this field. If the event fails all these executions, its status is moved toGiven Up
and subsequent executions of the background process will not retry to synchronize it again.
Alert
Synchronization events in Error
or Given Up
status can be shown as alerts. To visualize it Google Integration Problems alert needs to be configured.
![]() | Google Integration Problems alert is not configured by default, so if it is not set up, no alerts for failed events will be shown. |
Instances of this alert link to the Google Integration Configuration window to manually try to fix the synchronization.
![]() | Back to Modules:Google Apps Integration |