Skip to main content

Google Drive

The Google Drive integration provides access to the files you manage on Google Drive. In standard versions of Brightspot, this integration provides the following features:

  • Google Doc—Can be imported into Brightspot as an article, blog post, document, or a general attachment.
  • Google Sheet—Can be imported into Brightspot as sections, tags, users, spreadsheets, or as a general attachment.
  • Google Presentation—Can be imported into Brightspot as a presentation.
Note

You can configure this integration so that it converts Google Drive files to content types that you have created, and not just the built-in content types that Brightspot provides. To do this, you must tie together the Google functionality to a specific content type. For details, see the README.

Once imported, Brightspot checks the source file to detect any changes made after the import. If changes are made, Brightspot indicates this in the Sync widget of an asset created as a result of the import. (For details, see Re-importing a Google Drive file.) If no changes are detected, Brightspot reports that the source file and the Brightspot asset are in sync.

Including Google Drive in a build

The following table lists the dependencies to include in your build configuration.

ArtifactDescription
com.psddev:google-driveExposes the syncable widget, Google Drive integrated search, GoogleDriveSyncable interface, and UpdatableExternalItemConverter abstract class.

Runtime prerequisites

  • Developer configuration

    • Extend UpdatableExternalItemConverter for each content type that you want to convert from GoogleDriveFile.
    • The content type must also implement GoogleDriveSyncable for the synchronization to work.
    • For an example that converts a Google Drive file to an Article, see the package brightspot.google.drive.article. For a more complicated example that converts a Google Sheet to multiple instances of Section or Tag, see the package brightspot.google.drive.sheets.
  • Ops configuration—Configure a redirect URI and a redirect URI pattern. For details, see Authenticate by using API keys.

  • CMS configuration—Configure the site interfacing with Google Drive. For details, see Configuration.

See also:

Configuration

You configure integrated search with Google Drive at the Global level, and individual sites inherit that configuration.

To configure the Google Drive integration:

  1. In your Google Cloud console, obtain your API key, client ID, and client secret for the required Google Drive account. For details, see Authenticate by using API keys.

  2. Click > Admin > Sites & Settings > Sites > Global.
  3. Expand Integrations > Google.

  4. In the Google Server API Key, Drive Client ID, and Drive Client Secret fields, paste the values from step 1. (Ignore the Task Host field, as it is not needed for this configuration.)

    Note

    After pasting in the value into the Drive Client ID field, you must add https://cms.doc-team.lower.k1.m1.brightspot.cloud/googleDriveAuth as a Redirect URI in the Google Developer Console.

  5. Click Save.

Importing a Google Doc

Use the following procedure to import a Google Doc from Google Drive into Brightspot.

To import a Google Doc:

  1. Open the search panel.

  2. Set the content types filter to Google Drive File.

    Searching for a Google Drive file

  3. If this is the first time you are searching for files in Google Drive, do the following:

    1. In the search panel, click Click here to authenticate Google Drive.
    2. Follow the prompts to allow Brightspot to access your Google Drive account.
    3. Click Close.
  4. Add other filters or search text. For additional information, see Search filters. Brightspot lists any matching files.

  5. Click on the Google Drive file you want to import.

  6. Under the Converter list, select one of the following:

    • Convert Google Doc

      • Under Convert to Type, select one of the following:

        • Article—Imports the Google Doc as an article draft. You can then modify the draft as described in Article.
        • Blog Post—Imports the Google Doc as a blog post draft. You can then modify the draft as described in Blog post.
        • Document—Imports the Google Doc as a document draft. You can then modify the document as described in Document.
    • Import Google File as Downloadable File

      • Under Import Type, select one of the following:

        • Attachment File—Imports the Google Doc as an attachment file that can be downloaded.
        • Document—Imports the Google Doc file as a published document. You can then modify the document as described in Document.

        (These imports are ideal for sharing the imported files with digital asset management.)

        Caution

        As imported files approach or exceed 100MB, there is an increased possibility of a timeout occurring. For best results, reduce the file's size before initiating an import.

  7. In the content edit form, click Import.

Brightspot imports the file and displays it in a content edit form. You can modify the imported file.

Note

Any changes you make to an imported Google Drive file in Brightspot are not reflected in the source file.

For additional information about importing external assets, see Importing external videos.

Importing a Google Sheet

You can import tags, sections, or users into Brightspot from a Google Sheet.

To import a Google Sheet:

  1. In the header, click the search field to open the search panel.

  2. Under Global Filters, in the Any Content Type filter, select Google Drive File.

    5.0-any-content-type-search-filter
  3. Click the title of the Google Sheet you want to import into Brightspot.

  4. Under the Converter list, select one of the following:

    • Convert Google Sheet

      • Under Convert to Type, select one of the following:

        • Section—Imports the Google Sheet as a section draft. You can then modify the draft as described in Section.
        • Tag—Imports the Google Sheet as a tag draft. You can then modify the draft as described in Tag.
        • Tool User—Imports the Google Sheet as a tool user draft. You can then modify the user as described in Users and roles.
      • After choosing one of the available types, proceed to step 5 below.

    • Import Google File as Downloadable File

      • Under Import Type, select one of the following:

        • Attachment File—Imports the Google Sheet as a published attachment file that can be downloaded.
        • Spreadsheet—Imports the Google Sheet file as a published spreadsheet. You can then modify the document as described in Spreadsheet.
  5. Toggle on Has Header Row if your Google Sheet includes a header row. When toggled on, Brightspot lists the headings for you as you configure field mappings. When toggled off, Brightspot lists the columns as letters.

  6. Under Field Mappings, do the following:

    1. Click .

    2. Under Column, select the column containing the field you are mapping.

    3. Under Field, select one of the following:

      1. If importing tags or sections:

        • Display Name—Sets the values in this column as the names of the tags or sections in Brightspot.
        • Description—Sets the values in this column as the descriptions of the tags or sections in Brightspot.
        • Parent—Sets the values in this column as the parents of the tags or sections you are importing into Brightspot. If no parent by the given name already exists, Brightspot creates it and assigns the tag or section to which it pertains.
      2. If importing users:

        • Name—Sets the values in this column as the names of the users in Brightspot.
        • Email—Sets the values in this column as the email addresses of the users in Brightspot.
        • Username—Sets the values in this column as the usernames of the users in Brightspot.
        • Password—Sets the values in this column as the passwords of the users in Brightspot. You may enter a password, or enter changeme to force the user to change their password upon first log in.
    4. Repeat steps 6a–6c for all columns in the Google Sheet.

  7. Click Import.

  8. When the import completes, refresh the page to view the list of the tags or sections you imported.

    Note

    All tags or sections imported from a Google Sheet to Brightspot are published upon the completion of the import, but without URLs. For details on the options you have available when updating them, see Tag, Section.

Example Import

The following image displays a Google Sheet that has been configured for import into Brightspot.

Sample spreadsheet for Sheets import.png

In the Import widget, under Field Mappings, three mappings are configured pertaining to the three columns in the sample spreadsheet:

  • Mapping 1—Brightspot maps column A as parent.

    Field mapping 1.png

    • In the Column field, column A (referred to in the Google Sheet header as "Parent") is selected.
    • In the Field field, Parent is selected.
  • Mapping 2—Brightspot maps column B as tag name.

    Field mapping 2.png

    • In the Column field, column B (referred to in the Google Sheet header as "Display Name") is selected.
    • In the Field field, Display Name is selected.
  • Mapping 3—Brightspot maps column C as description.

    Field mapping 3.png

    • In the Column field, column C (referred to in the Google Sheet header as "Description") is selected.
    • In the Field field, Description is selected.

After clicking Import, Brightspot performs the import according to the following mappings:

  • Apple is created as a tag with Red as its parent and A red fruit as its description.
  • Kumquat is created as a tag with Orange as its parent and An orange fruit as its description.
  • Lemon is created as a tag with Yellow as its parent and A yellow fruit as its description.
Imported tags or sections.png
A list of tags imported from the Google Sheet.
Imported tag.png
The tag Lemon imported from the Google Sheet. The parent Yellow and the description A yellow fruit are associated to it.

Re-importing a Google Drive file

If a Google Drive file is edited after being imported to Brightspot, you can re-import its latest version to Brightspot.

To re-import a Google Drive file:

  1. In the header, click the search field to open the search panel.
  2. Under Global Filters, in the Any Content Type filter, under External Types, select Google Drive File. Brightspot displays a list of Google Drive files.
  3. Click the Google Drive file you want to re-sync. In the Sync widget, Brightspot indicates whether any changes were made in the Google Drive file.
  4. Click Reimport from Source. Brightspot refreshes the page with updates from the re-imported Google Drive file.
  5. If necessary, re-publish the changes.

Syncing Google Drive assets

The source files of assets imported from Google Drive may change from time to time. In order to ensure the assets published on Brightspot are the most current version, you must sync them with the source file. This is done using the Sync widget.

The Sync widget lets you know whether the version you currently have published on Brightspot is current, or if the source file has been modified since it was last imported. In the image below, you can see the message that lets you know your asset is using the current version of the source file and is in sync.

Sync widget showing that file is current

If the source file has changed since you last imported it into your asset, the following message displays in the Sync widget.

Sync widget displaying out of sync message

To view the source file to see what changes have been made, click source. This opens the Google Drive file in a new tab or window. Here, you can look at the source file to determine whether you want the updates to be displayed on your published Brightspot asset.

If you decide you would like to update the content of your asset, click Reimport From Source. This opens a pop-up that asks you to confirm that you would like to reimport the file. To confirm this process, click Sync Now.

This pulls in the latest version of the source file from Google Drive.

Caution

Remember to save or publish your asset once the reimporting process is complete. Failing to do so results in the reimported file not being retained in your asset.

Note

If the source file is deleted, the asset's content edit form no longer displays the Sync widget.