Before you can use Google Docs™ to create and edit Documents and Media files, you must configure Liferay DXP to connect with an application in the Google API Console.
First, you must configure your Google project to use the Google Drive™ API and set up OAuth 2 for use with that project.
Enable the Google Drive™ API for your project. For instructions, see the Google API Console documentation on enabling and disabling APIs.
Create an OAuth 2 client ID for your Google project. For instructions, see the Google API Console documentation on setting up OAuth 2.0. Select Web application when prompted to select your application type. Take note of the client ID and client secret that appear—you’ll need them to configure the portal to use the Google Drive™ API.
Now that you have a Google project set up for use with Liferay DXP, you must connect your installation to that project. You can do this at two scopes:
- Globally, for all instances in your Liferay DXP installation.
- At the instance scope, for one or more instances in your Liferay DXP installation.
You can override the global configuration for one or more instances by configuring those instances separately. Similarly, you can configure only the instances you want to connect to your Google project and leave the global configuration empty.
Follow these steps to configure your Liferay DXP installation to connect to your Google project:
Note that the configuration options are the same in the global and instance-level configurations.
To access the global configuration, go to Control Panel → Configuration → System Settings → Documents and Media.
To access the instance-level configuration, go to Control Panel → Configuration → Instance Settings → Documents and Media.
Under VIRTUAL INSTANCE SCOPE, select Google Drive.
Enter your Google project’s OAuth 2 client ID and client secret into the Client ID and Client Secret fields.