Plugin: Google Calendar gatherer

Purpose

Use this plugin to include content from Google Calendar in your search results.

Prepare Google Calendar for indexing

Before you start, the following steps must be completed to configure your Google Calendar for use with the plugin:

  • Create a Google Cloud project with the Calendar API enabled. See: Create a service account - Steps 1 and 2

  • Configure a Google service account with a JSON private key. See: Create a service account - Step 4

  • Configure the Google Calendar permissions to be either:

    • a public calendar, or

    • have read permission assigned to both the service account and to any users that will be accessing the non-public calendar.

Usage

Enable the plugin

  1. Select Plugins from the side navigation pane and click on the Google Calendar gatherer tile.

  2. From the Location section, select the data source to which you would like to enable this plugin from the Select a data source select list.

The plugin will take effect after setup steps and an advanced > full update of the data source has completed.

Configuration settings

The configuration settings section is where you do most of the configuration for your plugin. The settings enable you to control how the plugin behaves.

The configuration key names below are only used if you are configuring this plugin manually. The configuration keys are set in the data source configuration to configure the plugin. When setting the keys manually you need to type in (or copy and paste) the key name and value.

Google service account private key

Configuration key

plugin.google-calendar.encrypted.private-key

Data type

Encrypted string

Required

This setting is required

The Google service account private key file context. Copy and paste the JSON private key file downloaded from Google Cloud console.

Copy and paste the JSON private key file downloaded from Google Cloud console.

Google Calendar ID

Configuration key

plugin.google-calendar.config.calendar-id

Data type

string

Required

This setting is required

Google Calendar ID, which can be found in the settings section for each calendar in Google Calendar. Note: the plugin can only gather content from a single Google calendar.

the plugin can only gather content from a single Google calendar.

Past events inclusion period (number of days)

Configuration key

plugin.google-calendar.config.from-days-back

Data type

integer

Default value

-1

Required

This setting is optional

Specifies the number of days, relative to the current date, in the past to include in the index. A negative value means disable this feature.

Future events inclusion period (number of days)

Configuration key

plugin.google-calendar.config.to-days-ahead

Data type

integer

Default value

0

Required

This setting is optional

Specifies the number of days, relative to the current date, in the future to include in the index. Setting the value to '0' disables this feature.

If past events inclusion period (number of days) (from-days-back) or future events inclusion period (number of days) (to-days-ahead) is disabled, then the Google Calendar API default behaviour will determine what is returned in relation to the dates range of events. All the calculation of the dates is based on the server time and timezone.

Metadata configuration

Default mappings

Class ID Type JSON fields from Google Calendar API

t

text

/json/summary

c

text

/json/description

author

text

/json/creator/displayName

d

date

/json/start/date

d

date

/json/start/dateTime

endDateTime

text

/json/end/date

endDateTime

text

/json/end/dateTime

Fields that have default mappings cannot be mapped to other metadata classes. If you require a field to also be mapped to another metadata class it needs to be cloned using the combine / clone metadata plugin.

Manual metadata mapping

Use the metadata mappings editor to configure your metadata mappings.

Available fields will be listed by viewing the available XML fields after you have run an update of your Google Calendar feed.

The -SF query processor option must also be configured on your results page to include these metadata fields in the search response (e.g. -SF=[<LIST OF METADATA CLASSES TO DISPLAY>]).

User mentions and hash-tags

User mentions and hash-tags within Google Calendar content can be made searchable by enabling the social tags plugin.

Plugin error handling

The Google Calendar API will return a HTTP 404 not found error if

  • the supplied Calendar ID is invalid, or

  • the permissions set on the Google calendar do not allow the service account to access the calendar.

Filter chain configuration

This plugin uses filters which are used to apply transformations to the gathered content.

The filters run in sequence and need be set in an order that makes sense. The plugin supplied filter(s) (as indicated in the listing) should be re-ordered to an appropriate point in the sequence.

Changes to the filter order affects the way the data source processes gathered documents. See: document filters documentation.

Filter classes

This plugin supplies a filter that runs in the main document filter chain: JSONToXML

Drag the JSONToXML plugin filter to where you wish it to run in the filter chain sequence.

Examples

Google Calendar event JSON

The following fields are returned by the Google Calendar API for each event.

{
  "kind": "calendar#event",
  "etag": etag,
  "id": string,
  "status": string,
  "htmlLink": string,
  "created": datetime,
  "updated": datetime,
  "summary": string,
  "description": string,
  "location": string,
  "colorId": string,
  "creator": {
    "id": string,
    "email": string,
    "displayName": string,
    "self": boolean
  },
  "organizer": {
    "id": string,
    "email": string,
    "displayName": string,
    "self": boolean
  },
  "start": {
    "date": date,
    "dateTime": datetime,
    "timeZone": string
  },
  "end": {
    "date": date,
    "dateTime": datetime,
    "timeZone": string
  },
  "endTimeUnspecified": boolean,
  "recurrence": [
    string
  ],
  "recurringEventId": string,
  "originalStartTime": {
    "date": date,
    "dateTime": datetime,
    "timeZone": string
  },
  "transparency": string,
  "visibility": string,
  "iCalUID": string,
  "sequence": integer,
  "attendees": [
    {
      "id": string,
      "email": string,
      "displayName": string,
      "organizer": boolean,
      "self": boolean,
      "resource": boolean,
      "optional": boolean,
      "responseStatus": string,
      "comment": string,
      "additionalGuests": integer
    }
  ],
  "attendeesOmitted": boolean,
  "extendedProperties": {
    "private": {
      (key): string
    },
    "shared": {
      (key): string
    }
  },
  "hangoutLink": string,
  "conferenceData": {
    "createRequest": {
      "requestId": string,
      "conferenceSolutionKey": {
        "type": string
      },
      "status": {
        "statusCode": string
      }
    },
    "entryPoints": [
      {
        "entryPointType": string,
        "uri": string,
        "label": string,
        "pin": string,
        "accessCode": string,
        "meetingCode": string,
        "passcode": string,
        "password": string
      }
    ],
    "conferenceSolution": {
      "key": {
        "type": string
      },
      "name": string,
      "iconUri": string
    },
    "conferenceId": string,
    "signature": string,
    "notes": string
  },
  "gadget": {
    "type": string,
    "title": string,
    "link": string,
    "iconLink": string,
    "width": integer,
    "height": integer,
    "display": string,
    "preferences": {
      (key): string
    }
  },
  "anyoneCanAddSelf": boolean,
  "guestsCanInviteOthers": boolean,
  "guestsCanModify": boolean,
  "guestsCanSeeOtherGuests": boolean,
  "privateCopy": boolean,
  "locked": boolean,
  "reminders": {
    "useDefault": boolean,
    "overrides": [
      {
        "method": string,
        "minutes": integer
      }
    ]
  },
  "source": {
    "url": string,
    "title": string
  },
  "attachments": [
    {
      "fileUrl": string,
      "title": string,
      "mimeType": string,
      "iconLink": string,
      "fileId": string
    }
  ],
  "eventType": string
}

See: Google Calendar API - events resource for details on each of the fields.

The JSON data is processed using the JSONToXML filter.

All the fields are available for mapping with the elements being nested beneath a JSON element: /json/,

e.g. to map the location field, use the following XPath when configuring your XML field mapping /json/location. See: default metadata mappings above for some more examples of metadata field mappings.

Change log

[1.1.0]

Changed

  • Updated to the latest version plugin framework (Funnelback shared v16.20) to enable integration with the new plugin management dashboard.

  • Update org.json.json to version 20230618