Calendar Importer Concepts

(I did not name these.)

This document describes the broad high level view of the different parts of PlaceCal that are involved in the calendar importer.

Models

Calendar Model

Holds the user's configuration for importing and any user feedback we need to give them. Also has the option for strategy and related partner information

Event Model

Holds an event information that is used on the front end. Is tightly coupled to calendar.

The worker

Importer

The code that wraps the instance of an import job. Is triggered by an ActiveJob task or manually through rake tasks. It is also used by the calendar model to check if the user supplied source URL is something that can be imported from. If something goes wrong with a job run it is detected and the Importer then tries to update the Calendar to be in an error state (so the user can have some feedback).

Event Resolver

Each incoming event has to be carefully constructed according to the calendar strategy. Some events (from ICS) have recurring rules so one 'source event' may have many 'database event records' as we just populate repeating events manually in the db.

Parser

Parser has two jobs: given a calendar source URL find the appropriate parser to handle that domain and to download and extract the event data from the remote end. When it has data it then uses that to create IMPORTER events (not application model Events).

Event

The object that takes the disperate data coming in from the parser and presents it in a uniform manner to the EventResolver.

Tasks

Importer tasks reside in the /lib/tasks/events.rake file and perform these basic actions