Represents a single calendar event as a WebDAV resource under a CalendarFolder, ie an event invitation. Serves the event as an ICS (iCal) document to calendar clients, or as an HTML admin or website page to browsers, and handles the event's form posts: RSVP responses, adding an attendee, duplicating the event, generating an invitation email job, and saving edits made in the event editor. A profile registers their attendance by posting a form to this resource with an 'rsvp' parameter. Anonymous registration is allowed when the owning calendar has a new-profile group configured, in which case a profile is created or matched by email address on RSVP.

Group: Resources

Extends: FileResource

Implements: ICalResource, DeletableResource, ReplaceableResource, CommitableResource, GetableResource, PostableResource


Properties

PropertyReturnsDescription
allowGuestsbooleanWhether an attendee may bring guests when accepting this event. True by default.
allowRegistrationbooleanWhether profiles are allowed to self-register (RSVP) for this event. True by default.
attendeesList<ProfileBean>Profiles who have accepted this event, as a lazily-computed and cached list of profile summary beans. Excludes accepted attendee requests that have no associated profile, ie guest-only registrations.
bodyStringBody content used when rendering this resource through the content-editor pipeline, taken from the event's description.
calendarCalendarCalendar that owns this event, ie the calendar entity of the parent CalendarFolder.
currentProfileProfileProfile of the currently logged-in user, or, if nobody is logged in, the profile associated with the current tracking-app visitor.
descriptionStringFree-text description or body of the event.
emailConfirmbooleanWhether a confirmation email is sent to a profile after they RSVP to this event. True by default.
emailConfirmSubjectStringSubject line used for the RSVP confirmation email sent to an attendee.
emailConfirmTemplateStringName of the template used to render the RSVP confirmation email sent to an attendee, or null if none is set.
endStringEnd date and time formatted as a display string, adjusted for the date's own time zone offset.
endDateDateEnd date and time of the event, with any Hibernate Timestamp wrapper normalised to a plain Date.
externalUrlStringExternal URL associated with the event, eg a video meeting link.
guestsList<GuestBean>Accepted attendee requests that have no associated profile, ie anonymous guest registrations, as a lazily-computed and cached list.
htmlRenderFileResourceRenderable HTML representation of this event. Always null, because this resource renders its own page directly instead of delegating to a separate renderable file.
iCalDataStringRenders this event as an ICS document by writing its content to an in-memory buffer and returning the result as a UTF-8 string.
icsboolean
locationStringLocation of the event, as free text.
maxAttendeesIntegerMaximum number of attendees allowed for this event.
modifiedDateDateLast-modified date of the underlying file node. Only exposed when this resource is being served as an ICS document, so it does not affect caching of the rendered HTML page.
myAttendeeRequestAttendeeRequestThe current profile's attendee request for this event, looked up by profile and event.
myGuestsList<GuestBean>Guests registered by the current profile for this event, as a lazily-computed and cached list.
nameStringPath-safe name of this event, used as the last URL segment of the event within its owning calendar. Falls back to the underlying file node's name if the event entity has not been set.
newProfileGroupGroupGroup new anonymous registrants are added to when they RSVP to this event without an existing profile.
numAttendeeslongCount of accepted attendees for this event, lazily computed and cached for the life of this resource instance.
organisorProfileProfile of the person organising the event. Only the organisor may invite attendees by email or reassign the event to another organisor.
participantsList<AttendeeRequest>All attendee requests recorded against this event, lazily loaded and cached for the life of this resource instance.
remindersList<Reminder>Reminders configured for this event, each specifying how long before the event to notify attendees.
rsvpStatusStringParticipation status (eg 'ACCEPTED', 'DECLINED', 'TENTATIVE', 'NEEDS-ACTION') of the current profile's RSVP to this event.
shortPathStringShort, human-friendly path segment for the event.
startStringStart date and time formatted as a display string, adjusted for the date's own time zone offset.
startDateDateStart date and time of the event, with any Hibernate Timestamp wrapper normalised to a plain Date.
startDateUTCDateTimeStart date and time of the event converted to UTC.
summaryStringOne-line summary of the event, used as its title and shown on ICS invitations.
suppressGuestEmailsbooleanWhether guest attendees, ie those without a profile, are excluded from reminder and notification emails for this event. False by default.
timerUnitsTimeUnit[]All available reminder time units (eg DAYS, HOURS) offered when configuring a reminder's lead time.
timezoneStringID of the time zone the event's start and end dates are interpreted in.
timezoneIdListList<String>All time zone IDs available for selection when editing this event.
timeZoneOffsetIntegerOffset between the event's own time zone and UTC at the event's start date.
timeZoneOffsetStrStringTime zone offset formatted as a display string, eg '+10 hrs' or '-5 hrs'.
titleStringDisplay title of the event, taken from the event's summary. Used as the page title and as the subject line when generating an invitation email job.
underlyingContentTypeStringContent type used to render this resource as a page when it is not being served as an ICS attachment. Always 'text/html'.
uniqueIdStringUnique WebDAV identifier of this resource. Only exposed when this resource is being served as an ICS document, so the rendered HTML page is not cached as a static file.

Inherited from FileResource

Properties

PropertyReturnsDescription
aBitStringReads a small leading fragment of this file's content (the first 30 bytes), used to sniff whether the file starts with a DOCTYPE declaration. Returns null if the content could not be read.
contentManagedPermissionsbooleanWhether this resource's permissions are managed as content permissions. Always true for a FileResource.
cssPathsList<String>Lists the CSS file paths that apply when rendering this resource, resolved from the current theme and template.
dirbooleanWhether this resource is a directory. Always false for a FileResource.
fileNodeFileNodeThe underlying data node this resource is backed by, which provides access to the file's raw content and hash.
glyphiconStringA Bootstrap glyphicon CSS class name suited to this file's content type - an expand icon for video, a picture icon for images, and a generic file icon otherwise.
paramNamesList<String>Lists the names of all the script parameters defined in this page's head section, if it is a HTML page.
sourceTenantIdlongThe id of the tenant organisation that owns this file's content.
textContentStringReturns all of the raw text content of this resource, decoded as UTF-8. For a HTML page this is the raw HTML markup, not the rendered output.
themeResourcebooleanChecks whether this file lives under a website's theme directory, by walking up its parent directories looking for a folder named "theme" directly inside a website branch resource.
websiteBranchWebsiteBranchResourceWalks up this resource's ancestors to find the nearest one that can report a domain name - a ManageWebsiteBranchFolder when viewed in the admin console, or a WebsiteRootFolder when viewed on a website.

Methods

getSourceTenantId() · getCssPaths() · isDir() · parseHtml() · hasDocType() · getABit() · getParam(String name) · setParam(String name, String value) · getParamNames() · doSaveHtml() · doSaveHtml(boolean runTidy) · getFileNode() · is(String type) · getTextContent() · getWebsiteBranch() · getGlyphicon() · isContentManagedPermissions() · isThemeResource()

getSourceTenantId()

Returns: long

The id of the tenant organisation that owns this file's content.

getCssPaths()

Returns: List<String>

Lists the CSS file paths that apply when rendering this resource, resolved from the current theme and template.

isDir()

Returns: boolean

Whether this resource is a directory. Always false for a FileResource.

parseHtml()

Returns: RenderFileResource

Returns a HTML renderable view of this file, parsing it as HTML regardless of whether it has a doctype declaration. Unlike getHtml, this does not skip files that would otherwise be treated as plain HTML.

hasDocType()

Returns: boolean

Checks whether this file's content begins with a DOCTYPE declaration, which indicates it should be treated as plain, unrendered HTML rather than a templated page.

getABit()

Returns: String

Reads a small leading fragment of this file's content (the first 30 bytes), used to sniff whether the file starts with a DOCTYPE declaration. Returns null if the content could not be read.

getParam(String name)

Returns: String

If this resource is a HTML page, this returns the script parameter with the given name A script parameter is defined in the head section of a HTML page in a script element, where the title attribute is the name of the parameter, and the element's type parameter is 'data/parameter'

ParameterDescription
namethe parameter name to look up

setParam(String name, String value)

Returns: void

Sets a script parameter on this file's HTML page. This resource must be a HTML page, since it calls getHtml without a null check.

ParameterDescription
namethe parameter name
valuethe parameter value

getParamNames()

Returns: List<String>

Lists the names of all the script parameters defined in this page's head section, if it is a HTML page.

doSaveHtml()

Returns: void

Writes any parsed data held in the HTML page representation back to this file's content, running the HTML tidy step first to ensure the result is well-formed. Equivalent to doSaveHtml(true).

doSaveHtml(boolean runTidy)

Returns: void

Writes any parsed data held in the HTML page representation back to this file's content. If no HTML page representation has been created (no HTML content fields have been set) this is a no-op.

ParameterDescription
runTidywhether to run the HTML tidy step on the generated markup before saving it

getFileNode()

Returns: FileNode

The underlying data node this resource is backed by, which provides access to the file's raw content and hash.

is(String type)

Returns: boolean

Checks whether this resource matches the given type name. A plain FileResource always matches "file". It also matches any value that is contained in the file's content type, so a css file with mimetype "text/css" matches both is("text") and is("css"), and for a HTML page it also matches the page's template name.

ParameterDescription
typethe type name to test against

getTextContent()

Returns: String

Returns all of the raw text content of this resource, decoded as UTF-8. For a HTML page this is the raw HTML markup, not the rendered output.

getWebsiteBranch()

Returns: WebsiteBranchResource

Walks up this resource's ancestors to find the nearest one that can report a domain name - a ManageWebsiteBranchFolder when viewed in the admin console, or a WebsiteRootFolder when viewed on a website.

getGlyphicon()

Returns: String

A Bootstrap glyphicon CSS class name suited to this file's content type - an expand icon for video, a picture icon for images, and a generic file icon otherwise.

isContentManagedPermissions()

Returns: boolean

Whether this resource's permissions are managed as content permissions. Always true for a FileResource.

isThemeResource()

Returns: boolean

Checks whether this file lives under a website's theme directory, by walking up its parent directories looking for a folder named "theme" directly inside a website branch resource.


Methods

getName() · getUnderlyingContentType() · getHtml() · getTitle() · getEmailConfirmTemplate() · isEmailConfirm() · getICalData() · formatDate(Date d) · getStartDate() · getStart() · getTimezone() · getExternalUrl() · getEndDate() · getEnd() · getDescription() · getSummary() · getLocation() · getOrganisor() · getShortPath() · isAllowRegistration() · isAllowGuests() · getMaxAttendees() · getCalendar() · getRsvpStatus() · getMyAttendeeRequest() · getParticipants() · getAttendees() · getGuests() · getMyGuests() · getNumAttendees() · timeZoneOffset(String s) · getTimeZoneOffset() · getTimeZoneOffsetStr() · getTimezoneIdList() · getStartDateUTC() · getModifiedDate() · getUniqueId() · getTimerUnits() · getReminders() · isSuppressGuestEmails() · getEmailConfirmSubject() · availableWebsite(ManageWebsiteFolder w) · getNewProfileGroup() · getCurrentProfile() · getBody()

getName()

Returns: String

Path-safe name of this event, used as the last URL segment of the event within its owning calendar. Falls back to the underlying file node's name if the event entity has not been set.

getUnderlyingContentType()

Returns: String

Content type used to render this resource as a page when it is not being served as an ICS attachment. Always 'text/html'.

getHtml()

Returns: RenderFileResource

Renderable HTML representation of this event. Always null, because this resource renders its own page directly instead of delegating to a separate renderable file.

getTitle()

Returns: String

Display title of the event, taken from the event's summary. Used as the page title and as the subject line when generating an invitation email job.

getEmailConfirmTemplate()

Returns: String

Name of the template used to render the RSVP confirmation email sent to an attendee, or null if none is set.

isEmailConfirm()

Returns: boolean

Whether a confirmation email is sent to a profile after they RSVP to this event. True by default.

getICalData()

Returns: String

Renders this event as an ICS document by writing its content to an in-memory buffer and returning the result as a UTF-8 string.

formatDate(Date d)

Returns: String

Formats a date as a compact 'yyyyMMddTHHmmss' timestamp with a trailing 'Z', in the style used within ICS files. The date fields are read using the JVM's default time zone rather than a true UTC conversion, despite the trailing 'Z'.

ParameterDescription
dthe date to format, may be null

getStartDate()

Returns: Date

Start date and time of the event, with any Hibernate Timestamp wrapper normalised to a plain Date.

getStart()

Returns: String

Start date and time formatted as a display string, adjusted for the date's own time zone offset.

getTimezone()

Returns: String

ID of the time zone the event's start and end dates are interpreted in.

getExternalUrl()

Returns: String

External URL associated with the event, eg a video meeting link.

getEndDate()

Returns: Date

End date and time of the event, with any Hibernate Timestamp wrapper normalised to a plain Date.

getEnd()

Returns: String

End date and time formatted as a display string, adjusted for the date's own time zone offset.

getDescription()

Returns: String

Free-text description or body of the event.

getSummary()

Returns: String

One-line summary of the event, used as its title and shown on ICS invitations.

getLocation()

Returns: String

Location of the event, as free text.

getOrganisor()

Returns: Profile

Profile of the person organising the event. Only the organisor may invite attendees by email or reassign the event to another organisor.

getShortPath()

Returns: String

Short, human-friendly path segment for the event.

isAllowRegistration()

Returns: boolean

Whether profiles are allowed to self-register (RSVP) for this event. True by default.

isAllowGuests()

Returns: boolean

Whether an attendee may bring guests when accepting this event. True by default.

getMaxAttendees()

Returns: Integer

Maximum number of attendees allowed for this event.

getCalendar()

Returns: Calendar

Calendar that owns this event, ie the calendar entity of the parent CalendarFolder.

getRsvpStatus()

Returns: String

Participation status (eg 'ACCEPTED', 'DECLINED', 'TENTATIVE', 'NEEDS-ACTION') of the current profile's RSVP to this event.

getMyAttendeeRequest()

Returns: AttendeeRequest

The current profile's attendee request for this event, looked up by profile and event.

getParticipants()

Returns: List<AttendeeRequest>

All attendee requests recorded against this event, lazily loaded and cached for the life of this resource instance.

getAttendees()

Returns: List<ProfileBean>

Profiles who have accepted this event, as a lazily-computed and cached list of profile summary beans. Excludes accepted attendee requests that have no associated profile, ie guest-only registrations.

getGuests()

Returns: List<GuestBean>

Accepted attendee requests that have no associated profile, ie anonymous guest registrations, as a lazily-computed and cached list.

getMyGuests()

Returns: List<GuestBean>

Guests registered by the current profile for this event, as a lazily-computed and cached list.

getNumAttendees()

Returns: long

Count of accepted attendees for this event, lazily computed and cached for the life of this resource instance.

timeZoneOffset(String s)

Returns: Integer

Resolves the offset between a named time zone and UTC at the event's start date.

ParameterDescription
sthe time zone ID to resolve, may be null or empty

getTimeZoneOffset()

Returns: Integer

Offset between the event's own time zone and UTC at the event's start date.

getTimeZoneOffsetStr()

Returns: String

Time zone offset formatted as a display string, eg '+10 hrs' or '-5 hrs'.

getTimezoneIdList()

Returns: List<String>

All time zone IDs available for selection when editing this event.

getStartDateUTC()

Returns: DateTime

Start date and time of the event converted to UTC.

getModifiedDate()

Returns: Date

Last-modified date of the underlying file node. Only exposed when this resource is being served as an ICS document, so it does not affect caching of the rendered HTML page.

getUniqueId()

Returns: String

Unique WebDAV identifier of this resource. Only exposed when this resource is being served as an ICS document, so the rendered HTML page is not cached as a static file.

getTimerUnits()

Returns: TimeUnit[]

All available reminder time units (eg DAYS, HOURS) offered when configuring a reminder's lead time.

getReminders()

Returns: List<Reminder>

Reminders configured for this event, each specifying how long before the event to notify attendees.

isSuppressGuestEmails()

Returns: boolean

Whether guest attendees, ie those without a profile, are excluded from reminder and notification emails for this event. False by default.

getEmailConfirmSubject()

Returns: String

Subject line used for the RSVP confirmation email sent to an attendee.

availableWebsite(ManageWebsiteFolder w)

Returns: boolean

Whether the given website folder is a valid target for this event: redirect-only websites are excluded, and if this event's calendar is bound to a specific website then only that website is available.

ParameterDescription
wthe website folder to test

getNewProfileGroup()

Returns: Group

Group new anonymous registrants are added to when they RSVP to this event without an existing profile.

getCurrentProfile()

Returns: Profile

Profile of the currently logged-in user, or, if nobody is logged in, the profile associated with the current tracking-app visitor.

getBody()

Returns: String

Body content used when rendering this resource through the content-editor pipeline, taken from the event's description.

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