Object initialization, setting all the default values.
OptionalnewData: anythe data to load, optional
Optionaloptions: anycustom options to apply; they will depend on the child resource
Usually, there is no need to implement the constructor; implicitly, it will call the load of the child resource
and therefore loading all the resources with default values.
If needed, this is the suggested implementation:
super();
this.load(x);
// ...
If true, it's an all-day event.
The id of the appointment. In case of external calendar, it's the external id; otherwise (local calendars), it's a IUID.
The attendees supposed to partecipate to the event. It's an empty array in case the appointment is "private", i.e. the creator is the only attendee.
The id of the calendar owning the appointment.
For external calendars, it's the direct id of the external calendar (and not the id of idea_calendars),
to avoid repetitions of appointments for each copy of the external calendar linked to an IDEA calendar.
The description of the appointment.
The ending time of the appointment.
A unique id for the appointment, shared across different calendars and calendaring systems (standard RFC5545);
i.e. each appointment in different calendars may have different appointmentId, but it always have same iCalUID.
Note: in many calendaring systems recurring events share the same iCalUID.
OptionalinternalFine grain time of alert, expressed in minutes. In case of appointments on external calendars these will not be valued.
OptionalinternalDate and hour in which the reminder is slotted (YYYYMMDDHH). Avoid timezones: UTC!!
Used to quickly identify the reminders to manage in a particular time frame.
In case of appointments on external calendars these will not be valued.
OptionalinternalProject from which the notification comes; useful to get the notification preferences. In case of appointments on external calendars these will not be valued.
OptionalinternalTeam of the user that need to be notified; useful to get the notification preferences. In case of appointments on external calendars these will not be valued.
OptionalinternalUser that need to be notified; useful to get the notification preferences. In case of appointments on external calendars these will not be valued.
OptionallinkedA list of objects linked to the appointment.
OptionallinkIn case the calendar is linked to external services, the link to access the external resource.
The location of the appointment.
OptionalmasterMaster appointment id (optional): the id of the master appointment, in case this is an occurence.
The appointment notifications and the specs for their execution. These may come from external calendars: in that case no internal notifications will fire. Note on notifications from external services. - Microsoft: up to 1 notification, max 1 week before; - Google: up to 5 notifications; max 4 weeks before; - Multiple notifications at the same time are not allowed.
The starting time of the appointment.
The timezone for the appointent start and end.
The title of the appointment.
Calculate the firing time for internal appointments.
Return an attribute in a cleaned standard that force-cast the element.
the origin attribute, to cast
the cast function, e.g. Boolean, Number, String, x => new CustomClass(x), etc.
OptionaldefaultVal: anyif set, the fallback value instead of null
cleaned attribute
Return an array in a cleaned standard that force-cast each element, keeping only the valid ones.
the origin array, to cast and check
the cast function, e.g. x => String(x) or x => new CustomClass(x)
OptionaldefaultVal: anyif set, the fallback value instead of null
cleaned array
Set a default start/end day for all-day events, to be compatible with external services.
Get the attendance of the desired attendee.
The latter can be identified by email or, by default, as the attendee marked as self.
Optionalemail: stringGet the information on an attendee.
The latter can be identified by email or, by default, as the attendee marked as self.
Optionalemail: stringShortcut to Utils.isEmpty to check the emptiness of a field.
Optionaltype: isEmptyFieldTypesWhether the user is the organizer of the event.
The user can be identified by email or, by default, as the attendee marked as self.
Optionalemail: stringLoad the attributes from an already existing resource.
ProtectedremoveHelper to remove duplicates notifications for the same appointment.
Load the attributes from an already existing resource and then force some attributes to assume safeData values. The function is usually used in the back-end to mix together db data with new data, without the risk of changing ids and other attributes which are managed in appositely curated scenario.
the data to load
the attributes to force to specific values
Valide the object's attributes, performing all the checkings.
errors if empty, the checkings are successfully passed.
Typical implementation:
const e = super.validate();
if(this.iE(this.attr)) e.push(`attr`);
// ...
return e;
Represents an appointment (event) of a calendar.
Table:
idea_appointments.Indexes: