Google Calendar
The Google Calendar plugin ships with Nootion. It syncs a database with a Google calendar, both ways:
- each row with a date in the chosen column becomes an event (its title is the row's title, its description a link back to the row);
- events created, moved, renamed or deleted in Google change the database: a new event adds a row, a deleted one sends its row to the trash (from where it can be restored).
Syncs run every minute, and on demand with Sync now. When a row and its event both changed since the last sync, the latest change wins.
#Setting it up (administrator, once)
Google asks each app that reads calendars to have an OAuth client. It's free and takes a few minutes:
Open Google Cloud Console, create a project (e.g. "Nootion").
APIs & Services › Library: enable the Google Calendar API.
APIs & Services › OAuth consent screen (or Google Auth Platform): type "External", an app name ("Nootion"), your email. Under Audience, either add the Google accounts that will use it as test users, or publish the app (see below).
APIs & Services › Credentials › Create credentials › OAuth client ID, type Web application, with this authorized redirect URI:
<APP_URL>/api/plugins/google_calendar/oauth/callbackfor example
https://notes.example.org/api/plugins/google_calendar/oauth/callback. Google only acceptshttpsaddresses, orhttp://localhost.APP_URLmust be the address people use to open Nootion.Copy the client ID and client secret into Administration › Plugins › Google Calendar, and turn the plugin on. (Or leave them empty: each person then uses their own client, see below.)
Test users or published app? While the app is in "Testing", Google stops the connection of each account after 7 days, and it has to be connected again. Publishing it ("In production") removes that limit; Google then shows an "unverified app" warning when connecting (click Advanced › Go to Nootion), which is fine for a family or a small team (up to 100 accounts).
#Without the administrator: your own OAuth client
When the administrator leaves the client ID and secret empty (but turns the plugin on), each person can use their
own OAuth client instead: follow the steps above in your own Google Cloud project, then paste the client ID and
secret in the block, which also shows the redirect URI to authorize. That client is yours only, stored encrypted
(with APP_SECRET); Change in the block forgets it. Once the administrator sets a client, everyone uses theirs.
#Syncing a database (everyone)
- In any page, type
/google calendar(/google agendain French). - Connect to Google: Google asks which account to use and to allow Nootion to see your calendars and manage
their events. Each person connects their own account; the access is stored encrypted (with
APP_SECRET). - Choose the database, its date column, and the calendar, then Sync.
The block then shows the sync: what it links, how many events, when it last ran and any error. The person who set it up can stop it; events already in Google stay there. Disconnecting the Google account (link at the bottom of the setup, or My account › Connected services) revokes Nootion's access and stops that person's syncs.
The sync works with the rights of the person who set it up: they must be able to edit the database.
#Good to know
- Use a calendar made for it ("Nootion tasks"…): the first sync imports every event of the calendar into the database.
- Dates: a date without time is an all-day event; a date with a time is an event in the calendar's time zone, 1 hour long when the row has no end date.
- A repeating event is one row, at its first date. Occurrences changed on their own in Google are not synced.
- Only the title and the dates are synced; other columns stay in Nootion.