A calendar belonging to an organisation or a profile, holding the CalEvent rows shown to its users. A Calendar is a Repository, so it is versioned and addressed the same way as any other repository under its owner, and it carries the repository discriminator CA. It can be restricted to a single website, and access is granted to groups through GroupCalendar link rows. When newProfileGroup is set, a visitor who is not signed in can register for an event on this calendar and a new profile is created for them in that group. One calendar per owner is normally flagged as the default.

Group: Database Entities

Extends: Repository

Implements: Relational, PortableId


Properties

PropertyReturnsDescription
allGroupCalendarList<Group>The groups granted access to this calendar, read out of the GroupCalendar link rows. Returns an empty list when there are no link rows, but note that it reads the collection without a null check, so calling it on a calendar that has never been saved fails.
calendarOrderStringSort key deciding where this calendar appears in a list of calendars. It is held as text rather than a number, so it sorts as text.
colorStringColour used to distinguish this calendar's events in calendar views, as chosen in the admin UI. Null if no colour has been picked. Note the American spelling of the property name.
defaultCalBooleanWhether this is the owner's default calendar, the one used when no particular calendar is named. Null means the flag has never been set, which is treated as false; call defaultCal for the resolved value.
descriptionStringFree text description of what this calendar is for, shown to users choosing between calendars. May be null.
eventsList<CalEvent>The events on this calendar. Deleting the calendar deletes all of them, and a newly created calendar that has not been saved has a null collection rather than an empty one.
groupCalendarList<GroupCalendar>The GroupCalendar link rows that grant groups access to this calendar. Use getAllGroupCalendar if you want the groups themselves rather than the link rows. Lazily loaded.
newProfileGroupGroupGroup that a visitor who is not signed in is added to when they register for an event on this calendar. Null means anonymous registration is not offered. Lazily loaded.
repoTypeStringThe repository type discriminator for a calendar, always the string CA. It is what distinguishes a calendar from other repository kinds such as a website.
websiteWebsiteThe single website this calendar is limited to. Null means the calendar is not tied to one site and is available anywhere within its owning organisation. Lazily loaded.

Methods

getRepoType() · getEvents() · getWebsite() · getGroupCalendar() · getAllGroupCalendar() · getColor() · getDescription() · getCalendarOrder() · getDefaultCal() · getNewProfileGroup() · event(String name) · add(String name) · add(String name, Date now) · defaultCal()

getRepoType()

Returns: String

The repository type discriminator for a calendar, always the string CA. It is what distinguishes a calendar from other repository kinds such as a website.

getEvents()

Returns: List<CalEvent>

The events on this calendar. Deleting the calendar deletes all of them, and a newly created calendar that has not been saved has a null collection rather than an empty one.

getWebsite()

Returns: Website

The single website this calendar is limited to. Null means the calendar is not tied to one site and is available anywhere within its owning organisation. Lazily loaded.

getGroupCalendar()

Returns: List<GroupCalendar>

The GroupCalendar link rows that grant groups access to this calendar. Use getAllGroupCalendar if you want the groups themselves rather than the link rows. Lazily loaded.

getAllGroupCalendar()

Returns: List<Group>

The groups granted access to this calendar, read out of the GroupCalendar link rows. Returns an empty list when there are no link rows, but note that it reads the collection without a null check, so calling it on a calendar that has never been saved fails.

getColor()

Returns: String

Colour used to distinguish this calendar's events in calendar views, as chosen in the admin UI. Null if no colour has been picked. Note the American spelling of the property name.

getDescription()

Returns: String

Free text description of what this calendar is for, shown to users choosing between calendars. May be null.

getCalendarOrder()

Returns: String

Sort key deciding where this calendar appears in a list of calendars. It is held as text rather than a number, so it sorts as text.

getDefaultCal()

Returns: Boolean

Whether this is the owner's default calendar, the one used when no particular calendar is named. Null means the flag has never been set, which is treated as false; call defaultCal for the resolved value.

getNewProfileGroup()

Returns: Group

Group that a visitor who is not signed in is added to when they register for an event on this calendar. Null means anonymous registration is not offered. Lazily loaded.

event(String name)

Returns: CalEvent

Finds the event on this calendar whose file name matches the one given, by scanning the events already loaded on the calendar rather than by querying.

ParameterDescription
namethe event file name to match, compared exactly

add(String name)

Returns: CalEvent

Creates a new event with the given file name and points it at this calendar. The event is neither saved nor added to the events collection, so the caller must persist it.

ParameterDescription
namethe file name for the new event

add(String name, Date now)

Returns: CalEvent

Creates a new event with the given file name and stamps its created and modified dates with the time supplied. As with the single argument form, the event is neither saved nor added to the events collection.

ParameterDescription
namethe file name for the new event
nowthe timestamp to use for both the created and modified dates

defaultCal()

Returns: boolean

The default calendar flag resolved to a plain boolean, treating an unset value as false.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.