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
| Property | Returns | Description |
|---|---|---|
| allowGuests | boolean | Whether an attendee may bring guests when accepting this event. True by default. |
| allowRegistration | boolean | Whether profiles are allowed to self-register (RSVP) for this event. True by default. |
| attendees | 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. |
| body | String | Body content used when rendering this resource through the content-editor pipeline, taken from the event's description. |
| calendar | Calendar | Calendar that owns this event, ie the calendar entity of the parent CalendarFolder. |
| currentProfile | Profile | Profile of the currently logged-in user, or, if nobody is logged in, the profile associated with the current tracking-app visitor. |
| description | String | Free-text description or body of the event. |
| emailConfirm | boolean | Whether a confirmation email is sent to a profile after they RSVP to this event. True by default. |
| emailConfirmSubject | String | Subject line used for the RSVP confirmation email sent to an attendee. |
| emailConfirmTemplate | String | Name of the template used to render the RSVP confirmation email sent to an attendee, or null if none is set. |
| end | String | End date and time formatted as a display string, adjusted for the date's own time zone offset. |
| endDate | Date | End date and time of the event, with any Hibernate Timestamp wrapper normalised to a plain Date. |
| externalUrl | String | External URL associated with the event, eg a video meeting link. |
| guests | List<GuestBean> | Accepted attendee requests that have no associated profile, ie anonymous guest registrations, as a lazily-computed and cached list. |
| html | 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. |
| iCalData | 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. |
| ics | boolean | |
| location | String | Location of the event, as free text. |
| maxAttendees | Integer | Maximum number of attendees allowed for this event. |
| modifiedDate | 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. |
| myAttendeeRequest | AttendeeRequest | The current profile's attendee request for this event, looked up by profile and event. |
| myGuests | List<GuestBean> | Guests registered by the current profile for this event, as a lazily-computed and cached list. |
| name | 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. |
| newProfileGroup | Group | Group new anonymous registrants are added to when they RSVP to this event without an existing profile. |
| numAttendees | long | Count of accepted attendees for this event, lazily computed and cached for the life of this resource instance. |
| organisor | Profile | Profile of the person organising the event. Only the organisor may invite attendees by email or reassign the event to another organisor. |
| participants | List<AttendeeRequest> | All attendee requests recorded against this event, lazily loaded and cached for the life of this resource instance. |
| reminders | List<Reminder> | Reminders configured for this event, each specifying how long before the event to notify attendees. |
| rsvpStatus | String | Participation status (eg 'ACCEPTED', 'DECLINED', 'TENTATIVE', 'NEEDS-ACTION') of the current profile's RSVP to this event. |
| shortPath | String | Short, human-friendly path segment for the event. |
| start | String | Start date and time formatted as a display string, adjusted for the date's own time zone offset. |
| startDate | Date | Start date and time of the event, with any Hibernate Timestamp wrapper normalised to a plain Date. |
| startDateUTC | DateTime | Start date and time of the event converted to UTC. |
| summary | String | One-line summary of the event, used as its title and shown on ICS invitations. |
| suppressGuestEmails | boolean | Whether guest attendees, ie those without a profile, are excluded from reminder and notification emails for this event. False by default. |
| timerUnits | TimeUnit[] | All available reminder time units (eg DAYS, HOURS) offered when configuring a reminder's lead time. |
| timezone | String | ID of the time zone the event's start and end dates are interpreted in. |
| timezoneIdList | List<String> | All time zone IDs available for selection when editing this event. |
| timeZoneOffset | Integer | Offset between the event's own time zone and UTC at the event's start date. |
| timeZoneOffsetStr | String | Time zone offset formatted as a display string, eg '+10 hrs' or '-5 hrs'. |
| title | 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. |
| underlyingContentType | String | Content type used to render this resource as a page when it is not being served as an ICS attachment. Always 'text/html'. |
| uniqueId | 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. |
Inherited from FileResource
Properties
| Property | Returns | Description |
|---|---|---|
| aBit | 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. |
| contentManagedPermissions | boolean | Whether this resource's permissions are managed as content permissions. Always true for a FileResource. |
| cssPaths | List<String> | Lists the CSS file paths that apply when rendering this resource, resolved from the current theme and template. |
| dir | boolean | Whether this resource is a directory. Always false for a FileResource. |
| fileNode | FileNode | The underlying data node this resource is backed by, which provides access to the file's raw content and hash. |
| glyphicon | 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. |
| paramNames | List<String> | Lists the names of all the script parameters defined in this page's head section, if it is a HTML page. |
| sourceTenantId | long | The id of the tenant organisation that owns this file's content. |
| textContent | 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. |
| themeResource | 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. |
| websiteBranch | 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. |
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'
| Parameter | Description |
|---|---|
name | the 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.
| Parameter | Description |
|---|---|
name | the parameter name |
value | the 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.
| Parameter | Description |
|---|---|
runTidy | whether 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.
| Parameter | Description |
|---|---|
type | the 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'.
| Parameter | Description |
|---|---|
d | the 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.
| Parameter | Description |
|---|---|
s | the 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.
| Parameter | Description |
|---|---|
w | the 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.